* bug#16651: 24.3.50; desktop saves temporary buffers
@ 2014-02-05 7:58 Juri Linkov
2014-02-05 17:05 ` Drew Adams
2014-02-05 21:42 ` Glenn Morris
0 siblings, 2 replies; 8+ messages in thread
From: Juri Linkov @ 2014-02-05 7:58 UTC (permalink / raw)
To: 16651
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#16651: 24.3.50; desktop saves temporary buffers
2014-02-05 7:58 bug#16651: 24.3.50; desktop saves temporary buffers Juri Linkov
@ 2014-02-05 17:05 ` Drew Adams
2014-02-05 21:42 ` Glenn Morris
1 sibling, 0 replies; 8+ messages in thread
From: Drew Adams @ 2014-02-05 17:05 UTC (permalink / raw)
To: Juri Linkov, 16651
> 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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#16651: 24.3.50; desktop saves temporary buffers
2014-02-05 7:58 bug#16651: 24.3.50; desktop saves temporary buffers Juri Linkov
2014-02-05 17:05 ` Drew Adams
@ 2014-02-05 21:42 ` Glenn Morris
2014-02-05 22:07 ` Drew Adams
2014-02-06 8:44 ` Juri Linkov
1 sibling, 2 replies; 8+ messages in thread
From: Glenn Morris @ 2014-02-05 21:42 UTC (permalink / raw)
To: Juri Linkov; +Cc: 16651
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#16651: 24.3.50; desktop saves temporary buffers
2014-02-05 21:42 ` Glenn Morris
@ 2014-02-05 22:07 ` Drew Adams
2014-02-06 8:45 ` Juri Linkov
2014-02-06 8:44 ` Juri Linkov
1 sibling, 1 reply; 8+ messages in thread
From: Drew Adams @ 2014-02-05 22:07 UTC (permalink / raw)
To: Glenn Morris, Juri Linkov; +Cc: 16651
> > 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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#16651: 24.3.50; desktop saves temporary buffers
2014-02-05 21:42 ` Glenn Morris
2014-02-05 22:07 ` Drew Adams
@ 2014-02-06 8:44 ` Juri Linkov
2014-02-06 9:06 ` Andreas Schwab
1 sibling, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2014-02-06 8:44 UTC (permalink / raw)
To: Glenn Morris; +Cc: 16651
>> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#16651: 24.3.50; desktop saves temporary buffers
2014-02-05 22:07 ` Drew Adams
@ 2014-02-06 8:45 ` Juri Linkov
0 siblings, 0 replies; 8+ messages in thread
From: Juri Linkov @ 2014-02-06 8:45 UTC (permalink / raw)
To: Drew Adams; +Cc: 16651
> 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'.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#16651: 24.3.50; desktop saves temporary buffers
2014-02-06 8:44 ` Juri Linkov
@ 2014-02-06 9:06 ` Andreas Schwab
2014-02-07 7:53 ` Juri Linkov
0 siblings, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2014-02-06 9:06 UTC (permalink / raw)
To: Juri Linkov; +Cc: 16651
Juri Linkov <juri@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@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#16651: 24.3.50; desktop saves temporary buffers
2014-02-06 9:06 ` Andreas Schwab
@ 2014-02-07 7:53 ` Juri Linkov
0 siblings, 0 replies; 8+ messages in thread
From: Juri Linkov @ 2014-02-07 7:53 UTC (permalink / raw)
To: Andreas Schwab; +Cc: 16651-done
>> -(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 "\\` ".
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-02-07 7:53 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-05 7:58 bug#16651: 24.3.50; desktop saves temporary buffers Juri Linkov
2014-02-05 17:05 ` Drew Adams
2014-02-05 21:42 ` Glenn Morris
2014-02-05 22:07 ` Drew Adams
2014-02-06 8:45 ` Juri Linkov
2014-02-06 8:44 ` Juri Linkov
2014-02-06 9:06 ` Andreas Schwab
2014-02-07 7:53 ` Juri Linkov
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).