From: Oliver Taylor <olivertaylor@me.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: emacs-devel@gnu.org
Subject: Re: Variable for Confirming Killing a Buffer
Date: Fri, 3 Dec 2021 11:45:35 -0800 [thread overview]
Message-ID: <3E13280E-45F8-4958-BE9B-C19FE2E5235B@me.com> (raw)
In-Reply-To: <87tufpvd5z.fsf@gnus.org>
> On Dec 3, 2021, at 8:58 AM, Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
>> (add-hook 'kill-buffer-query-functions #'buffer-confirm-kill-p)
>
> I'm not sure this is the best way to achieve this -- and it'll get in
> the way of some things that create buffers and then expect to be able to
> kill them off without any queries, I think.
Yes, I would expect that there’s a better way to do this. But as-is this doesn’t get in the way simply because it requires the buffer-local variable to be explicitly set.
> Perhaps we should instead bind `C-x k' to a new command that calls
> kill-buffer after (possibly) querying the user instead.
I would imagine the flaw with this is that there are probably a lot of different ways buffers get killed, and a key binding is only one of them, so it would only offer a little protection.
> As for the feature itself, I expect people to want to be able to kill
> some buffers without query, anyway, so perhaps it should allow a list of
> major modes that should be queried?
Would this be better accomplished by setting the variable via a mode-hook?
next prev parent reply other threads:[~2021-12-03 19:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-02 21:06 Variable for Confirming Killing a Buffer Oliver Taylor
2021-12-02 22:41 ` Stefan Kangas
2021-12-02 23:17 ` Philip Kaludercic
2021-12-02 23:25 ` Oliver Taylor
2021-12-03 16:58 ` Lars Ingebrigtsen
2021-12-03 19:24 ` Michael Heerdegen
2021-12-03 21:35 ` Lars Ingebrigtsen
2021-12-03 22:27 ` Michael Heerdegen
2021-12-03 22:33 ` Lars Ingebrigtsen
2021-12-03 19:45 ` Oliver Taylor [this message]
2021-12-03 21:32 ` 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=3E13280E-45F8-4958-BE9B-C19FE2E5235B@me.com \
--to=olivertaylor@me.com \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.org \
/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).