Subject: Re: bug#38818: Dired: mention deleting buffers, not just windows

From: martin rudalics <[email-masked]>
Date: Tue, 31 Dec 2019 08:59:54 +0100

> mr> but I'm afraid we have no facility supplying ...
 >
 >>> To make deleting the buffer the default instead of burying it, use
 >>> (setq ... ...)
 >
 > mr> ... that.
 >
 > OK, but there really should be a way. Else heavy dired users commonly
 > end up with plenty of old buffers by the end of the day.

Since this is about 'quit-window' we would have to decide what to do
with non-dired buffers (*Backtrace*, for example).  Kill them as well?
Provide a separate function 'dired-quit'?

 > (Note that if they toggled the default to now kill, instead of burying
 > the buffer, they would need a way to make an exception. E.g., the argument
 > would then instead bury, not kill.)
 >
 > (Also let's say they have one or two dired buffers they really do want
 > to keep around, despite their "q" hitting habit.
 >
 > Well then perhaps there should be a "dired-mark-this-buffer-as-q-kill-proof"
 > command... Or maybe even a regexp list that the user can put in their
 > .emacs file.)

I don't use dired so I can't tell.  But we could add a buffer-local
variable say 'quit-window-kill-buffer' that would tell for that buffer
what to do whenever quitting a window that shows it: The values being
'auto-kill' (always kill it automatically), 'survive' (don't kill it
even when 'quit-window' was called with a prefix argument) and nil to
do what it does now.  The question remains how to set that variable
conveniently.

martin