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

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

`desktop-buffers-not-to-save' does not work with dired buffers


From: samuel padgett
Subject: `desktop-buffers-not-to-save' does not work with dired buffers
Date: 08 Oct 2000 13:49:08 -0400

This bug report will be sent to the Free Software Foundation,
 not to your local site managers!!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

In GNU Emacs 20.7.1 (i386-redhat-linux-gnu, X toolkit)
 of Thu Aug 24 2000 on porky.devel.redhat.com
configured using `configure  --mandir=/usr/share/man --infodir=/usr/share/info 
--prefix=/usr --libexecdir=/usr/lib --sharedstatedir=/var --with-gcc --with-pop 
--with-x-toolkit i386-redhat-linux-gnu'

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:


I have the following in my .emacs:

(setq desktop-buffers-not-to-save "")
(add-to-list 'desktop-globals-to-save 'file-name-history)
(add-to-list 'desktop-globals-to-save 'command-history)
(add-to-list 'desktop-globals-to-save 'extended-command-history)
(desktop-load-default)
(desktop-read)

This allows me save command history without having to wait for Emacs
to reload every buffer I had open at the end of the previous session.
This seems to work most of the time.  When I exit emacs with dired
buffers open, however, they are reloaded at startup.  I've seen this
behavior with Emacs 19.34 on AIX and Emacs 20.7 on Linux.

I posted a message describing the behavior to comp.emacs (see thread
"desktop and dired").  Colin Walters kindly followed up with this
response:

> Ok.  Looking at `desktop-save-buffer-p', we see
>
> (defun desktop-save-buffer-p (filename bufname mode &rest dummy)
>   "Return t if the desktop should record a particular buffer for next startup.
> FILENAME is the visited file name, BUFNAME is the buffer name, and
> MODE is the major mode."
>   (let ((case-fold-search nil))
>     (or (and filename
>            (not (string-match desktop-buffers-not-to-save bufname))
>            (not (string-match desktop-files-not-to-save filename)))
>       (and (eq mode 'dired-mode)
>            (save-excursion
>              (set-buffer (get-buffer bufname))
>              (not (string-match desktop-files-not-to-save
>                                 default-directory))))
>       (and (null filename)
>            (memq mode '(Info-mode rmail-mode))))))
> 
> Now, a dired buffer won't have a filename, so it drops through to the
> (eq mode 'dired-mode) clause.  Given this, it seems like you might
> have to say:
>
> (setq desktop-files-not-to-save "")

His suggestion works, but I still think the desktop.el behavior is
wrong.  Why the special case for dired buffers?  Why do I need to set
`desktop-files-not-to-save' when dired buffers don't have a
(buffer-file-name)?

The doc string for `desktop-buffers-not-to-save' reads

  Regexp identifying buffers that are to be excluded from saving.

desktop.el doesn't appear to be behaving as advertised.


Recent input:
i l - u s e r tab return C-x C-f . e m tab return C-s 
m a i l C-s C-s C-s C-s C-s C-s down down C-e return 
( s e t q SPC m a i l - u s e r - a g e n t SPC ' m 
e s s a g e - u s e r - a g e n t ) C-x C-e C-x C-s 
C-x b return C-x k return C-x 1 M-x M-p M-p M-x s u 
b tab M-backspace e m C-g menu-bar help-menu repor
t-emacs-bug

Recent messages:
Fontifying .emacs...
Fontifying .emacs... (regexps............)
(Next local Ispell command will use american dictionary) [2 times]
Starting new Ispell process...
Mark saved where search started
message-user-agent
Loading time-stamp...
Loading time-stamp...done
Wrote /home/sam/.emacs
Beginning of history; no preceding item
Quit [2 times]



reply via email to

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