GNU bug report logs -
#46374
28.0.50; Ask me to save buffers only if they are under callers dir
Previous Next
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
View this message in rfc822 format
Sorry for the late response: many meetings with investors.
Then I went on a vacation to my castle in Seychelles.
Eli Zaretskii <eliz <at> gnu.org> writes:
>> You are assuming that when save-some-buffers runs, the default
>> directory is the same as when you issued whatever command triggered
>> the call to save-some-buffers? Is that assumption really accurate?
I don't know if there are some corner cases.
In my experience, I am hit by this (very often) when using packages
that call `compilation-start`. Prominent examples are `rgrep` or
when downloading ELPA updates (they will trigger a compilation as well).
The patch is serving me very well so far.
Juri Linkov <juri <at> linkov.net> writes:
>> @vindex save-some-buffers-default-predicategn
>> +@vindex save-some-buffers-restrict-to-caller-subdirs
>> You can customize the value of
>> -@code{save-some-buffers-default-predicate} to control which buffers
>> -Emacs will ask about.
>> +@code{save-some-buffers-default-predicate} and
>> +@code{save-some-buffers-restrict-to-caller-subdirs} to control which
>> +buffers Emacs will ask about.
>
> Why not simply add a new option to the existing variable
> save-some-buffers-default-predicate? For example:
>
> (defcustom save-some-buffers-default-predicate nil
> "Default predicate for `save-some-buffers'."
> :group 'auto-save
> ;; FIXME nil should not be a valid option, let alone the default,
> ;; eg so that add-function can be used.
> :type '(choice (const :tag "Default" nil)
> (const :tag "Subdirs of default directory" default-directory)
> (const :tag "Project root" project-root)
> function)
Indeed, this was my initial implemention.
Then I moved to the one I shared here; I found my second version
superior for the following reason:
1. Users can restrict the buffer default directory AND still pass a
predicate to filter by any other thing they wish;
i.e. you don't need to chose either one of the other.
2. I find it cleaner having it in a separated option.
Stefan Monnier <monnier <at> iro.umontreal.ca>
>> If we want to have such a behavior and make it optional, it's fine by me.
It's optional in my patch; some people might like the current situation:
been prompted about any modified buffer.
>> But if we want to make it a default behavior, then I think
>> `project-root` would be much a much better choice (when available) than
>> `default-directory`.
Would this `project-root` feature work for `rgrep`?
I mean, I can call `rgrep` in my local computer, out of any project, for
instance to search for information in some plain text notes. In this
case, `default-directory` works quite well.
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.