bug-gnu-emacs
[Top][All Lists]
Advanced

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

Re: cosmetical: loading desktop should disable initial mesage


From: Gerd Moellmann
Subject: Re: cosmetical: loading desktop should disable initial mesage
Date: 23 Oct 2001 15:55:23 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.50

Stanislav Brabec <address@hidden> writes:

> I have enabled automatic loading of desktop file.
> After startup, desktop is correctly loaded, but over last loaded file is
> displayed initial message.

Thanks for the report.  Could you please try this:

*** desktop.el  2001/10/23 12:27:41     1.46
--- desktop.el  2001/10/23 13:48:48
***************
*** 576,584 ****
        (setq dirs (cdr dirs)))
        (setq desktop-dirname (and dirs (expand-file-name (car dirs))))
        (if desktop-dirname
!         (progn
            (load (expand-file-name desktop-basefilename desktop-dirname)
                  t t t)
            (run-hooks 'desktop-delay-hook)
            (setq desktop-delay-hook nil)
            (message "Desktop loaded."))
--- 576,592 ----
        (setq dirs (cdr dirs)))
        (setq desktop-dirname (and dirs (expand-file-name (car dirs))))
        (if desktop-dirname
!         (let ((desktop-last-buffer nil))
!           ;; `load-with-code-conversion' calls `eval-buffer' which
!           ;; contains a `save-excursion', so we end up with the same
!           ;; buffer before and after the load.  This is a problem
!           ;; when the desktop is read initially when Emacs starts up
!           ;; because, if we still are in *scratch* after running
!           ;; `after-init-hook', the splash screen will be displayed.
            (load (expand-file-name desktop-basefilename desktop-dirname)
                  t t t)
+           (when desktop-last-buffer
+             (switch-to-buffer desktop-last-buffer))
            (run-hooks 'desktop-delay-hook)
            (setq desktop-delay-hook nil)
            (message "Desktop loaded."))
***************
*** 666,671 ****
--- 674,683 ----
  ;; 
----------------------------------------------------------------------------
  ;; Create a buffer, load its file, set is mode, ...;  called from Desktop file
  ;; only.
+ 
+ (defvar desktop-last-buffer nil
+   "Last buffer read.  Dynamically bound in `desktop-read'.")
+ 
  (defun desktop-create-buffer (ver desktop-buffer-file-name desktop-buffer-name
                                  desktop-buffer-major-mode
                                  mim pt mk ro desktop-buffer-misc
***************
*** 678,683 ****
--- 690,696 ----
        (setq result (funcall handler))
        (setq hlist (cdr hlist)))
      (when (bufferp result)
+       (setq desktop-last-buffer result)
        (set-buffer result)
        (if (not (equal (buffer-name) desktop-buffer-name))
          (rename-buffer desktop-buffer-name))





reply via email to

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