From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Hansen Newsgroups: gmane.emacs.devel Subject: Re: --no-desktop broken? Date: Mon, 23 Jan 2006 09:24:08 +0100 Message-ID: <43D492A8.2090501@soem.dk> References: <1137804521.206430.18968.nullmailer@Update.UU.SE> <43D2012A.8050406@soem.dk> <2E5FEB1A-6442-41BC-BDEC-60A1B45C13E6@raeburn.org> <43D36D66.9010108@soem.dk> <87mzhnfykz.fsf@jurta.org> <87fynf32w8.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000504050706010000040306" X-Trace: sea.gmane.org 1138004908 13216 80.91.229.2 (23 Jan 2006 08:28:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 23 Jan 2006 08:28:28 +0000 (UTC) Cc: Eli Zaretskii , raeburn@raeburn.org, ams@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 23 09:28:25 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 1F0x3k-0005tm-OB for ged-emacs-devel@m.gmane.org; Mon, 23 Jan 2006 09:28:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F0x6M-0005iS-PX for ged-emacs-devel@m.gmane.org; Mon, 23 Jan 2006 03:31:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F0x2m-0004m4-JR for emacs-devel@gnu.org; Mon, 23 Jan 2006 03:27:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F0x2g-0004kv-UN for emacs-devel@gnu.org; Mon, 23 Jan 2006 03:27:16 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F0x2d-0004kf-D4 for emacs-devel@gnu.org; Mon, 23 Jan 2006 03:27:11 -0500 Original-Received: from [212.99.225.245] (helo=odin.broadcom.dk) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1F0x7G-0002u0-3d; Mon, 23 Jan 2006 03:31:58 -0500 Original-Received: from pppoe3-ves.broadcom.dk ([212.99.255.42] helo=[10.17.1.133]) by odin.broadcom.dk with esmtp (Exim 4.24; FreeBSD) id 1F0wze-000DrD-SG; Mon, 23 Jan 2006 09:24:06 +0100 User-Agent: Debian Thunderbird 1.0.2 (X11/20051002) X-Accept-Language: en-us, en Original-To: Juri Linkov In-Reply-To: <87fynf32w8.fsf@jurta.org> X-Enigmail-Version: 0.91.0.0 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:49439 Archived-At: This is a multi-part message in MIME format. --------------000504050706010000040306 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit >Only the first solution loads desktop.el, and I agree that it is not >a good solution. The remaining two solutions don't load desktop.el. >They use the autoload cookie. This means that at the time startup.el >starts processing command switches, it already has "--no-desktop" >in `command-switch-alist' without loading desktop.el. The effect is >exactly the same as adding "--no-desktop" to the local variable >`longopts' in `command-line-1'. I think not using package-specific >switches in startup.el gives better modularity. > I like your last solution. It works right and has better modularity. Also I think the '"--no-desktop" ignored' message is more confusing than helpful. So I suggest the attached patch. If there are no objections, I will install in a couple of days. --------------000504050706010000040306 Content-Type: text/x-patch; name="patch.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch.diff" *** /home/lh/cvsroot/emacs/lisp/desktop.el.~1.97.~ 2006-01-23 08:13:25.000000000 +0100 --- /home/lh/cvsroot/emacs/lisp/desktop.el 2006-01-23 08:28:12.766853621 +0100 *************** *** 1156,1161 **** --- 1156,1162 ---- ;; after finishing loading the init file. ;; We cannot use `command-switch-alist' to process "--no-desktop" because these ;; functions are processed after `after-init-hook'. + ;;;###autoload (add-hook 'after-init-hook '(lambda () *** /home/lh/cvsroot/emacs/lisp/startup.el.orig 2006-01-23 08:13:25.714942861 +0100 --- /home/lh/cvsroot/emacs/lisp/startup.el 2006-01-23 08:23:20.391560955 +0100 *************** *** 1632,1638 **** (longopts (append '(("--funcall") ("--load") ("--insert") ("--kill") ("--directory") ("--eval") ("--execute") ("--no-splash") ! ("--find-file") ("--visit") ("--file") ("--no-desktop")) (mapcar (lambda (elt) (list (concat "-" (car elt)))) command-switch-alist))) --- 1632,1638 ---- (longopts (append '(("--funcall") ("--load") ("--insert") ("--kill") ("--directory") ("--eval") ("--execute") ("--no-splash") ! ("--find-file") ("--visit") ("--file")) (mapcar (lambda (elt) (list (concat "-" (car elt)))) command-switch-alist))) *************** *** 1732,1744 **** ((equal argi "-kill") (kill-emacs t)) - ;; This is for when they use --no-desktop with -q, or - ;; don't load Desktop in their .emacs. If desktop.el - ;; _is_ loaded, it will handle this switch, and we - ;; won't see it by the time we get here. - ((equal argi "-no-desktop") - (message "\"--no-desktop\" ignored because the Desktop package is not loaded")) - ((string-match "^\\+[0-9]+\\'" argi) (setq line (string-to-number argi))) --- 1732,1737 ---- --------------000504050706010000040306 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --------------000504050706010000040306--