From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#46374: 28.0.50; Ask me to save buffers only if they are under callers dir Date: Fri, 13 Aug 2021 10:11:34 +0300 Organization: LINKOV.NET Message-ID: <87y295ddjt.fsf@mail.linkov.net> 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> <87zgxigpbc.fsf@mail.linkov.net> <87eeeu172h.fsf@gmail.com> <87k0olcjnu.fsf@mail.linkov.net> <82abe5b9-7d42-b05d-26a5-fd63e1f59e3a@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34456"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 46374@debbugs.gnu.org, Stefan Monnier , =?UTF-8?Q?Qu=C3=A1ch_?= =?UTF-8?Q?M=E1=BB=B9_?= =?UTF-8?Q?Uy=C3=AAn?= Nhi To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 13 09:15:36 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 1mERPi-0008jV-OF for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Aug 2021 09:15:34 +0200 Original-Received: from localhost ([::1]:56860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mERPh-00082F-99 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Aug 2021 03:15:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39882) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mERPC-0007zb-RG for bug-gnu-emacs@gnu.org; Fri, 13 Aug 2021 03:15:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57111) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mERPC-0007vC-Kk for bug-gnu-emacs@gnu.org; Fri, 13 Aug 2021 03:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mERPC-000812-GC for bug-gnu-emacs@gnu.org; Fri, 13 Aug 2021 03:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Aug 2021 07:15:02 +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.162883887130712 (code B ref 46374); Fri, 13 Aug 2021 07:15:02 +0000 Original-Received: (at 46374) by debbugs.gnu.org; 13 Aug 2021 07:14:31 +0000 Original-Received: from localhost ([127.0.0.1]:40415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEROh-0007zG-B5 for submit@debbugs.gnu.org; Fri, 13 Aug 2021 03:14:31 -0400 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:64443) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEROf-0007yi-Nu; Fri, 13 Aug 2021 03:14:30 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id ADC5640007; Fri, 13 Aug 2021 07:14:21 +0000 (UTC) In-Reply-To: <82abe5b9-7d42-b05d-26a5-fd63e1f59e3a@gmail.com> (Tino Calancha's message of "Tue, 18 May 2021 20:56:28 +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:211718 Archived-At: tags 46374 fixed close 46374 28.0.50 thanks Thanks for this useful feature. It was requested yesterday in bug#49980. So now it's pushed to master and closed. >> Indeed, to remove the FIXME comment we could set the default value to >> 'ignore' that returns nil: >> >> (funcall (lambda () nil)) => nil >> (funcall 'ignore) => nil > > Opps, This is a pitfall: the second one will do exactly the opposite that > the first one does :-) > No problem! We can apply Bon Jovi! > > (funcall (lambda () nil)) => nil > (funcall 'always) => t > > [the above are equivalent; yeah, it sounds impossible, but if you read the > code you will understand why] > >> But also it's easy to support the old value 'nil', and also >> support old functions that don't return a predicate. >> You can just return the same value if it's not a function, >> and also return the function if it doesn't return a predicate. >> Something like this (untested): >> >> (defun save-some-buffers-fun () >> (if (functionp save-some-buffers-default-predicate) >> (let ((ret (funcall save-some-buffers-default-predicate))) >> (if (functionp ret) ret save-some-buffers-default-predicate)) >> save-some-buffers-default-predicate)) > > Neat! > I am going to use this version for a while in my machine, to give it more > testing. > Thank you.