unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Federico Tedin <federicotedin@gmail.com>
To: Boruch Baum <boruch_baum@gmx.com>
Cc: 47075@debbugs.gnu.org
Subject: bug#47075: [FEATURE REQUEST] kill-buffer: option to prompt to save
Date: Thu, 16 Sep 2021 01:39:20 +0200	[thread overview]
Message-ID: <87k0jh5ryv.fsf@gmail.com> (raw)
In-Reply-To: <20210311181531.u5vkl25o7qyefnzk@E15-2016.optimum.net> (Boruch Baum's message of "Thu, 11 Mar 2021 13:15:31 -0500")

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





  reply	other threads:[~2021-09-15 23:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2022-06-24  9:04 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k0jh5ryv.fsf@gmail.com \
    --to=federicotedin@gmail.com \
    --cc=47075@debbugs.gnu.org \
    --cc=boruch_baum@gmx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).