Subject: Re: bug#19226: eww.el desktop support fixes: autoload eww-mode, use inhibit-read-only

From: Ivan Shmakov <[email-masked]>
Date: Tue, 09 Dec 2014 19:45:47 +0000

>>>>> Stefan Monnier <[email-masked]> writes:

 >> 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.

 > I see.  Maybe the problem then is that desktop.el should be changed
 > so that it records `eww-restore-desktop' as the handler function for
 > this buffer in the desktop file.  I. e. those
 > desktop-buffer-mode-handlers should be looked up while *saving* the
 > desktop file rather than while reading them.

	Yes.  Yet I fail to see how that would be an improvement?

	First of all, we already can trigger .emacs.desktop
	incompatibility when the format of the value stored in there
	changes.  Now, we also make that fail when it’s the /name/ of
	the handler function that changes.  (I presume that the change
	in the mode name is much less likely on one side, and much more
	likely to get a defalias on the other.)

	Moreover, instead of (or, well, in addition to) an autoload for
	the mode function, we now need an autoload for the handler.

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A