emacs-devel
[Top][All Lists]
Advanced

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

Re: --no-desktop broken?


From: Lars Hansen
Subject: Re: --no-desktop broken?
Date: Mon, 23 Jan 2006 09:24:08 +0100
User-agent: Debian Thunderbird 1.0.2 (X11/20051002)

>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.
*** /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 ----

reply via email to

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