GNU bug report logs - #46374
28.0.50; Ask me to save buffers only if they are under callers dir

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Sun, 7 Feb 2021 22:33:01 UTC

Severity: wishlist

Tags: fixed

Merged with 50380

Fixed in version 28.0.60

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #91 received at control <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 46374 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Quách Mỹ Uyên Nhi <uyennhi.qm <at> gmail.com>
Subject: Re: 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
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.




This bug report was last modified 3 years and 191 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.