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

From: Ivan Shmakov <[email-masked]>
Date: Sun, 30 Nov 2014 20:15:49 +0000

>>>>> Glenn Morris <[email-masked]> writes:
>>>>> Ivan Shmakov wrote:

 >> * eww.el (eww-mode): Autoload, as expected by desktop.el.

 > Then IMO desktop.el should autoload it, rather than adding a general
 > autoload cookie.

	That’s the point: as currently implemented, desktop.el uses a
	general autoload cookie to map major modes (as preserved in the
	desktop file) to Emacs features to load before handling any
	given buffer.  Consider, for instance:

   514	Modules that define a major mode that needs a special handler should contain
   515	code like
   516	
   517	   (defun foo-restore-desktop-buffer
   518	   ...
   519	   (add-to-list 'desktop-buffer-mode-handlers
   520	                '(foo-mode . foo-restore-desktop-buffer))
   521	
   522	Furthermore the major mode function must be autoloaded.")
…
  1319	(defun desktop-load-file (function)
  1320	  "Load the file where auto loaded FUNCTION is defined."
  1321	  (when (fboundp function)
  1322	    (autoload-do-load (symbol-function function) function)))
…

	(See also the uses of desktop-load-file in desktop.el.)

 > (Yes, this may be inconsistent with some existing cases.)

	As for the existing cases, the change suggested exactly matches
	info.el:

  4222	;; Autoload cookie needed by desktop.el
  4223	;;;###autoload
  4224	(define-derived-mode Info-mode nil "Info" ;FIXME: Derive from special-mode?
…
  4312	  (setq-local bookmark-make-record-function #'Info-bookmark-make-record))

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