unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: emacs-devel@gnu.org
Subject: Desktop fails reading unknown mode (was: including javascript/ecmascript mode)
Date: Sun, 22 Jan 2006 02:51:21 +0200	[thread overview]
Message-ID: <87hd7x6ryx.fsf_-_@jurta.org> (raw)
In-Reply-To: <uhd81optq.fsf_-_@gmail.com> (Mathias Dahl's message of "Wed, 18 Jan 2006 10:20:01 +0100")

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/

  parent reply	other threads:[~2006-01-22  0:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-13 17:27 css-mode Stefan Monnier
2006-01-13 20:33 ` css-mode Edward O'Connor
2006-01-13 22:16   ` css-mode Stefan Monnier
2006-01-14 16:14 ` css-mode Richard M. Stallman
2006-01-15  1:09   ` css-mode Kenichi Handa
2006-01-15 13:34     ` css-mode Alex Schroeder
2006-01-17 11:39       ` css-mode Karl Chen
2006-01-18  9:20         ` including javascript/ecmascript mode (was: css-mode) Mathias Dahl
2006-01-18 12:35           ` including javascript/ecmascript mode Lennart Borgman
2006-01-18 15:43           ` Stefan Monnier
2006-01-18 17:05           ` Edward O'Connor
2006-01-25 23:52             ` Karl Chen
2006-01-22  0:44           ` Juri Linkov
2006-01-22  0:51           ` Juri Linkov [this message]
2006-01-22 17:44             ` Desktop fails reading unknown mode (was: including javascript/ecmascript mode) Richard M. Stallman
2006-01-21  2:55       ` css-mode Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hd7x6ryx.fsf_-_@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).