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: Stanislav Brabec
Subject: Re: cosmetical: loading desktop should disable initial mesage
Date: Tue, 23 Oct 2001 22:28:18 +0200
User-agent: Mutt/1.3.23i

Původní zpráva (Gerd Moellmann, Út 23. říjen 2001, 15:55:23 GMT):
> Stanislav Brabec <utx@penguin.cz> 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:
> 
The patch is OK. Running with desktop file in subdir, one can both run
"clean" emacs with startup message and load desktop with last file
displayed.

> *** 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))
> 

-- 
Stanislav Brabec



reply via email to

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