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 #56 received at 46374 <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: Sun, 25 Apr 2021 01:13:13 +0300
>>> I have noticed that I haven't enabled lexical-binding in my .emacs file,
>>> which it is crucial for my use case.
>>> To avoid surprises, I have mentioned this issue in the docstring.
>>
>> Unfortunately, your patch is truncated.  Could you send a complete patch?
>
> Here is:

Thanks.  Your first patch was better in terms of customizability.
It allowed the users to easily customize the used predicate,
but its disadvantage was that it introduced a new defcustom.

Would it be possible to merge the advantage of your first patch
with the cleaner solution of your latest patch?

> +(defvar save-some-buffers-fun-function (lambda () save-some-buffers-default-predicate)

Maybe it's possible to hard-code this as the default option of the
existing defcustom save-some-buffers-default-predicate?

Currently there is such FIXME comment in save-some-buffers-default-predicate:

  ;; FIXME nil should not be a valid option, let alone the default,
  ;; eg so that add-function can be used.

Is it possible to add the default value as a function that returns nil?
This will implement FIXME, and will allow adding more options
with more predicates:

> +\(lambda ()
> +  (let ((project-dir
> +         (or (and (project-current) (project-root (project-current)))
> +             default-directory)))
> +    (lambda () (file-in-directory-p default-directory project-dir))))

Then this code could be implemented as an additional option for
save-some-buffers-default-predicate.




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

Previous Next


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