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: Thu, 29 Apr 2021 19:04:49 +0300 Organization: LINKOV.NET Message-ID: <87k0olcjnu.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26192"; 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 Thu Apr 29 18:33:04 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 1lc9b6-0006h5-Hn for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Apr 2021 18:33:04 +0200 Original-Received: from localhost ([::1]:34558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lc9b5-0000k5-83 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Apr 2021 12:33:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lc9aE-0000hd-3i for bug-gnu-emacs@gnu.org; Thu, 29 Apr 2021 12:32:10 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45142) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lc9a6-0008Gv-9K for bug-gnu-emacs@gnu.org; Thu, 29 Apr 2021 12:32:09 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lc9a6-00031o-4z for bug-gnu-emacs@gnu.org; Thu, 29 Apr 2021 12:32: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: Thu, 29 Apr 2021 16:32: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.161971387211564 (code B ref 46374); Thu, 29 Apr 2021 16:32:02 +0000 Original-Received: (at 46374) by debbugs.gnu.org; 29 Apr 2021 16:31:12 +0000 Original-Received: from localhost ([127.0.0.1]:56684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lc9ZI-00030S-3i for submit@debbugs.gnu.org; Thu, 29 Apr 2021 12:31:12 -0400 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:53535) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lc9ZF-00030B-4M for 46374@debbugs.gnu.org; Thu, 29 Apr 2021 12:31:10 -0400 X-Originating-IP: 91.129.102.166 Original-Received: from mail.gandi.net (m91-129-102-166.cust.tele2.ee [91.129.102.166]) (Authenticated sender: juri@linkov.net) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id A40F42000A; Thu, 29 Apr 2021 16:31:00 +0000 (UTC) In-Reply-To: <87eeeu172h.fsf@gmail.com> (Tino Calancha's message of "Wed, 28 Apr 2021 22:35:02 +0200") 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:205191 Archived-At: >> I see a problem in save-some-buffers-fun: what if >> save-some-buffers-default-predicate is still customized to nil? > I assumed we were OK with the backward incompatible change; I mean, > with requiring from now on `save-some-buffers-default-predicate' > to be a function generating the predicate. > >> This value is currently allowed. It seems it should check >> if it's a function, then call it. Also needs to check if the function >> doesn't return another lambda, then return its original value. > We can do that; but it seems to me that the spirit of the FIXME comment > is in the line to not accept `nil' as a valid value, just functions. Indeed, to remove the FIXME comment we could set the default value to 'ignore' that returns nil: (funcall (lambda () nil)) => nil (funcall 'ignore) => nil 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))