GNU bug report logs - #19226
eww.el desktop support fixes: autoload eww-mode, use inhibit-read-only

Previous Next

Package: emacs;

Reported by: Ivan Shmakov <ivan <at> siamics.net>

Date: Sun, 30 Nov 2014 11:05:01 UTC

Severity: normal

Tags: patch

Done: Ivan Shmakov <ivan <at> siamics.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ivan Shmakov <ivan <at> siamics.net>
To: 19226 <at> debbugs.gnu.org
Subject: bug#19226: eww.el desktop support fixes: autoload eww-mode, use inhibit-read-only 
Date: Sun, 07 Dec 2014 18:56:52 +0000
>>>>> Stefan Monnier <monnier <at> 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




This bug report was last modified 10 years and 153 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.