GNU bug report logs - #47075
[FEATURE REQUEST] kill-buffer: option to prompt to save

Previous Next

Package: emacs;

Reported by: Boruch Baum <boruch_baum <at> gmx.com>

Date: Thu, 11 Mar 2021 18:16:01 UTC

Severity: wishlist

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.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 47075 in the body.
You can then email your comments to 47075 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#47075; Package emacs. (Thu, 11 Mar 2021 18:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Boruch Baum <boruch_baum <at> gmx.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 11 Mar 2021 18:16:02 GMT) Full text and rfc822 format available.

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

From: Boruch Baum <boruch_baum <at> gmx.com>
To: Emacs Bug Reporting <bug-gnu-emacs <at> gnu.org>
Subject: [FEATURE REQUEST] kill-buffer: option to prompt to save 
Date: Thu, 11 Mar 2021 13:15:31 -0500
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47075; Package emacs. (Wed, 15 Sep 2021 23:40:02 GMT) Full text and rfc822 format available.

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

From: Federico Tedin <federicotedin <at> gmail.com>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 47075 <at> debbugs.gnu.org
Subject: Re: bug#47075: [FEATURE REQUEST] kill-buffer: option to prompt to
 save 
Date: Thu, 16 Sep 2021 01:39:20 +0200
Sounds like a good improvement, but what do you think about using
read-answer instead of read-char?

Boruch Baum <boruch_baum <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47075; Package emacs. (Fri, 24 Jun 2022 09:05:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 47075 <at> debbugs.gnu.org
Subject: Re: bug#47075: [FEATURE REQUEST] kill-buffer: option to prompt to
 save 
Date: Fri, 24 Jun 2022 11:04:27 +0200
Boruch Baum <boruch_baum <at> 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




bug marked as fixed in version 29.1, send any further explanations to 47075 <at> debbugs.gnu.org and Boruch Baum <boruch_baum <at> gmx.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 24 Jun 2022 09:05:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 22 Jul 2022 11:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 271 days ago.

Previous Next


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