GNU bug report logs - #16651
24.3.50; desktop saves temporary buffers

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Wed, 5 Feb 2014 08:14:01 UTC

Severity: minor

Found in version 24.3.50

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16651 in the body.
You can then email your comments to 16651 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#16651; Package emacs. (Wed, 05 Feb 2014 08:14:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> jurta.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 05 Feb 2014 08:14:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; desktop saves temporary buffers
Date: Wed, 05 Feb 2014 09:58:52 +0200
With the desktop mode enabled and `C-h S info-lookup-symbol RET'
info-look.el creates a temporary buffer with the name " temp-info-look"
that is saved to the desktop because this buffer is in Info mode
saved by `Info-desktop-buffer-misc-data'.

I see two possible solutions: skip saving all buffers with the
leading space in the buffer name, or if this problem is Info specific
then fix it in `Info-desktop-buffer-misc-data' to return nil for
Info buffers with the leading space in the buffer name.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16651; Package emacs. (Wed, 05 Feb 2014 17:06:02 GMT) Full text and rfc822 format available.

Message #8 received at 16651 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Juri Linkov <juri <at> jurta.org>, 16651 <at> debbugs.gnu.org
Subject: RE: bug#16651: 24.3.50; desktop saves temporary buffers
Date: Wed, 5 Feb 2014 09:05:21 -0800 (PST)
> With the desktop mode enabled and `C-h S info-lookup-symbol RET'
> info-look.el creates a temporary buffer with the name " temp-info-
> look"
> that is saved to the desktop because this buffer is in Info mode
> saved by `Info-desktop-buffer-misc-data'.
> 
> I see two possible solutions: skip saving all buffers with the
> leading space in the buffer name, or if this problem is Info
> specific
> then fix it in `Info-desktop-buffer-misc-data' to return nil for
> Info buffers with the leading space in the buffer name.

I'm not following this thread - please excuse any ignorance
wrt this topic.

If the question of whether to save buffers whose name begins
with a space is being posed then why not leave that up to the
user, by providing an option to decide it?

Or if you think that users might want even more control, saving
some but not all such buffers, maybe:

* By default, exclude such buffers (and perhaps other kinds of
  "insignificant" buffers or buffers that are difficult to
  re-create or whatever).

* Provide an option that users can use to specify particular
  buffers or a regexp matching buffers that should not be
  excluded.

I'm guessing that it can be hard for Emacs to guess just what
users will need/want in this regard, and so it is better to
define a reasonable default behavior but also give users a
way to override that.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16651; Package emacs. (Wed, 05 Feb 2014 21:43:01 GMT) Full text and rfc822 format available.

Message #11 received at 16651 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Juri Linkov <juri <at> jurta.org>
Cc: 16651 <at> debbugs.gnu.org
Subject: Re: bug#16651: 24.3.50; desktop saves temporary buffers
Date: Wed, 05 Feb 2014 16:42:12 -0500
Juri Linkov wrote:

> I see two possible solutions: skip saving all buffers with the
> leading space in the buffer name,

I cannot imagine any reason why such buffers should ever be saved in a
desktop.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16651; Package emacs. (Wed, 05 Feb 2014 22:08:02 GMT) Full text and rfc822 format available.

Message #14 received at 16651 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Glenn Morris <rgm <at> gnu.org>, Juri Linkov <juri <at> jurta.org>
Cc: 16651 <at> debbugs.gnu.org
Subject: RE: bug#16651: 24.3.50; desktop saves temporary buffers
Date: Wed, 5 Feb 2014 14:07:27 -0800 (PST)
> > I see two possible solutions: skip saving all buffers with the
> > leading space in the buffer name,
> 
> I cannot imagine any reason why such buffers should ever be
> saved in a desktop.

Many, perhaps most, things a user might want (or might do)
cannot be imagined, by even the most imaginative of designers.

"Should" in such a context, can be applied reasonably only
to the _default_ behavior.

A user doing something that involves _display_ of temporary
buffers (which include buffers such as `*Pp Eval Output*',
`*Messages* and `*scratch*', as well as _internal_ buffers,
which are buffers whose names start with a space) might well
want to save the current Emacs state, including the display of
such a buffer.

There is no sense in deciding the behavior in a black-and-white,
one-size-fits-all way.  One reasonable default behavior would
be to exclude such buffers from saving, but users should be
able to easily customize this.

Another reasonable default behavior would be to exclude all
such buffers that are not displayed.  It is rare that such a
buffer is displayed, and if that happens it is the user who
has forced it.  Emacs should not assume that a displayed
buffer should not be saved (except by default).

In most cases the state (e.g. contents) of a temporary buffer
cannot be restored, in any case.  But the display of such
a buffer can be recorded and restored.  A user might well
position `*Messages*' or `*Buffer List*' specially and want
that display to be restored, regardless of the current
buffer contents.

An internal buffer that is displayed is no different in this
respect.

But again, whatever the default behavior, let users override
it easily.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16651; Package emacs. (Thu, 06 Feb 2014 09:02:01 GMT) Full text and rfc822 format available.

Message #17 received at 16651 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 16651 <at> debbugs.gnu.org
Subject: Re: bug#16651: 24.3.50; desktop saves temporary buffers
Date: Thu, 06 Feb 2014 10:44:35 +0200
>> I see two possible solutions: skip saving all buffers with the
>> leading space in the buffer name,
>
> I cannot imagine any reason why such buffers should ever be saved in a
> desktop.

Such buffers can be skipped by this patch.  I hope this
doesn't contradict the arguments made in bug#3833.

=== modified file 'lisp/desktop.el'
--- lisp/desktop.el	2014-01-31 06:42:29 +0000
+++ lisp/desktop.el	2014-02-06 08:38:32 +0000
@@ -350,11 +353,11 @@ (defcustom desktop-locals-to-save
   :type '(repeat symbol)
   :group 'desktop)
 
-(defcustom desktop-buffers-not-to-save nil
+(defcustom desktop-buffers-not-to-save "^ "
   "Regexp identifying buffers that are to be excluded from saving."
   :type '(choice (const :tag "None" nil)
 		 regexp)
-  :version "23.2"                       ; set to nil
+  :version "24.4"		    ; skip invisible temporary buffers
   :group 'desktop)
 
 ;; Skip tramp and ange-ftp files





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16651; Package emacs. (Thu, 06 Feb 2014 09:03:02 GMT) Full text and rfc822 format available.

Message #20 received at 16651 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Glenn Morris <rgm <at> gnu.org>, 16651 <at> debbugs.gnu.org
Subject: Re: bug#16651: 24.3.50; desktop saves temporary buffers
Date: Thu, 06 Feb 2014 10:45:37 +0200
> But again, whatever the default behavior, let users override
> it easily.

Users will be able to override it easily by customizing
`desktop-buffers-not-to-save'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16651; Package emacs. (Thu, 06 Feb 2014 09:07:01 GMT) Full text and rfc822 format available.

Message #23 received at 16651 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> suse.de>
To: Juri Linkov <juri <at> jurta.org>
Cc: Glenn Morris <rgm <at> gnu.org>, 16651 <at> debbugs.gnu.org
Subject: Re: bug#16651: 24.3.50; desktop saves temporary buffers
Date: Thu, 06 Feb 2014 10:06:25 +0100
Juri Linkov <juri <at> jurta.org> writes:

> === modified file 'lisp/desktop.el'
> --- lisp/desktop.el	2014-01-31 06:42:29 +0000
> +++ lisp/desktop.el	2014-02-06 08:38:32 +0000
> @@ -350,11 +353,11 @@ (defcustom desktop-locals-to-save
>    :type '(repeat symbol)
>    :group 'desktop)
>  
> -(defcustom desktop-buffers-not-to-save nil
> +(defcustom desktop-buffers-not-to-save "^ "

Please use "\\` " instead, since a buffer name can include embedded
newlines.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




Reply sent to Juri Linkov <juri <at> jurta.org>:
You have taken responsibility. (Fri, 07 Feb 2014 07:55:01 GMT) Full text and rfc822 format available.

Notification sent to Juri Linkov <juri <at> jurta.org>:
bug acknowledged by developer. (Fri, 07 Feb 2014 07:55:04 GMT) Full text and rfc822 format available.

Message #28 received at 16651-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Andreas Schwab <schwab <at> suse.de>
Cc: Glenn Morris <rgm <at> gnu.org>, 16651-done <at> debbugs.gnu.org
Subject: Re: bug#16651: 24.3.50; desktop saves temporary buffers
Date: Fri, 07 Feb 2014 09:53:44 +0200
>> -(defcustom desktop-buffers-not-to-save nil
>> +(defcustom desktop-buffers-not-to-save "^ "
>
> Please use "\\` " instead, since a buffer name can include embedded
> newlines.

Installed with "\\` ".




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 07 Mar 2014 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 74 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.