From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: kill-matching-buffers without confirmation Date: Mon, 22 May 2017 15:21:27 -0700 (PDT) Message-ID: <6e11051e-1a41-426b-97be-de1d70480c34@default> References: <537757403.6158992.1495470490914.ref@mail.yahoo.com> <537757403.6158992.1495470490914@mail.yahoo.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1495491743 6233 195.159.176.226 (22 May 2017 22:22:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 22 May 2017 22:22:23 +0000 (UTC) To: "R. Diez" , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 23 00:22:14 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dCviO-0001NE-5H for ged-emacs-devel@m.gmane.org; Tue, 23 May 2017 00:22:12 +0200 Original-Received: from localhost ([::1]:45156 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCviT-000127-KK for ged-emacs-devel@m.gmane.org; Mon, 22 May 2017 18:22:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCvhr-00011q-Lt for emacs-devel@gnu.org; Mon, 22 May 2017 18:21:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCvhm-0002iH-Kf for emacs-devel@gnu.org; Mon, 22 May 2017 18:21:39 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:39889) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dCvhm-0002iD-AW for emacs-devel@gnu.org; Mon, 22 May 2017 18:21:34 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v4MMLTwI028296 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 May 2017 22:21:30 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v4MMLTkT031788 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 May 2017 22:21:29 GMT Original-Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v4MMLSK8006511; Mon, 22 May 2017 22:21:29 GMT In-Reply-To: <537757403.6158992.1495470490914@mail.yahoo.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6767.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 141.146.126.69 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:215111 Archived-At: > Could someone please add a clean way for 'kill-matching-buffers' to not a= sk > for confirmation?... >=20 > I am tired of overriding 'kill-buffer-ask' with flet as suggested there, > and then seeing this warning: >=20 > Warning (bytecomp): =E2=80=98flet=E2=80=99 is an obsolete macro (as of = 24.3); use either > =E2=80=98cl-flet=E2=80=99 or =E2=80=98cl-letf=E2=80=99. >=20 > 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'.)]