From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Desktop fails reading unknown mode (was: including javascript/ecmascript mode) Date: Sun, 22 Jan 2006 02:51:21 +0200 Organization: JURTA Message-ID: <87hd7x6ryx.fsf_-_@jurta.org> References: <878xtkghxj.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1137894462 2075 80.91.229.2 (22 Jan 2006 01:47:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 22 Jan 2006 01:47:42 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 22 02:47:37 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F0UKE-00038c-SA for ged-emacs-devel@m.gmane.org; Sun, 22 Jan 2006 02:47:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F0UMn-0000QC-TA for ged-emacs-devel@m.gmane.org; Sat, 21 Jan 2006 20:50:05 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F0UGs-0002Yg-Fp for emacs-devel@gnu.org; Sat, 21 Jan 2006 20:43:58 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F0UGq-0002VO-7B for emacs-devel@gnu.org; Sat, 21 Jan 2006 20:43:57 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F0UGp-0002Uy-7R for emacs-devel@gnu.org; Sat, 21 Jan 2006 20:43:55 -0500 Original-Received: from [194.126.101.111] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1F0ULI-0005AF-S3 for emacs-devel@gnu.org; Sat, 21 Jan 2006 20:48:33 -0500 Original-Received: from mail.neti.ee (80-235-32-6-dsl.mus.estpak.ee [80.235.32.6]) by Relayhost1.neti.ee (Postfix) with ESMTP id 7734D16B8; Sun, 22 Jan 2006 03:41:14 +0200 (EET) Original-To: Mathias Dahl In-Reply-To: (Mathias Dahl's message of "Wed, 18 Jan 2006 10:20:01 +0100") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:49376 Archived-At: 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/