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 #80 received at 46374 <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: uyennhi.qm <at> gmail.com, juri <at> linkov.net, 46374 <at> debbugs.gnu.org,
 monnier <at> iro.umontreal.ca, Tino Calancha <tino.calancha <at> gmail.com>
Subject: Re: bug#46374: 28.0.50; Ask me to save buffers only if they are
 under callers dir
Date: Tue, 18 May 2021 20:04:24 +0200 (CEST)
[Message part 1 (text/plain, inline)]

On Thu, 29 Apr 2021, Eli Zaretskii wrote:

>> From: Tino Calancha <tino.calancha <at> gmail.com>
>> Date: Wed, 28 Apr 2021 21:31:25 +0200
>> Cc: 46374 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
>>  Quách Mỹ Uyên Nhi
>>  <uyennhi.qm <at> gmail.com>
>>
>> Juri Linkov <juri <at> linkov.net> 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.

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.