From: Drew Adams <drew.adams@oracle.com>
To: "R. Diez" <rdiezmail-emacs@yahoo.de>, emacs-devel@gnu.org
Subject: RE: kill-matching-buffers without confirmation
Date: Mon, 22 May 2017 15:21:27 -0700 (PDT) [thread overview]
Message-ID: <6e11051e-1a41-426b-97be-de1d70480c34@default> (raw)
In-Reply-To: <537757403.6158992.1495470490914@mail.yahoo.com>
> Could someone please add a clean way for 'kill-matching-buffers' to not ask
> for confirmation?...
>
> I am tired of overriding 'kill-buffer-ask' with flet as suggested there,
> and then seeing this warning:
>
> Warning (bytecomp): ‘flet’ is an obsolete macro (as of 24.3); use either
> ‘cl-flet’ or ‘cl-letf’.
>
> And then remembering that cl-flet does not work, and it gets complicated
> with Lisp macros, dynamic something, etc. I am no Elisp expert.
The suggestions to wrap `kill-matching-buffers' with `cl-letf' or `flet'
are overkill - misguided, IMHO.
You are defining _your own_ command. Just define it directly. The code to
do that is trivial. For one thing, you can just copy the existing code of
`kill-matching-buffers' and substitute `kill-buffer' for `kill-buffer-ask'.
I don't think that Emacs needs either (1) a new, non-confirming command for
this or (2) a variable to inhibit confirmation by `kill-matching-buffers'.
I don't even think that Emacs needs commands `kill-matching-buffers' and
`kill-some-buffers' at all, for that matter.
----
[What Emacs should offer instead is a way for `C-x k' to act (by hitting
a key) on *each* completion of your input. And ways to match buffer names
better, possibly choosing how on the fly: substring, regexp, fuzzy.
And a way to progressively narrow the set of matches. And a way to act on
specific matches but not all. And a way to act on non-matches. And a way
to filter buffer-name matches to keep or remove those for modified buffers.
(In Icicles, you use `C-x k', type a regexp, complete, and hit `C-!'
to kill all of the matches. To filter out the modified buffers, just
use `C-x * -' before hitting `C-!'. So that's `C-x k TAB C-x * -'.
And you can use `C-M-down' to see info about each buffer, including
whether it is modified. And the same keys work for other commands
that use buffer-name completion, e.g., `C-x 4 b'.)]
next prev parent reply other threads:[~2017-05-22 22:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <537757403.6158992.1495470490914.ref@mail.yahoo.com>
2017-05-22 16:28 ` kill-matching-buffers without confirmation R. Diez
2017-05-22 18:21 ` Kaushal Modi
2017-05-22 18:34 ` Clément Pit-Claudel
2017-05-22 18:42 ` Kaushal Modi
2017-05-22 18:45 ` Clément Pit-Claudel
2017-05-22 19:00 ` Kaushal Modi
2017-05-22 19:13 ` Clément Pit-Claudel
2017-05-22 19:20 ` Kaushal Modi
2017-05-22 19:34 ` Stefan Monnier
2017-05-22 22:21 ` Drew Adams [this message]
2017-05-23 5:28 ` Yuri Khan
2017-05-23 6:28 ` R. Diez
2017-05-23 20:34 ` Drew Adams
2017-05-23 12:51 ` Kaushal Modi
2017-05-23 13:03 ` Stefan Monnier
2017-05-23 13:18 ` Kaushal Modi
2017-05-24 1:50 ` zhanghj
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6e11051e-1a41-426b-97be-de1d70480c34@default \
--to=drew.adams@oracle.com \
--cc=emacs-devel@gnu.org \
--cc=rdiezmail-emacs@yahoo.de \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.