From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#46374: 28.0.50; Ask me to save buffers only if they are under callers dir Date: Tue, 18 May 2021 21:23:37 +0300 Message-ID: <83lf8brjdi.fsf@gnu.org> References: <878s7z4ihk.fsf@gmail.com> <87a6sdzeh6.fsf@mail.linkov.net> <87ft16g0u2.fsf@gmail.com> <87tupmisel.fsf@mail.linkov.net> <1952f2d9-51b6-a4ba-6c9e-98594222f017@gmail.com> <87r1kpemnr.fsf@mail.linkov.net> <87mtv6yloe.fsf@gmail.com> <871rcgr4qp.fsf@mail.linkov.net> <87zgz3gfqo.fsf@mail.linkov.net> <87blbhhghk.fsf@mail.linkov.net> <87pmzsgzh3.fsf@gmail.com> <87o8fc5jq0.fsf@mail.linkov.net> <87wnsz7jmy.fsf@gmail.com> <87tunvnxfo.fsf@linkov.net> <87h7jq1a0i.fsf@gmail.com> <83o8dxe9hw.fsf@gnu.org> <55fbbe0-1f9-7460-c92f-bd12fbc3da97@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8517"; mail-complaints-to="usenet@ciao.gmane.io" Cc: juri@linkov.net, 46374@debbugs.gnu.org, uyennhi.qm@gmail.com, monnier@iro.umontreal.ca To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 18 20:24:41 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lj4OW-0001yL-WF for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 May 2021 20:24:41 +0200 Original-Received: from localhost ([::1]:54220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj4OW-000629-2K for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 May 2021 14:24:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lj4Nu-00061z-DF for bug-gnu-emacs@gnu.org; Tue, 18 May 2021 14:24:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45718) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lj4Nu-0000m9-4c for bug-gnu-emacs@gnu.org; Tue, 18 May 2021 14:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lj4Nu-0001Pn-0V for bug-gnu-emacs@gnu.org; Tue, 18 May 2021 14:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 May 2021 18:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46374 X-GNU-PR-Package: emacs Original-Received: via spool by 46374-submit@debbugs.gnu.org id=B46374.16213622365428 (code B ref 46374); Tue, 18 May 2021 18:24:01 +0000 Original-Received: (at 46374) by debbugs.gnu.org; 18 May 2021 18:23:56 +0000 Original-Received: from localhost ([127.0.0.1]:57264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lj4Nn-0001PU-Ix for submit@debbugs.gnu.org; Tue, 18 May 2021 14:23:55 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lj4Ni-0001PD-9i for 46374@debbugs.gnu.org; Tue, 18 May 2021 14:23:53 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46700) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj4Nb-0000cF-9V; Tue, 18 May 2021 14:23:43 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1828 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lj4NZ-0006bO-6P; Tue, 18 May 2021 14:23:43 -0400 In-Reply-To: <55fbbe0-1f9-7460-c92f-bd12fbc3da97@gmail.com> (message from Tino Calancha on Tue, 18 May 2021 20:04:24 +0200 (CEST)) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:206828 Archived-At: > From: Tino Calancha > Date: Tue, 18 May 2021 20:04:24 +0200 (CEST) > cc: Tino Calancha , juri@linkov.net, > 46374@debbugs.gnu.org, monnier@iro.umontreal.ca, uyennhi.qm@gmail.com > > On Thu, 29 Apr 2021, Eli Zaretskii wrote: > > >> From: Tino Calancha > >> Date: Wed, 28 Apr 2021 21:31:25 +0200 > >> Cc: 46374@debbugs.gnu.org, Stefan Monnier , > >> Quách Mỹ Uyên Nhi > >> > >> > >> Juri Linkov writes: > >> > >> +(defcustom save-some-buffers-default-predicate save-some-buffers-default-fun > >> + "Generator function of the default predicate for `save-some-buffers'. > >> + > >> +It must be a function with no arguments that returns a predicate. > >> +This predicate is called (with no parameters) from the buffer to be > >> +saved. > > > > Reading this, I'm confused: a function that returns a predicate? If > > this is literally so, why do we need this two-step approach? why not > > have the value _be_ a predicate function? > > The point of this two-step approach is to get access to the caller > environment: > > - We have a function, generate-foo, that builds a predicate foo. > - By calling generate-foo inside same-some-buffers, we build a foo with > access to the enviroment, i.e. foo is a closure. > > That makes the trick to restrict the prompt to saving buffers only inside > the current project. IMNSHO, this is not a very good idea for a defcustom. What user will be able to provide such a function willy-nilly?