From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.devel Subject: Re: kill-matching-buffers without confirmation Date: Tue, 23 May 2017 13:18:45 +0000 Message-ID: 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: multipart/alternative; boundary="f403045ea28662fb1b055030d4cf" X-Trace: blaine.gmane.org 1495545544 17897 195.159.176.226 (23 May 2017 13:19:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 23 May 2017 13:19:04 +0000 (UTC) To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 23 15:19:01 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 1dD9iG-0004SJ-K4 for ged-emacs-devel@m.gmane.org; Tue, 23 May 2017 15:19:00 +0200 Original-Received: from localhost ([::1]:48919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD9iK-0004nz-Gi for ged-emacs-devel@m.gmane.org; Tue, 23 May 2017 09:19:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD9iE-0004nf-6M for emacs-devel@gnu.org; Tue, 23 May 2017 09:18:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dD9iD-0000gh-9R for emacs-devel@gnu.org; Tue, 23 May 2017 09:18:58 -0400 Original-Received: from mail-lf0-x22b.google.com ([2a00:1450:4010:c07::22b]:35587) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dD9iD-0000fM-2Y for emacs-devel@gnu.org; Tue, 23 May 2017 09:18:57 -0400 Original-Received: by mail-lf0-x22b.google.com with SMTP id a5so34986112lfh.2 for ; Tue, 23 May 2017 06:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=d+XjFigqjXuVrh7jJ/FQSSjYFXkse7cCwwNqafPX9rs=; b=ksSB8O16pF5GuXiPja7cgJJ/eqL24acR+7v+KUQTF5pmw8C/r59H+FGzJ04/zoxWl2 m56N7HiLCEKZQxtqAdY16/i9nrlfbvzw2nL1DUoBu0SUt/a0WnQkq7D3XMg8N+k3CZCe K7t4MQ6ETO4HIag+8PgiU4cPsaVqTl8pcA9qVoYzoC68jr6vaq9PoGfHTueZC/cinr8C vVDrUcvZ9DBLaBYeEYyNjaEUJCFC948/R1+ULz/EfDOpPZT+rEx1K/aTxOWiJjC4dmRo 9XNtQBLBV2PvXwFnaqJv9/XvUltSx2yjsHrh9ZPk3kFATZWe/Yc+7BjUj4O1gLs7Lqrl IdaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=d+XjFigqjXuVrh7jJ/FQSSjYFXkse7cCwwNqafPX9rs=; b=JHf6PNkLTBl4Y230sFgmXOHz8vmS+N/A2v7oVxze5J2esR79OohvjK6uJmYto3FS4s 6M5oaG13j+Wpy7G2Utfj+BkiB9VBYHyiVwHPFQTQ4Etxj7iHZB2q4Mi6m/O7p+U1wHKl qggPBZany5YVCAb+Po1/aJGV9s4I2qkoaJePjC+lYiNRwiRJkabiSiEVQb1zT6/Hs2Yx SRBvmEnM3C78gIV2uuoGG7anNSgDMlWQk7dnsglBsQhNrQwCj3PI4BeV/QzmI9zjFZ/w oGYsIEy28Ln3LvrpIkBV/EIHyJF3YJZiGCdTs2VNnMrCrS+ESj+5RXCdLQ24seeveQAl O0kQ== X-Gm-Message-State: AODbwcCMqwkjxo9d9Tayk2HfQUXlnGbqXyv7B+NDsQTxQGhCbzqqtDu5 oCSdRAqpW1Seh1/i0jFc6W6Wtx43sA== X-Received: by 10.46.75.26 with SMTP id y26mr5906524lja.60.1495545535460; Tue, 23 May 2017 06:18:55 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::22b 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:215129 Archived-At: --f403045ea28662fb1b055030d4cf Content-Type: text/plain; charset="UTF-8" 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. -- Kaushal Modi --f403045ea28662fb1b055030d4cf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, May 23= , 2017 at 9:03 AM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> The suggestions to wrap `kill-matchin= g-buffers' with `cl-letf' or `flet'
>> are overkill - misguided, IMHO.
> Using cl-letf is one of the valid ways.=C2=A0 I wouldn't call it a= n
> overkill.=C2=A0 It instead precisely does what the OP needed without h= ave
> to rewrite the whole function in the user's config.

No, not "precisely".=C2=A0 It does more than you want.=C2=A0 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.
=C2=A0
It's good we can use such a workaround when there's no other s= olution,
but let's not design things in a way that requires the use of such hack= s.

I agree.=C2=A0

The OP hasn't w= eighed in yet. But if it needs to be fixed, OP should file a bug report req= uesting that.

Else, he can simply redefine the fun= ction in the config as Drew suggested.
--

Kau= shal Modi

--f403045ea28662fb1b055030d4cf--