From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: zhanghj Newsgroups: gmane.emacs.devel Subject: Re: kill-matching-buffers without confirmation Date: Wed, 24 May 2017 09:50:40 +0800 Message-ID: <87poezkopb.fsf@gmail.com> References: <537757403.6158992.1495470490914.ref@mail.yahoo.com> <537757403.6158992.1495470490914@mail.yahoo.com> <6e11051e-1a41-426b-97be-de1d70480c34@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1495590713 30955 195.159.176.226 (24 May 2017 01:51:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 24 May 2017 01:51:53 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: netjune@qq.com, Stefan Monnier , emacs-devel@gnu.org To: Kaushal Modi Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 24 03:51:48 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 1dDLSk-0007qQ-6O for ged-emacs-devel@m.gmane.org; Wed, 24 May 2017 03:51:46 +0200 Original-Received: from localhost ([::1]:52216 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDLSo-0003zc-57 for ged-emacs-devel@m.gmane.org; Tue, 23 May 2017 21:51:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDLRz-0003yZ-FD for emacs-devel@gnu.org; Tue, 23 May 2017 21:51:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dDLRu-00046J-F4 for emacs-devel@gnu.org; Tue, 23 May 2017 21:50:59 -0400 Original-Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:35618) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dDLRu-00046D-8J for emacs-devel@gnu.org; Tue, 23 May 2017 21:50:54 -0400 Original-Received: by mail-pg0-x244.google.com with SMTP id i63so15222866pgd.2 for ; Tue, 23 May 2017 18:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:cc:date:in-reply-to:message-id :user-agent:mime-version; bh=l6b1ZNi2e7wFKx4y/e6cnrEEPZiDWu1In+pk36PPRuc=; b=LC5p9KYIk5LAGlbi+ktRB0gPBnE6JS9edFlvO/UjkLUCGneD+hftaTFAABOs5Feid1 lBlhWzVFIfueOtz4uR7kMEh2UAeD/knS2aLNyoQW/NJ9Oz2CZC3UB2hviKPIaDg7Ybg/ 8d0gi2c7eRPatQ5bD/TWcBz0PdiM2C+JLWeY4EGl3qLMY2qk029wJgQ1VRKphFsrdU7o Jxm1/FmiFrWPyBew/sT86CqsdFLgp70/iTQtJeR/3IviVCeCSyOLMi62bunKYRRN07OZ NVnllOr9r1/R00ELASqqBbdMGSgogq5hw5pPFtx/lJzZmJr8Y4JruoAgoQWPdstEj40l tcPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:cc:date :in-reply-to:message-id:user-agent:mime-version; bh=l6b1ZNi2e7wFKx4y/e6cnrEEPZiDWu1In+pk36PPRuc=; b=ELlGVtOKGQTfNULMaxaxDAliFQyPN+JOT+r4wvxTI65SzwqdJZd9NVAe4rPUsG+Atb lF8UCvgiCjK7QkYCNkjdl+aesVhIfMUzx7fAT1DsT0HNDpPVvPxz11WAElNGtDD3GxI+ g0aX1Zz13xPx6Rs4n+UtyelJkYwvAmyQu01mbNoGrsJr2ZAvrNn3tkmIb5Z9afLdddTU qHj+rz8Kr6v+k3A/cdU7lUArS8qMx2N2MsE9Y5CvKCrBUYR/y46I/6gkSL7eQB0o/6c0 iNQXI+IU7hyKOa2KXsDshdH33/pw4qGr3tTSweDI/lGsb2xF13GB0fuV2oWDOPilqktC hBfg== X-Gm-Message-State: AODbwcDcTFYOiljnjYKzgujCzTXREFfEU/QzR3ZI6hyeam8oFkOhI+Fp xvrtCxHOwv27hA== X-Received: by 10.84.232.204 with SMTP id x12mr39885939plm.77.1495590652915; Tue, 23 May 2017 18:50:52 -0700 (PDT) Original-Received: from junlinux ([115.238.110.138]) by smtp.gmail.com with ESMTPSA id v6sm3907938pgb.20.2017.05.23.18.50.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 May 2017 18:50:51 -0700 (PDT) In-Reply-To: (Kaushal Modi's message of "Tue, 23 May 2017 13:18:45 +0000") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::244 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:215147 Archived-At: Kaushal Modi writes: > On Tue, May 23, 2017 at 9:03 AM Stefan Monnier > wrote: > >> >> The suggestions to wrap `kill-matching-buffers' with `cl-letf' or `flet' >> >> are overkill - misguided, IMHO. >> > Using cl-letf is one of the valid ways. I wouldn't call it an >> > overkill. It instead precisely does what the OP needed without have >> > to rewrite the whole function in the user's config. >> >> No, not "precisely". It does more than you want. E.g. it will also >> affect other threads which could be running at the same time, or any >> other piece of code that might run during this dynamic scope (e.g. while >> debugging this code). >> > > TIL. Thanks. > > >> It's good we can use such a workaround when there's no other solution, >> but let's not design things in a way that requires the use of such hacks. > > > I agree. > > The OP hasn't weighed in yet. But if it needs to be fixed, OP should file a > bug report requesting that. > > Else, he can simply redefine the function in the config as Drew suggested. What about a command like this: (defun kill-matching-buffers (donot-ask) (interactive "P") (...))