[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rename `eww' to `web'

From: Stefan Monnier
Subject: Re: Rename `eww' to `web'
Date: Sat, 06 Jul 2013 05:31:22 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> The magic seems to happen so.

>    (get operation 'url-file-handlers)
>    (put 'insert-file-contents 'url-file-handlers 'url-insert-file-contents)

> So `url-file-handlers' (actually `url-insert') need to check for
> `(mm-handle-media-type handle)' and call one of the handlers (See
> `eww-render').

>         (cond
>          ((equal (car content-type) "text/html")
>           (eww-display-html charset url))
>          ((string-match "^image/" (car content-type))
>           (eww-display-image))
>          (t
>           (eww-display-raw charset)))

The problem is indeed that find-file's code separates the "fetch data"
from "setup major mode", so the way it works is fairly different from
the way eww works.

> Are there any intervening operation between `insert-file-contents' and
> `find-file-hook'.
>    (add-hook 'find-file-hook 'url-handlers-set-buffer-mode)

That doesn't sound very reliable.

> Btw, url-handler-mode seems to be doing synchronous fetch while eww
> seems to do an aynch fetch.  Should C-x C-f be "blocking" or can it be
> an "asynchronous" C-x C-f?

Indeed, that's another important difference.  Maybe if we want to invoke
eww from C-x C-f we need to do it at a higher level than in
insert-file-contents and/or find-file-hook, e.g. something more like
find-directory-functions (tho not for directories), and only if
find-file is called interactively.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]