From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "R. Diez" Newsgroups: gmane.emacs.devel Subject: Re: kill-matching-buffers without confirmation Date: Tue, 23 May 2017 06:28:23 +0000 (UTC) Message-ID: <1873780790.87721.1495520903689@mail.yahoo.com> References: <537757403.6158992.1495470490914.ref@mail.yahoo.com> <537757403.6158992.1495470490914@mail.yahoo.com> <6e11051e-1a41-426b-97be-de1d70480c34@default> Reply-To: "R. Diez" NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1495546994 13939 195.159.176.226 (23 May 2017 13:43:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 23 May 2017 13:43:14 +0000 (UTC) Cc: "emacs-devel@gnu.org" To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 23 15:43:07 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 1dDA5b-0003Qn-1A for ged-emacs-devel@m.gmane.org; Tue, 23 May 2017 15:43:07 +0200 Original-Received: from localhost ([::1]:49060 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDA5g-0000QX-LX for ged-emacs-devel@m.gmane.org; Tue, 23 May 2017 09:43:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD3Iz-0002yj-Mb for emacs-devel@gnu.org; Tue, 23 May 2017 02:28:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dD3Iw-0005mM-Im for emacs-devel@gnu.org; Tue, 23 May 2017 02:28:29 -0400 Original-Received: from sonic319-30.consmr.mail.ir2.yahoo.com ([77.238.179.45]:38792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD3Iw-0005lv-2q for emacs-devel@gnu.org; Tue, 23 May 2017 02:28:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1495520904; bh=PkBbNP5loE4Wk1TAY4T9Er1ZpwjrJERtqH+c7w6pa4g=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject; b=lCMjUXkjb2ZdaBRLNW5JWwoaghE4n6CRkhgu3D4LxcO0ZnoqljQa4m/PvpuGs3eZuhuuakO4fGt26co/nXaaRti2dLI3MSR1q9YHFhE3RfFEm3+WfyDF8RPY3csIpiC3olejBI15KwaMNek+sXhpXF2oUEXRbfrL6QCTmtDQjgfXcR9LPlzNWPLQlH6Rvv4pwjVKE67Xk5EBEO9KNzXk0WU5hlTPhZ0ii0Jz10nPleLgpqDN+Uc9bsFqeduZqzELENbH1aDKpEru96Z7wCo4SG5rSbIK4HmSueOyNcMkX8Vs+8QGdmjWwvJwZYNAk2PVTNxFPW2pyuyFeUla6Mi9rA== X-YMail-OSG: 4XAhd4IVM1n9JZt2Knfn0CkGAZ7Ml9VEbc6pJaOhwCk.AS3ZqJSuXHiQaPSRrJw IsTlb7hOGKu.FUoNCFVJAOAUYoPnMUEifveHA2JJbaMV4UwiC9KNhYn7PnpjBb7GVRCUdOwOHNXc HfsN6njJEWfVGoXEwl3LMcNteCQXhcrWwx.fZLAL7fdZSm0Wggva1ppxt8dJ6aVMBIRHZjfw3hI9 ypxkwFBLhMZR_V0QfEdZ0WEJd7sONccaPlya1laY2h9MEYaoJt.AKEN7GM6tDXWbThdUx8t9Q0_e KfBS7WzBECAyeFWNW06QQGLaufkcC5S0QneK4pSokDw3XqFRy09ymW7_N.LXiwP2ZdkGjBZq_Enz smB5uT1aOslWCqho4nAyFWLGmx8ySjNvmsJEhHQVGZlNcI.Fdqd7vhl9mFkaBhk2WGxWJ4QSQSgw fBu6g9hXj7VqKhvPhOJ1h.GsPeJ2asJk9fC5dfgZGuf7TNzrzLdzrrFG_9zH4bRbuO1P4CJ318ID diGXT2OnR5hHWYYdvWzu_eo76RUk- Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic319.consmr.mail.ir2.yahoo.com with HTTP; Tue, 23 May 2017 06:28:24 +0000 In-Reply-To: <6e11051e-1a41-426b-97be-de1d70480c34@default> X-Mailer: WebService/1.1.9679 YahooMailNeo Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 77.238.179.45 X-Mailman-Approved-At: Tue, 23 May 2017 09:43:05 -0400 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:215130 Archived-At: > You are defining _your own_ command. Just define it directly. > The code to do that is trivial. I think you are misguided here. You seem to believe that Emacs users are confident Elisp programmers. This is the source code of kill-matching-buffers: (defun kill-matching-buffers (regexp &optional internal-too) "Kill buffers whose name matches the specified REGEXP. The optional second argument indicates whether to kill internal buffers too." (interactive "sKill buffers matching this regular expression: \nP") (dolist (buffer (buffer-list)) (let ((name (buffer-name buffer))) (when (and name (not (string-equal name "")) (or internal-too (/= (aref name 0) ?\s)) (string-match regexp name)) (kill-buffer-ask buffer))))) It is not clear to me what internal buffers are, or why some of them could have an empty name. I cannot see a reason why I, as a regular user, should care. > For one thing, you can just copy the existing code of >`kill-matching-buffers' and substitute `kill-buffer' for `kill-buffer-ask'. This is really bad advice. If the next version of Emacs changes the implementation of that routine, my copy will miss those changes. My use case is not actually interactive. I just want to close the buffers that ediff automatically creates from its exit hook, but I have other scenarios where other things automatically load buffers that I no longer want. I do that kind of clean-up in a hook, no interaction required. > [What Emacs should offer instead is a way for `C-x k' to act (by hitting No, this is not what I need. I do not want interactive selection or fuzzy matches. I know exactly what pattern to use. What you are describing is a separate enhancement for interactive usage. [Obligatory rant follows] I am just asking for a little convenience function. It is almost what kill-matching-buffers does, just without hard-coded confirmation. This is a recurrent pattern with Emacs. Everything is so complicated, and there is so much discussion. There are other open-source projects which do not advice their users to create a bug themselves after posting a request, or which do not tell them to write their own code for each little thing. If a small improvement helps the regular user in his daily life, they just do it! The mere existence of the Stack Overflow question and the first replies here with cl-letf etc. should make it obvious that such a convenience function/flag would help. Regards, rdiez