unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47075: [FEATURE REQUEST] kill-buffer: option to prompt to save
@ 2021-03-11 18:15 Boruch Baum
  2021-09-15 23:39 ` Federico Tedin
  2022-06-24  9:04 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 3+ messages in thread
From: Boruch Baum @ 2021-03-11 18:15 UTC (permalink / raw)
  To: 47075

Evaluating function `kill-buffer' for a modified file buffer leads to a
prompt "foo modified, kill anyway (y or n)". Thus, for the common case
of a user wanting to save and kill a modified buffer, the user must at
this point perform three operations: respond no to the prompt, save the
file, perform the kill-buffer operation a second time.

It would be more convenient for the prompt to offer an option to 'save
and kill' the buffer, so that no extra steps be required.

I had wanted to offer a patch for this, but I couldn't find the elisp
function that was directly causing the prompt. My guess is that it is
directly called by the C source code for function kill-buffer, but I
don't have the C source code available. If so, the idea would likely be to
replace a call to y-or-n-p with a read-char loop, checking for (y Y n N
s S).

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#47075: [FEATURE REQUEST] kill-buffer: option to prompt to save
  2021-03-11 18:15 bug#47075: [FEATURE REQUEST] kill-buffer: option to prompt to save Boruch Baum
@ 2021-09-15 23:39 ` Federico Tedin
  2022-06-24  9:04 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Federico Tedin @ 2021-09-15 23:39 UTC (permalink / raw)
  To: Boruch Baum; +Cc: 47075

Sounds like a good improvement, but what do you think about using
read-answer instead of read-char?

Boruch Baum <boruch_baum@gmx.com> writes:

> Evaluating function `kill-buffer' for a modified file buffer leads to a
> prompt "foo modified, kill anyway (y or n)". Thus, for the common case
> of a user wanting to save and kill a modified buffer, the user must at
> this point perform three operations: respond no to the prompt, save the
> file, perform the kill-buffer operation a second time.
>
> It would be more convenient for the prompt to offer an option to 'save
> and kill' the buffer, so that no extra steps be required.
>
> I had wanted to offer a patch for this, but I couldn't find the elisp
> function that was directly causing the prompt. My guess is that it is
> directly called by the C source code for function kill-buffer, but I
> don't have the C source code available. If so, the idea would likely be to
> replace a call to y-or-n-p with a read-char loop, checking for (y Y n N
> s S).
>
> --
> hkp://keys.gnupg.net
> CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#47075: [FEATURE REQUEST] kill-buffer: option to prompt to save
  2021-03-11 18:15 bug#47075: [FEATURE REQUEST] kill-buffer: option to prompt to save Boruch Baum
  2021-09-15 23:39 ` Federico Tedin
@ 2022-06-24  9:04 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-24  9:04 UTC (permalink / raw)
  To: Boruch Baum; +Cc: 47075

Boruch Baum <boruch_baum@gmx.com> writes:

> Evaluating function `kill-buffer' for a modified file buffer leads to a
> prompt "foo modified, kill anyway (y or n)". Thus, for the common case
> of a user wanting to save and kill a modified buffer, the user must at
> this point perform three operations: respond no to the prompt, save the
> file, perform the kill-buffer operation a second time.
>
> It would be more convenient for the prompt to offer an option to 'save
> and kill' the buffer, so that no extra steps be required.

Yes, makes sense to me.  I've now fixed this in Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-24  9:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 18:15 bug#47075: [FEATURE REQUEST] kill-buffer: option to prompt to save Boruch Baum
2021-09-15 23:39 ` Federico Tedin
2022-06-24  9:04 ` Lars Ingebrigtsen

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