From: Tassilo Horn <tsdh@gnu.org>
To: Help GNU Emacs <help-gnu-emacs@gnu.org>
Subject: Re: Is there any local variable to avoid asking me to save buffer on kill-buffer?
Date: Mon, 16 Dec 2024 13:04:06 +0100 [thread overview]
Message-ID: <874j33bzrd.fsf@gnu.org> (raw)
In-Reply-To: <Z1_TcnSTbTr69NMU@lco2> (Jean Louis's message of "Mon, 16 Dec 2024 10:14:58 +0300")
Jean Louis <bugs@gnu.support> writes:
> (defun rcd-temp-buffer-kill-current ()
> "Kill current buffer without asking."
> (interactive)
> (let ((buffer-name (buffer-name (current-buffer))))
> (kill-matching-buffers-no-ask (regexp-quote buffer-name))
> (message "Killed: " buffer-name)))
>
> I see that above attempt is again asking me, but function is called
> "no-ask". Is that a bug?
Not really, but a bit strange maybe. kill-matching-buffers-no-ask calls
kill-matching-buffers with no-ask arg set to t. That results in buffers
being killed with kill-buffer instead of kill-buffer-ask. The latter
would require confirmation for any buffer to be killed.
However, kill-buffer itself will query anyhow in certain cases,
especially when you have unsaved changes in the buffer which you
probably have.
So it depends on how one interprets "no-ask". The current
interpretation seems to be "don't ask unless you might lose data" in
contrast to "never" which you seem to expect.
HTH,
Tassilo
next prev parent reply other threads:[~2024-12-16 12:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-16 6:59 Is there any local variable to avoid asking me to save buffer on kill-buffer? Jean Louis
2024-12-16 7:14 ` Jean Louis
2024-12-16 12:04 ` Tassilo Horn [this message]
2024-12-16 12:25 ` Eduardo Ochs
2024-12-16 15:00 ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-12-16 16:13 ` Jean Louis
2024-12-16 19:39 ` Suhail Singh
2024-12-16 21:02 ` Jean Louis
2024-12-16 21:26 ` Suhail Singh
2024-12-17 4:05 ` Jean Louis
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=874j33bzrd.fsf@gnu.org \
--to=tsdh@gnu.org \
--cc=help-gnu-emacs@gnu.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.
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).