emacs-devel
[Top][All Lists]
Advanced

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

Desktop fails reading unknown mode (was: including javascript/ecmascript


From: Juri Linkov
Subject: Desktop fails reading unknown mode (was: including javascript/ecmascript mode)
Date: Sun, 22 Jan 2006 02:51:21 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

After trying out one javascript mode, desktop.el saved its major mode to
the desktop file and failed to restore the whole desktop because one mode
is not in the load path.

I propose to handle this situation more graciously and allow restoring the
desktop even if the Lisp file of one mode can't be obtained.  With the
following patch, desktop.el sets javascript-generic-mode instead of
failing on unavailable javascript-mode.  To me this is an acceptable solution.

Index: lisp/desktop.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/desktop.el,v
retrieving revision 1.96
diff -c -r1.96 desktop.el
*** lisp/desktop.el     14 Dec 2005 07:44:44 -0000      1.96
--- lisp/desktop.el     22 Jan 2006 00:47:41 -0000
***************
*** 966,972 ****
  (defun desktop-load-file (function)
    "Load the file where auto loaded FUNCTION is defined."
    (when function
!     (let ((fcell (symbol-function function)))
        (when (and (listp fcell)
                   (eq 'autoload (car fcell)))
          (load (cadr fcell))))))
--- 966,972 ----
  (defun desktop-load-file (function)
    "Load the file where auto loaded FUNCTION is defined."
    (when function
!     (let ((fcell (and (fboundp function) (symbol-function function))))
        (when (and (listp fcell)
                   (eq 'autoload (car fcell)))
          (load (cadr fcell))))))

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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