[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#19226: eww.el desktop support fixes: autoload eww-mode, use inhibit-
From: |
Ivan Shmakov |
Subject: |
bug#19226: eww.el desktop support fixes: autoload eww-mode, use inhibit-read-only |
Date: |
Sun, 07 Dec 2014 18:56:52 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
>>>>> Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
[…]
>> Moreover, “general purpose” modes are ought to be autoloaded anyway.
>> I see no reason to second-guess this case at the least.
> I tend to agree. If the major-mode is not autoloaded (as in the eww
> case), it's quite likely to be a special major mode that is better
> entered via some other function
The problem here is that desktop.el should explicitly be pointed
to the function to do all the special handling for the mode,
which is (conventionally) done like:
(add-to-list 'desktop-buffer-mode-handlers
'(eww-mode . eww-restore-desktop))
The problem is: to get /that/ evaluated, desktop.el needs to
first load eww.el, leading to a chicken and egg problem.
The current implementation suggests it to be solved as follows:
• the major mode is marked as autoloaded;
• when desktop-read encounters a major mode which is not
currently loaded, it loads the respective library (using
desktop-load-file, which in turn calls autoload-do-load);
• that library modifies desktop-buffer-mode-handlers as
appropriate (see above.)
The following “special” modes explicitly document the use of
autoloads to satisfy this desktop.el requirement:
$ grep -rF --include=\*.el -- needed\ by\ desktop.el lisp/
lisp/dired.el:;; Autoload cookie needed by desktop.el
lisp/info.el:;; Autoload cookie needed by desktop.el
lisp/mh-e/mh-folder.el:;; Autoload cookie needed by desktop.el
$
The others (doc-view-mode?) do that quietly. And I guess there
may be a few (vc-dir-mode?) that fail there.
> (e. g. store the URL and recreate the buffer via `eww' which will
> take care calling eww-mode (and loading any file that this may
> require)).
… Yet that’s by no means necessary, – it’s perfectly possible to
invoke M-x eww-mode from just any (empty) buffer, and then use
‘G’ to point EWW to the Web page of interest.
Hence, the trick mentioned in etc/NEWS isn’t necessary, either.
*** You can now use several eww buffers in parallel by renaming eww
buffers you want to keep separate.
--
FSF associate member #7257 http://boycottsystemd.org/ … 3013 B6A0 230E 334A