GNU bug report logs -
#77566
[PATCH] Add option for automatically delete non-existent projects.
Previous Next
Reported by: Elijah Gabe Pérez <eg642616 <at> gmail.com>
Date: Sat, 5 Apr 2025 23:52:02 UTC
Severity: normal
Tags: patch
Fixed in version 31.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 77566 in the body.
You can then email your comments to 77566 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
dmitry <at> gutov.dev, bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Sat, 05 Apr 2025 23:52:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Elijah Gabe Pérez <eg642616 <at> gmail.com>:
New bug report received and forwarded. Copy sent to
dmitry <at> gutov.dev, bug-gnu-emacs <at> gnu.org.
(Sat, 05 Apr 2025 23:52:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Tags: patch
This feature automatically remove from project list projects that were
deleted, only when `project-switch-project' is being used.
This acts similar to `projectile-auto-cleanup-known-projects' from
projectile.el
[Message part 2 (text/html, inline)]
[0001-Add-option-for-automatically-delete-non-existent-pro.patch (text/patch, attachment)]
[Message part 4 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Sun, 06 Apr 2025 00:30:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 77566 <at> debbugs.gnu.org (full text, mbox):
Hello,
Thanks, though why do this only when switching projects?
Why not do it proactively whenever fetching the list of projects?
Performance concerns?
--
Sean Whitton
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Sun, 06 Apr 2025 00:53:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 77566 <at> debbugs.gnu.org (full text, mbox):
Sean Whitton <spwhitton <at> spwhitton.name> writes:
> Hello,
>
> Thanks, though why do this only when switching projects?
> Why not do it proactively whenever fetching the list of projects?
> Performance concerns?
Yes, but depends on how many projects one has.
(and because i forgot to add it)
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Sun, 06 Apr 2025 01:39:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 77566 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Sending a better patch.
[0001-Add-option-for-automatically-delete-non-existent-pro.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Sun, 06 Apr 2025 11:27:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 77566 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Sat, Apr 5, 2025 at 9:39 PM Elijah Gabe Pérez <eg642616 <at> gmail.com> wrote:
> Sending a better patch.
>
I think we need to call zombies something else and also consider that
remote files may need to be ignored by the zombie checker to reduce the
costs of checking project paths, to avoid tramp prompts for an internal
function, and to accommodate that not all tramp connections are available
all the time and those may not be reachable and should not be considered
zombies.
Setting aside the zombie name for now, hHow about calling
'project-auto-forget-zombie-projects' 'project-prune-zombie-projects' and
rather than boolean, accept symbols that could include something like
'list-read 'list-write nil so users can decide when pruning happens. In
long-lived Emacs sessions just doing it at list read time seems
insufficient.
Could we rename report-message to no-message and change when to unless to
keep it uniform? The word report suggests things other than merely
allowing messages.
++++
*** New user option 'project-auto-forget-zombie-projects'.
- This user option automatically remove projects from 'project-list-file'
+ This user option automatically removes projects from 'project-list-file'
- that have been deleted.
+ that cannot be accessed. [this language accommodates remote projects]
- "Automatically remove from project list projects that were deleted.
- If non-nil, remove automatically projects that doesn't exist anymore
- from the project list."
+ "Remove inaccessible project list entries.
+ If \\='list-read...etc.
+ If \\='list-write...etc.
+ [whatever other conditions seem reasonable]
+ If nil, no pruning is performed."
-Stephane
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Mon, 07 Apr 2025 00:40:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 77566 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Ship Mints <shipmints <at> gmail.com> writes:
> I think we need to call zombies something else and also consider that remote files may need to be
> ignored by the zombie checker to reduce the costs of checking project paths, to avoid tramp prompts for
> an internal function, and to accommodate that not all tramp connections are available all the time and
> those may not be reachable and should not be considered zombies.
Something like to this patch?
[0001-Add-option-for-automatically-delete-non-existent-pro.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
I don't have a remote project so I can't test it.
> Setting aside the zombie name for now, hHow about calling 'project-auto-forget-zombie-projects'
> 'project-prune-zombie-projects' and rather than boolean, accept symbols that could include something
> like 'list-read 'list-write nil so users can decide when pruning happens.
I've added them and also an `all' option which mix `list-read' and
`list-write'.
> Could we rename report-message to no-message and change when to unless to keep it uniform? The
> word report suggests things other than merely allowing messages.
I've added it as an additional optional argument.
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Mon, 07 Apr 2025 06:42:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 77566 <at> debbugs.gnu.org (full text, mbox):
> +(defcustom project-dont-prune-remote-zombie-projects nil
> + "If non-nil, remote files will no be pruned by `project-forget-zombie-projects'."
> + :type 'boolean
> + :version "31.1"
> + :group 'project)
Maybe it's possible to do with one option like there is
remote-ignoring 'recentf-keep-default-predicate'
in the default value of 'recentf-keep'.
> I don't have a remote project so I can't test it.
'sudo' counts as a remote project too.
So you can just type 'C-x x @' and the current project
will be added as remote.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Mon, 07 Apr 2025 13:21:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 77566 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Mon, Apr 7, 2025 at 2:41 AM Juri Linkov <juri <at> linkov.net> wrote:
> > +(defcustom project-dont-prune-remote-zombie-projects nil
> > + "If non-nil, remote files will no be pruned by
> `project-forget-zombie-projects'."
> > + :type 'boolean
> > + :version "31.1"
> > + :group 'project)
>
> Maybe it's possible to do with one option like there is
> remote-ignoring 'recentf-keep-default-predicate'
> in the default value of 'recentf-keep'.
>
> > I don't have a remote project so I can't test it.
>
> 'sudo' counts as a remote project too.
> So you can just type 'C-x x @' and the current project
> will be added as remote.
>
Indeed, and you can also open a local project via ssh to get the same thing
if you want to test other remote methods.
I think this is backwards
+ (unless (or (and no-remote (file-exists-p proj) (not (file-remote-p
proj)))
and should be
+ (unless (or (and no-remote (not (file-remote-p proj) (file-exists-p
proj)))
to avoid the cost of a remote file-exists-p.
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Mon, 07 Apr 2025 17:36:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 77566 <at> debbugs.gnu.org (full text, mbox):
On 06/04/2025 03:29, Sean Whitton wrote:
> Thanks, though why do this only when switching projects?
> Why not do it proactively whenever fetching the list of projects?
> Performance concerns?
I'm concerned about performance, yes. With my SSD, it takes about 4ms to
"clean up" ~70 projects. The number could be higher, and the hard drive
could be spinning media.
So could someone point out what will we get by proactively cleaning up
the list, rather than doing that only when a project is being prompted for?
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Mon, 07 Apr 2025 17:37:01 GMT)
Full text and
rfc822 format available.
Message #32 received at 77566 <at> debbugs.gnu.org (full text, mbox):
On 07/04/2025 03:39, Elijah Gabe Pérez wrote:
> +(defcustom project-prune-zombie-projects nil
> + "Automatically remove from project list projects that were deleted.
> +If set to `all', remove projects when project list file
> +is being read or written.
> +If set to `list-read', only remove projects when project list file
> +is being read.
> +If set to `list-write', only remove projects when project list file is
> +being written.
That's a lot of alternatives. Do we have a picture of the users who
would use each of the values?
And speaking of remote projects, maybe we should add a prefix argument
to project-forget-zombie-projects instead of an option.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Mon, 07 Apr 2025 17:41:01 GMT)
Full text and
rfc822 format available.
Message #35 received at 77566 <at> debbugs.gnu.org (full text, mbox):
On 06/04/2025 14:26, Ship Mints wrote:
> I think we need to call zombies something else and also consider that
> remote files may need to be ignored by the zombie checker to reduce the
> costs of checking project paths, to avoid tramp prompts for an internal
> function, and to accommodate that not all tramp connections are
> available all the time and those may not be reachable and should not be
> considered zombies.
Speaking of remote projects, even when a connection is available,
checking all of the projects for existence might create a large latency,
simply because of the lag to the remote host.
So I'm not sure what's the best approach here. Though we could just add
the option as off by default and say that if you turned it on, you
accept the consequences.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Mon, 07 Apr 2025 18:36:01 GMT)
Full text and
rfc822 format available.
Message #38 received at 77566 <at> debbugs.gnu.org (full text, mbox):
>> +(defcustom project-prune-zombie-projects nil
>> + "Automatically remove from project list projects that were deleted.
>> +If set to `all', remove projects when project list file
>> +is being read or written.
>> +If set to `list-read', only remove projects when project list file
>> +is being read.
>> +If set to `list-write', only remove projects when project list file is
>> +being written.
>
> That's a lot of alternatives. Do we have a picture of the users who would
> use each of the values?
Instead of desperately cleaning zombies that are popping up again and again,
I'd prefer an option with a list of directories that should be never added
to the project list. Or maybe improve 'project-forget-projects-under' to
remember what projects it forgot to not add them again, e.g.
by a new property in ~/.emacs.d/projects file:
(("/dir1" (forgotten . t))
...)
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Mon, 07 Apr 2025 21:50:02 GMT)
Full text and
rfc822 format available.
Message #41 received at 77566 <at> debbugs.gnu.org (full text, mbox):
On 07/04/2025 21:33, Juri Linkov wrote:
> Instead of desperately cleaning zombies that are popping up again and again,
> I'd prefer an option with a list of directories that should be never added
> to the project list.
I think we have that in the recently added option project-list-exclude.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Tue, 08 Apr 2025 01:26:01 GMT)
Full text and
rfc822 format available.
Message #44 received at 77566 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Dmitry Gutov <dmitry <at> gutov.dev> writes:
> On 06/04/2025 03:29, Sean Whitton wrote:
> > Thanks, though why do this only when switching projects?
> > Why not do it proactively whenever fetching the list of projects?
> > Performance concerns?
>
> I'm concerned about performance, yes. With my SSD, it takes about 4ms to
> "clean up" ~70 projects. The number could be higher, and the hard drive
> could be spinning media.
>
Yeah, that is why i originally added it only when switching projects,
projectile does the same.
So could someone point out what will we get by proactively cleaning up
> the list, rather than doing that only when a project is being prompted for?
Maybe for ensure that the zombies were removed?
For example, packages that use project--list for read the projects.
Instead what about purge it once after emacs startup?
>
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Tue, 08 Apr 2025 01:35:01 GMT)
Full text and
rfc822 format available.
Message #47 received at 77566 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Dmitry Gutov <dmitry <at> gutov.dev> writes:
> On 07/04/2025 03:39, Elijah Gabe Pérez wrote:
> > +(defcustom project-prune-zombie-projects nil
> > + "Automatically remove from project list projects that were deleted.
> > +If set to `all', remove projects when project list file
> > +is being read or written.
> > +If set to `list-read', only remove projects when project list file
> > +is being read.
> > +If set to `list-write', only remove projects when project list file is
> > +being written.
>
> That's a lot of alternatives. Do we have a picture of the users who
> would use each of the values?
>
AFAIK, no, I would honestly prefer just a booelan, this can be confused.
And speaking of remote projects, maybe we should add a prefix argument
> to project-forget-zombie-projects instead of an option.
>
The patch already provides this, should the option be removed?:
@@ -2117,12 +2148,17 @@ project-remember-projects-under
count) count))
count))
-(defun project-forget-zombie-projects ()
- "Forget all known projects that don't exist any more."
- (interactive)
+(defun project-forget-zombie-projects (&optional no-remote no-message)
+ "Forget all known projects that don't exist any more.
+If NO-REMOTE is non-nil, don't forget remote projects.
+If NO-MESSAGE is non-nil, don't display a message about projects removed."
+ (interactive "P")
(dolist (proj (project-known-project-roots))
- (unless (file-exists-p proj)
- (project-forget-project proj))))
+ (unless (or (and no-remote (file-exists-p proj) (not (file-remote-p
proj)))
+ (and project-dont-prune-remote-zombie-projects
+ (file-exists-p proj) (not (file-remote-p proj)))
+ (file-exists-p proj))
+ (project-forget-project proj no-message))))
>
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Tue, 08 Apr 2025 02:34:01 GMT)
Full text and
rfc822 format available.
Message #50 received at 77566 <at> debbugs.gnu.org (full text, mbox):
Hello,
On Mon 07 Apr 2025 at 08:34pm +03, Dmitry Gutov wrote:
> On 06/04/2025 03:29, Sean Whitton wrote:
>> Thanks, though why do this only when switching projects?
>> Why not do it proactively whenever fetching the list of projects?
>> Performance concerns?
>
> I'm concerned about performance, yes. With my SSD, it takes about 4ms to
> "clean up" ~70 projects. The number could be higher, and the hard drive could
> be spinning media.
>
> So could someone point out what will we get by proactively cleaning up the
> list, rather than doing that only when a project is being prompted for?
I see, yes. Doing it only when switching projects seems good to me.
--
Sean Whitton
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Tue, 08 Apr 2025 06:28:02 GMT)
Full text and
rfc822 format available.
Message #53 received at 77566 <at> debbugs.gnu.org (full text, mbox):
>> Instead of desperately cleaning zombies that are popping up again and again,
>> I'd prefer an option with a list of directories that should be never added
>> to the project list.
>
> I think we have that in the recently added option project-list-exclude.
Ok, this works nicely:
(define-advice project-forget-projects-under (:after (dir &optional _recursive) remember)
(add-to-list 'project-list-exclude dir))
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Wed, 09 Apr 2025 04:24:01 GMT)
Full text and
rfc822 format available.
Message #56 received at 77566 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Elijah Gabe Pérez <eg642616 <at> gmail.com> writes:
> Dmitry Gutov <dmitry <at> gutov.dev> writes:
>
> On 06/04/2025 03:29, Sean Whitton wrote:
> > Thanks, though why do this only when switching projects?
> > Why not do it proactively whenever fetching the list of projects?
> > Performance concerns?
>
> I'm concerned about performance, yes. With my SSD, it takes about 4ms to
> "clean up" ~70 projects. The number could be higher, and the hard drive
> could be spinning media.
>
> Yeah, that is why i originally added it only when switching projects, projectile does the same.
>
> So could someone point out what will we get by proactively cleaning up
> the list, rather than doing that only when a project is being prompted for?
>
> Maybe for ensure that the zombies were removed?
>
> For example, packages that use project--list for read the projects.
>
> Instead what about purge it once after emacs startup?
Something like this patch(?), it now clean up when
project-prompt-project-name or project-prompt-project-dir are being
called and after project--list was initialized:
[0001-Add-option-for-automatically-delete-non-existent-pro.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Wed, 09 Apr 2025 12:52:02 GMT)
Full text and
rfc822 format available.
Message #59 received at 77566 <at> debbugs.gnu.org (full text, mbox):
On 09/04/2025 07:23, Elijah Gabe Pérez wrote:
> Instead what about purge it once after emacs startup?
I think a concern was voiced that during a long-running session
directories can get removed at any time.
+ (project-forget-zombie-projects nil t))))
Are we sure that we want to suppress the messages about the removals in
this case? Personally, I'd just print it in any case (if some were
removed anyway).
+(defun project-forget-zombie-projects (&optional no-remote no-message)
> + "Forget all known projects that don't exist any more.
> +If NO-REMOTE is non-nil, don't forget remote projects.
Maybe NO-REMOTE should be called INCLUDE-REMOTE instead?
Right now it sounds like the opposite of its actual meaning.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Wed, 09 Apr 2025 19:29:02 GMT)
Full text and
rfc822 format available.
Message #62 received at 77566 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Dmitry Gutov <dmitry <at> gutov.dev> writes:
> On 09/04/2025 07:23, Elijah Gabe Pérez wrote:
>> Instead what about purge it once after emacs startup?
>
> I think a concern was voiced that during a long-running session directories can get removed at any time.
>
> + (project-forget-zombie-projects nil t))))
>
> Are we sure that we want to suppress the messages about the removals in this case? Personally, I'd just print it in any case (if some were removed anyway).
It would display the message after `startup-echo-area-message'.
I think it would be intrusive.
I've changed it to `inhibit-message' instead, which will include
the message into *Messages* buffer but will not be displayed.
> +(defun project-forget-zombie-projects (&optional no-remote no-message)
>> + "Forget all known projects that don't exist any more.
>> +If NO-REMOTE is non-nil, don't forget remote projects.
>
> Maybe NO-REMOTE should be called INCLUDE-REMOTE instead?
>
> Right now it sounds like the opposite of its actual meaning.
I think EXCLUDE-REMOTES would be a better name,
the INCLUDE-REMOTE name would give the impression that it does not
delete remote projects by default. `project-forget-zombie-projects' by
default includes remote and no remote projects.
[0001-Add-option-for-automatically-delete-non-existent-pro.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Wed, 09 Apr 2025 23:55:02 GMT)
Full text and
rfc822 format available.
Message #65 received at 77566 <at> debbugs.gnu.org (full text, mbox):
On 09/04/2025 22:28, Elijah Gabe Pérez wrote:
> Dmitry Gutov <dmitry <at> gutov.dev> writes:
>
>> On 09/04/2025 07:23, Elijah Gabe Pérez wrote:
>>> Instead what about purge it once after emacs startup?
>>
>> I think a concern was voiced that during a long-running session directories can get removed at any time.
>>
>> + (project-forget-zombie-projects nil t))))
>>
>> Are we sure that we want to suppress the messages about the removals in this case? Personally, I'd just print it in any case (if some were removed anyway).
>
> It would display the message after `startup-echo-area-message'.
> I think it would be intrusive.
Do we read the project list at startup?
Even so, the message might only be there if there are projects to clean
up. So it won't show up every time.
> I've changed it to `inhibit-message' instead, which will include
> the message into *Messages* buffer but will not be displayed.
That's fine too, although we probably do want to show it when called
interactively.
>> +(defun project-forget-zombie-projects (&optional no-remote no-message)
>>> + "Forget all known projects that don't exist any more.
>>> +If NO-REMOTE is non-nil, don't forget remote projects.
>>
>> Maybe NO-REMOTE should be called INCLUDE-REMOTE instead?
>>
>> Right now it sounds like the opposite of its actual meaning.
>
> I think EXCLUDE-REMOTES would be a better name,
> the INCLUDE-REMOTE name would give the impression that it does not
> delete remote projects by default. `project-forget-zombie-projects' by
> default includes remote and no remote projects.
Don't we want to avoid remote projects by default? It might take a long
time. Does it here in my testing anyway.
Having the "fast" path to be the default and the "thorough" as the
prefix command alternative seems to be a common approach.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Thu, 10 Apr 2025 04:08:02 GMT)
Full text and
rfc822 format available.
Message #68 received at 77566 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Dmitry Gutov <dmitry <at> gutov.dev> writes:
> On 09/04/2025 22:28, Elijah Gabe Pérez wrote:
>> Dmitry Gutov <dmitry <at> gutov.dev> writes:
>>
>>> On 09/04/2025 07:23, Elijah Gabe Pérez wrote:
>>>> Instead what about purge it once after emacs startup?
>>>
>>> I think a concern was voiced that during a long-running session directories can get removed at any time.
>>>
>>> + (project-forget-zombie-projects nil t))))
>>>
>>> Are we sure that we want to suppress the messages about the removals in this case? Personally, I'd just print it in any case (if some were removed anyway).
>> It would display the message after `startup-echo-area-message'.
>> I think it would be intrusive.
>
> Do we read the project list at startup?
Apparently no, I didn't notice it's just my configuration
that does it.
>> I've changed it to `inhibit-message' instead, which will include
>> the message into *Messages* buffer but will not be displayed.
>
> That's fine too, although we probably do want to show it when called interactively.
Sure. I've added it as an user option.
>>> +(defun project-forget-zombie-projects (&optional no-remote no-message)
>>>> + "Forget all known projects that don't exist any more.
>>>> +If NO-REMOTE is non-nil, don't forget remote projects.
>>>
>>> Maybe NO-REMOTE should be called INCLUDE-REMOTE instead?
>>>
>>> Right now it sounds like the opposite of its actual meaning.
>> I think EXCLUDE-REMOTES would be a better name,
>> the INCLUDE-REMOTE name would give the impression that it does not
>> delete remote projects by default. `project-forget-zombie-projects' by
>> default includes remote and no remote projects.
>
> Don't we want to avoid remote projects by default? It might take a long time. Does it here in my testing anyway.
>
> Having the "fast" path to be the default and the "thorough" as the prefix command alternative seems to be a common approach.
You are right, I've change it for exclude remote projects by default.
[0001-Add-option-for-automatically-delete-non-existent-pro.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Tue, 17 Jun 2025 01:42:03 GMT)
Full text and
rfc822 format available.
Message #71 received at 77566 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
I don't know if there is still interest in this, but I am sending here
the patch rebased to the current master branch
[0001-Allow-automatically-delete-non-existent-projects.-Bu.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Tue, 17 Jun 2025 06:40:01 GMT)
Full text and
rfc822 format available.
Message #74 received at 77566 <at> debbugs.gnu.org (full text, mbox):
> +(defcustom project-prune-zombie-projects 'exclude-remote
> + "Automatically remove from project list projects that were deleted.
> +If set to `exclude-remote' (default), remove deleted projects except
> +those that are remote.
> +If set to `all', include remote and no remote projects from being
> +removed."
> + :type '(choice (const :tag "Exclude remote projects" exclude-remote)
> + (const :tag "All projects" all))
desktop-files-not-to-save supports a regexp to exclude remote.
recentf-keep supports a predicate to exclude remote.
project-list-exclude supports both: a regexp and a predicate.
project-prune-zombie-projects could do the same.
> +(defcustom project-inhibit-message nil
> + "Non-nil means any project command will not display messages in echo area.
> +The messages are displayed in the messages buffer but it won't
> +be shown in the echo area."
Instead of creating numerous options for every command that emits messages,
the new way is to customize a list of messages:
(add-to-list 'set-message-functions 'inhibit-message)
(add-to-list 'inhibit-message-regexps "project was found")
(add-to-list 'inhibit-message-regexps "project was forgotten")
...
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Sun, 22 Jun 2025 01:59:02 GMT)
Full text and
rfc822 format available.
Message #77 received at 77566 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Juri Linkov <juri <at> linkov.net> writes:
>> +(defcustom project-prune-zombie-projects 'exclude-remote
>> + "Automatically remove from project list projects that were deleted.
>> +If set to `exclude-remote' (default), remove deleted projects except
>> +those that are remote.
>> +If set to `all', include remote and no remote projects from being
>> +removed."
>> + :type '(choice (const :tag "Exclude remote projects" exclude-remote)
>> + (const :tag "All projects" all))
>
> desktop-files-not-to-save supports a regexp to exclude remote.
> recentf-keep supports a predicate to exclude remote.
> project-list-exclude supports both: a regexp and a predicate.
> project-prune-zombie-projects could do the same.
Thanks, i think that using a predicate is better, I'm not sure about the
regexp one.
I've moved this to another defcustom (see patch below), for let
'project-prune-zombie-projects' only as an option for enable/disable the
automatic project deletion.
>> +(defcustom project-inhibit-message nil
>> + "Non-nil means any project command will not display messages in echo area.
>> +The messages are displayed in the messages buffer but it won't
>> +be shown in the echo area."
>
> Instead of creating numerous options for every command that emits messages,
> the new way is to customize a list of messages:
>
> (add-to-list 'set-message-functions 'inhibit-message)
> (add-to-list 'inhibit-message-regexps "project was found")
> (add-to-list 'inhibit-message-regexps "project was forgotten")
Cool, i didn't know about this.
Any suggestion about the patch?
[0001-Allow-automatically-delete-non-existent-projects.-Bu.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Sun, 22 Jun 2025 07:00:02 GMT)
Full text and
rfc822 format available.
Message #80 received at 77566 <at> debbugs.gnu.org (full text, mbox):
>> desktop-files-not-to-save supports a regexp to exclude remote.
>> recentf-keep supports a predicate to exclude remote.
>> project-list-exclude supports both: a regexp and a predicate.
>> project-prune-zombie-projects could do the same.
>
> Thanks, i think that using a predicate is better, I'm not sure about the
> regexp one.
Agreed. A regexp is just a subset of a predicate that can use
a function to match a regexp. Moreover, it's too unreliable
to use a regexp to detect remote files.
> I've moved this to another defcustom (see patch below), for let
> 'project-prune-zombie-projects' only as an option for enable/disable the
> automatic project deletion.
Would it be possible to combine two defcustoms into one?
Then this feature could be disabled by customizing the method to nil
that will simplify customization.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Sun, 22 Jun 2025 22:31:02 GMT)
Full text and
rfc822 format available.
Message #83 received at 77566 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Juri Linkov <juri <at> linkov.net> writes:
>> I've moved this to another defcustom (see patch below), for let
>> 'project-prune-zombie-projects' only as an option for enable/disable the
>> automatic project deletion.
>
> Would it be possible to combine two defcustoms into one?
> Then this feature could be disabled by customizing the method to nil
> that will simplify customization.
Sure, I decided not to combine them because I wasn't sure how, but I
found the solution.
[0001-Allow-automatically-delete-non-existent-projects.-Bu.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Tue, 24 Jun 2025 06:51:04 GMT)
Full text and
rfc822 format available.
Message #86 received at 77566 <at> debbugs.gnu.org (full text, mbox):
I looked into installing your patch, but then noticed that
the order of calling file-remote-p and file-exists-p is still
backwards. The main purpose of the predicate file-remote-p
is to avoid costly calls of file-exists-p on remote files.
> +(defun project-prune-zombies-default (project)
> + (not (file-remote-p project)))
> @@ -2153,7 +2181,10 @@ project-forget-zombie-projects
> - (unless (file-exists-p proj)
> + (when (and (not (file-exists-p proj))
> + (if project-prune-zombie-projects
> + (funcall project-prune-zombie-projects proj)
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Tue, 24 Jun 2025 17:18:01 GMT)
Full text and
rfc822 format available.
Message #89 received at 77566 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Juri Linkov <juri <at> linkov.net> writes:
> I looked into installing your patch, but then noticed that
> the order of calling file-remote-p and file-exists-p is still
> backwards. The main purpose of the predicate file-remote-p
> is to avoid costly calls of file-exists-p on remote files.
>
>> +(defun project-prune-zombies-default (project)
>> + (not (file-remote-p project)))
>
>> @@ -2153,7 +2181,10 @@ project-forget-zombie-projects
>> - (unless (file-exists-p proj)
>> + (when (and (not (file-exists-p proj))
>> + (if project-prune-zombie-projects
>> + (funcall project-prune-zombie-projects proj)
Makes sense, I think I forgot about that part.
It should be fixed:
[0001-Allow-automatically-delete-non-existent-projects.-Bu.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Wed, 25 Jun 2025 06:58:03 GMT)
Full text and
rfc822 format available.
Message #92 received at 77566 <at> debbugs.gnu.org (full text, mbox):
close 77566 31.0.50
thanks
>> I looked into installing your patch, but then noticed that
>> the order of calling file-remote-p and file-exists-p is still
>> backwards. The main purpose of the predicate file-remote-p
>> is to avoid costly calls of file-exists-p on remote files.
>
> Makes sense, I think I forgot about that part.
>
> It should be fixed:
No more comments, so now your patch is pushed.
Thanks for this option.
bug marked as fixed in version 31.0.50, send any further explanations to
77566 <at> debbugs.gnu.org and Elijah Gabe Pérez <eg642616 <at> gmail.com>
Request was from
Juri Linkov <juri <at> linkov.net>
to
control <at> debbugs.gnu.org.
(Wed, 25 Jun 2025 06:58:03 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Thu, 26 Jun 2025 01:50:02 GMT)
Full text and
rfc822 format available.
Message #97 received at 77566 <at> debbugs.gnu.org (full text, mbox):
On 24/06/2025 20:17, Elijah Gabe Pérez wrote:
> + (when (and (if project-prune-zombie-projects
> + (funcall project-prune-zombie-projects proj)
> + t)
> + (not (file-exists-p proj)))
Interesting decision - so if the predicate is nil, we don't check the
project for remote-ness (or anything) but still prune it.
In general this seems to work since all the added callers of this
functions check the option to be non-nil, but the logic does seem
non-intuitive.
Maybe we should update project-forget-zombie-projects's docstring at
least: it says "all" without any additional elaborations.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Thu, 26 Jun 2025 06:16:02 GMT)
Full text and
rfc822 format available.
Message #100 received at 77566 <at> debbugs.gnu.org (full text, mbox):
>> + (when (and (if project-prune-zombie-projects
>> + (funcall project-prune-zombie-projects proj)
>> + t)
>> + (not (file-exists-p proj)))
>
> Interesting decision - so if the predicate is nil, we don't check the
> project for remote-ness (or anything) but still prune it.
>
> In general this seems to work since all the added callers of this functions
> check the option to be non-nil, but the logic does seem non-intuitive.
I noticed this gotcha while reviewing the patch. Maybe a cleaner way
would be to use a special value e.g. 'none' instead of nil. And also add
an argument 'interactive' to 'project-forget-zombie-projects'. So could
check explicitly that in case if 'interactive' is non-nil and the value
is 'none' then still use 'file-exists-p'.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Thu, 26 Jun 2025 23:03:03 GMT)
Full text and
rfc822 format available.
Message #103 received at 77566 <at> debbugs.gnu.org (full text, mbox):
On 26/06/2025 09:07, Juri Linkov wrote:
> I noticed this gotcha while reviewing the patch. Maybe a cleaner way
> would be to use a special value e.g. 'none' instead of nil. And also add
> an argument 'interactive' to 'project-forget-zombie-projects'. So could
> check explicitly that in case if 'interactive' is non-nil and the value
> is 'none' then still use 'file-exists-p'.
'none' and nil seem equivalent in the description. Unless one really
wants to disable the remoteness check, but only in one of the scenarios?
But if I were to decide which of the code paths would skip the
file-remote-p check, it would probably be the interactive
'project-forget-zombie-projects' invocation, rather than the general
scenario. Or maybe that would only happen with the prefix argument,
something like that.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Fri, 27 Jun 2025 00:31:02 GMT)
Full text and
rfc822 format available.
Message #106 received at 77566 <at> debbugs.gnu.org (full text, mbox):
Dmitry Gutov <dmitry <at> gutov.dev> writes:
> On 26/06/2025 09:07, Juri Linkov wrote:
>> I noticed this gotcha while reviewing the patch. Maybe a cleaner way
>> would be to use a special value e.g. 'none' instead of nil. And also add
>> an argument 'interactive' to 'project-forget-zombie-projects'. So could
>> check explicitly that in case if 'interactive' is non-nil and the value
>> is 'none' then still use 'file-exists-p'.
>
> 'none' and nil seem equivalent in the description. Unless one really
> wants to disable the remoteness check, but only in one of the
> scenarios?
>
> But if I were to decide which of the code paths would skip the
> file-remote-p check, it would probably be the interactive
> 'project-forget-zombie-projects' invocation, rather than the general
> scenario. Or maybe that would only happen with the prefix argument,
> something like that.
I don't quite understand this conversation, the idea is add a prefix
argument to `project-forget-zombie-projects` for do not delete remote
projects or modify `project-prune-zombie-projects` behavior?
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Fri, 27 Jun 2025 00:35:02 GMT)
Full text and
rfc822 format available.
Message #109 received at 77566 <at> debbugs.gnu.org (full text, mbox):
Dmitry Gutov <dmitry <at> gutov.dev> writes:
> Maybe we should update project-forget-zombie-projects's docstring at
> least: it says "all" without any additional elaborations.
Then it would be better to remove that all, or document the behavior
well, I do not know what is proposed.
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Fri, 27 Jun 2025 06:51:05 GMT)
Full text and
rfc822 format available.
Message #112 received at 77566 <at> debbugs.gnu.org (full text, mbox):
>>> I noticed this gotcha while reviewing the patch. Maybe a cleaner way
>>> would be to use a special value e.g. 'none' instead of nil. And also add
>>> an argument 'interactive' to 'project-forget-zombie-projects'. So could
>>> check explicitly that in case if 'interactive' is non-nil and the value
>>> is 'none' then still use 'file-exists-p'.
>>
>> 'none' and nil seem equivalent in the description. Unless one really
>> wants to disable the remoteness check, but only in one of the
>> scenarios?
>>
>> But if I were to decide which of the code paths would skip the
>> file-remote-p check, it would probably be the interactive
>> 'project-forget-zombie-projects' invocation, rather than the general
>> scenario. Or maybe that would only happen with the prefix argument,
>> something like that.
>
> I don't quite understand this conversation, the idea is add a prefix
> argument to `project-forget-zombie-projects` for do not delete remote
> projects or modify `project-prune-zombie-projects` behavior?
To understand what customization we should provide, let's consider
the most likely use cases:
1. pruning the project on the first reading of the list.
For example, recentf-auto-cleanup does this on enabling its mode
with ignoring remote non-connected files.
2. before every prompting. For users who don't delete project directories
very often, it would be still too costly to call file-exists-p
on a large list of projects before every switching between projects.
To avoid adding another option to distinguish between these two cases,
we could supply a new argument to the predicate with possible values:
a. 'list-read'
b. 'list-write'
c. 'prompt'
Then to e.g. apply the predicate only in case of reading/writing the list:
(defun project-prune-zombies-default (project when)
(and (memq when '(list-read list-write))
(not (file-remote-p project))))
3. explicit execution of 'M-x project-forget-zombie-projects RET'.
We don't know to what custom function the users might prefer
to customize 'project-prune-zombie-projects'. Maybe they want
to use such a predicate to keep even some non-existent projects.
Then 'project-forget-zombie-projects' should support two ways:
one that ignores the predicate in 'project-prune-zombie-projects',
and another e.g. with a prefix argument (via the new argument
'interactive') that respects it.
Instead of the prefix argument, the predicate could be called
with the argument 'when' set to the value 'interactive'.
Then the predicate can decide what to do in this case.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Sat, 28 Jun 2025 01:12:05 GMT)
Full text and
rfc822 format available.
Message #115 received at 77566 <at> debbugs.gnu.org (full text, mbox):
On 27/06/2025 09:45, Juri Linkov wrote:
> To avoid adding another option to distinguish between these two cases,
> we could supply a new argument to the predicate with possible values:
>
> a. 'list-read'
> b. 'list-write'
> c. 'prompt'
Interesting. That sounds very flexible, more than I expected too.
What if we try to make the custom value more transparent? E.g. using
alist with actions. Here's how it might look (with some verbose symbol
names as well, just a suggestion):
((list-first-read . identity)
(list-write . (not project-remote-p))
(interactively . identity))
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Sat, 28 Jun 2025 01:13:05 GMT)
Full text and
rfc822 format available.
Message #118 received at 77566 <at> debbugs.gnu.org (full text, mbox):
On 27/06/2025 03:33, Elijah Gabe Pérez wrote:
>> Maybe we should update project-forget-zombie-projects's docstring at
>> least: it says "all" without any additional elaborations.
> Then it would be better to remove that all, or document the behavior
> well, I do not know what is proposed.
Document it a little better is what I prefer - otherwise someone
examining the command with 'C-h f' won't have a good idea of the effect
without reading the code.
How much detail to go into, is a matter of judgment. Open to suggestions.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Sun, 29 Jun 2025 07:01:03 GMT)
Full text and
rfc822 format available.
Message #121 received at 77566 <at> debbugs.gnu.org (full text, mbox):
>> To avoid adding another option to distinguish between these two cases,
>> we could supply a new argument to the predicate with possible values:
>> a. 'list-read'
>> b. 'list-write'
>> c. 'prompt'
>
> Interesting. That sounds very flexible, more than I expected too.
>
> What if we try to make the custom value more transparent? E.g. using alist
> with actions. Here's how it might look (with some verbose symbol names as
> well, just a suggestion):
>
> ((list-first-read . identity)
> (list-write . (not project-remote-p))
> (interactively . identity))
Agreed, this would be easier to customize.
Also '(not project-remote-p)' could be
simplified to a plain symbol.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Wed, 09 Jul 2025 00:53:01 GMT)
Full text and
rfc822 format available.
Message #124 received at 77566 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Juri Linkov <juri <at> linkov.net> writes:
>>> To avoid adding another option to distinguish between these two cases,
>>> we could supply a new argument to the predicate with possible values:
>>> a. 'list-read'
>>> b. 'list-write'
>>> c. 'prompt'
>>
>> Interesting. That sounds very flexible, more than I expected too.
>>
>> What if we try to make the custom value more transparent? E.g. using alist
>> with actions. Here's how it might look (with some verbose symbol names as
>> well, just a suggestion):
>>
>> ((list-first-read . identity)
>> (list-write . (not project-remote-p))
>> (interactively . identity))
>
> Agreed, this would be easier to customize.
> Also '(not project-remote-p)' could be
> simplified to a plain symbol.
This is what i have done, this is only a concept (i didn't test it yet)
but i think this gives some idea of the proposed design here.
I had to split `project-forget-zombie-projects` in 2 functions for avoid
using `called-interactively-p` in `project-forget-zombie-projects` for
the pruning (honestly, I'm not satisfied with this result).
What do you all think about?
[project.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Wed, 09 Jul 2025 06:20:01 GMT)
Full text and
rfc822 format available.
Message #127 received at 77566 <at> debbugs.gnu.org (full text, mbox):
>>> ((list-first-read . identity)
>>> (list-write . (not project-remote-p))
>>> (interactively . identity))
>>
>> Agreed, this would be easier to customize.
>> Also '(not project-remote-p)' could be
>> simplified to a plain symbol.
>
> This is what i have done, this is only a concept (i didn't test it yet)
> but i think this gives some idea of the proposed design here.
>
> I had to split `project-forget-zombie-projects` in 2 functions for avoid
Thanks, a separate function is the right thing to do.
> using `called-interactively-p` in `project-forget-zombie-projects` for
> the pruning (honestly, I'm not satisfied with this result).
Instead of `called-interactively-p` interactivity can be detected
by adding a new argument `interactive` like
(defun project-forget-zombie-projects (&optional interactive)
(interactive "p")
(if interactive ...)
This is also fine:
(defun project-forget-zombie-projects (&optional interactive)
(interactive (list t))
(if interactive ...)
> +(defcustom project-prune-zombie-projects
> + '((list-first-read . identity)
> + (list-write . project-prune-zombies-default)
> + (interactively . identity))
To keep previous default behavior `list-first-read` should check
remote dirs as well. Only `interactively` can use `identity`
to remove even remote dirs.
> + `list-first-read' - delete on the first reading of the list.
> + `list-write' - delete before every prompting.
> + `interactively' - delete only when `project-forget-zombie-projects'
> + is called interactively.
A symbol for prompting is missing. What would be a good name?
Maybe just "`prompt' - delete before every prompting".
> -(defun project-prune-zombies-default (project)
> +(defun project-prune-zombies-default (project when)
The argument `when` looks like a leftover from the previous version.
> +(defun project-forget-zombie-projects ()
> + "Forget all known projects that don't exist any more."
> + (interactive)
> + (let ((pred (alist-get 'interactively project-prune-zombie-projects)))
> + (project--delete-zombie-projects delete)))
`delete` -> `pred`
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Thu, 10 Jul 2025 01:30:06 GMT)
Full text and
rfc822 format available.
Message #130 received at 77566 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Juri Linkov <juri <at> linkov.net> writes:
>> +(defcustom project-prune-zombie-projects
>> + '((list-first-read . identity)
>> + (list-write . project-prune-zombies-default)
>> + (interactively . identity))
>
> To keep previous default behavior `list-first-read` should check
> remote dirs as well. Only `interactively` can use `identity`
> to remove even remote dirs.
Thanks I've changed it.
>> + `list-first-read' - delete on the first reading of the list.
>> + `list-write' - delete before every prompting.
>> + `interactively' - delete only when `project-forget-zombie-projects'
>> + is called interactively.
>
> A symbol for prompting is missing. What would be a good name?
> Maybe just "`prompt' - delete before every prompting".
I've renamed `list-write` to `prompt`, now it should be more clear.
[project.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
Also I'm wondering if we can rename `project-prune-zombies-default`
function to `project-prune-non-remote-zombies`, since this is now an
alist, the "default" part of the name becomes pointless or confusing.
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Thu, 10 Jul 2025 02:14:06 GMT)
Full text and
rfc822 format available.
Message #133 received at 77566 <at> debbugs.gnu.org (full text, mbox):
On 10/07/2025 04:29, Elijah Gabe Pérez wrote:
>>> + `list-first-read' - delete on the first reading of the list.
>>> + `list-write' - delete before every prompting.
>>> + `interactively' - delete only when `project-forget-zombie-projects'
>>> + is called interactively.
>> A symbol for prompting is missing. What would be a good name?
>> Maybe just "`prompt' - delete before every prompting".
> I've renamed `list-write` to `prompt`, now it should be more clear.
Note that project--write-project-list is not only called when you see a
prompt, but basically anytime when project-current is called (through
'project-remember-project').
> Also I'm wondering if we can rename `project-prune-zombies-default`
> function to `project-prune-non-remote-zombies`, since this is now an
> alist, the "default" part of the name becomes pointless or confusing.
Might be nicer to change it to a special symbol ('not-remote'), which
we'd handle inside project--delete-zombie-projects.
Or support nested form (not ...), like (not file-remote-p).
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Thu, 10 Jul 2025 02:28:02 GMT)
Full text and
rfc822 format available.
Message #136 received at 77566 <at> debbugs.gnu.org (full text, mbox):
On 10/07/2025 05:12, Dmitry Gutov wrote:
>> I've renamed `list-write` to `prompt`, now it should be more clear.
>
> Note that project--write-project-list is not only called when you see a
> prompt, but basically anytime when project-current is called (through
> 'project-remember-project').
Or rather project--remember-dir is called, which invokes
project--write-project-list whenever the current project changes. But
this can happen without a user prompt (simply after the user switches to
another project e.g. using find-file).
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Thu, 10 Jul 2025 02:53:02 GMT)
Full text and
rfc822 format available.
Message #139 received at 77566 <at> debbugs.gnu.org (full text, mbox):
Dmitry Gutov <dmitry <at> gutov.dev> writes:
> On 10/07/2025 04:29, Elijah Gabe Pérez wrote:
>>>> + `list-first-read' - delete on the first reading of the list.
>>>> + `list-write' - delete before every prompting.
>>>> + `interactively' - delete only when `project-forget-zombie-projects'
>>>> + is called interactively.
>>> A symbol for prompting is missing. What would be a good name?
>>> Maybe just "`prompt' - delete before every prompting".
>> I've renamed `list-write` to `prompt`, now it should be more clear.
>
> Note that project--write-project-list is not only called when you see
> a prompt, but basically anytime when project-current is called
> (through 'project-remember-project').
Thanks for the clarification, I will also include the list-write
tomorrow.
>> Also I'm wondering if we can rename `project-prune-zombies-default`
>> function to `project-prune-non-remote-zombies`, since this is now an
>> alist, the "default" part of the name becomes pointless or confusing.
>
> Might be nicer to change it to a special symbol ('not-remote'), which
> we'd handle inside project--delete-zombie-projects.
>
> Or support nested form (not ...), like (not file-remote-p).
I think this nested form is better, this will avoid having to define a
simple function for the remote exclusion.
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Thu, 10 Jul 2025 23:45:02 GMT)
Full text and
rfc822 format available.
Message #142 received at 77566 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
This is what I've done, I removed `project-prune-zombies-default` to
use a cons cell for the negation functions instead:
Something like this look like:
'((prompt . (not . file-remote-p)))
I also added the `list-write` symbol.
[project.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Fri, 11 Jul 2025 07:27:02 GMT)
Full text and
rfc822 format available.
Message #145 received at 77566 <at> debbugs.gnu.org (full text, mbox):
Hello,
On Thu 10 Jul 2025 at 05:43pm -06, Elijah Gabe Pérez wrote:
> This is what I've done, I removed `project-prune-zombies-default` to
> use a cons cell for the negation functions instead:
>
> Something like this look like:
>
> '((prompt . (not . file-remote-p)))
>
> I also added the `list-write` symbol.
We already have negations functions like this in a few other places and
we use proper lists not cons cells. E.g. buffer-match-p. So it would
be better to use that here to, I think.
--
Sean Whitton
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Sun, 13 Jul 2025 04:25:01 GMT)
Full text and
rfc822 format available.
Message #148 received at 77566 <at> debbugs.gnu.org (full text, mbox):
Sean Whitton <spwhitton <at> spwhitton.name> writes:
> Hello,
>
> On Thu 10 Jul 2025 at 05:43pm -06, Elijah Gabe Pérez wrote:
>
>> This is what I've done, I removed `project-prune-zombies-default` to
>> use a cons cell for the negation functions instead:
>>
>> Something like this look like:
>>
>> '((prompt . (not . file-remote-p)))
>>
>> I also added the `list-write` symbol.
>
> We already have negations functions like this in a few other places and
> we use proper lists not cons cells. E.g. buffer-match-p. So it would
> be better to use that here to, I think.
I'm not sure what kind of list would be prefer to use, the cons cells
are inspired by buffer-match-p. I find it more easy to use cdr there
instead of cadr for get the function.
--
- E.G via GNU Emacs and Org.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org.
(Sun, 10 Aug 2025 11:24:07 GMT)
Full text and
rfc822 format available.
bug unarchived.
Request was from
Juri Linkov <juri <at> linkov.net>
to
control <at> debbugs.gnu.org.
(Sun, 10 Aug 2025 19:04:03 GMT)
Full text and
rfc822 format available.
bug No longer marked as fixed in versions 31.0.50 and reopened.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org.
(Sun, 10 Aug 2025 19:04:03 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Wed, 13 Aug 2025 00:39:02 GMT)
Full text and
rfc822 format available.
Message #157 received at 77566 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Juri Linkov <juri <at> linkov.net> writes:
> unarchive 77566
> reopen 77566
> thanks
>
>>>> This is what I've done, I removed `project-prune-zombies-default` to
>>>> use a cons cell for the negation functions instead:
>>>>
>>>> Something like this look like:
>>>>
>>>> '((prompt . (not . file-remote-p)))
>>>>
>>>> I also added the `list-write` symbol.
>>>
>>> We already have negations functions like this in a few other places and
>>> we use proper lists not cons cells. E.g. buffer-match-p. So it would
>>> be better to use that here to, I think.
>>
>> I'm not sure what kind of list would be prefer to use, the cons cells
>> are inspired by buffer-match-p. I find it more easy to use cdr there
>> instead of cadr for get the function.
>
> Maybe better to avoid the complexity of the 'not' negation
> by keeping the previous implementation:
>
> (defun project-prune-zombies-default (project)
> "Default function used in `project-prune-zombie-projects'.
> Return non-nil if PROJECT is not a remote project."
> (not (file-remote-p project)))
>
> and using a simple cons pair (WHEN . PREDICATE) without supporting 'not'.
Fine, I've updated the patch:
[0001-project-Improve-pruning-of-zombie-projects.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
- E.G via Gnus and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Wed, 20 Aug 2025 18:20:02 GMT)
Full text and
rfc822 format available.
Message #160 received at 77566 <at> debbugs.gnu.org (full text, mbox):
> Fine, I've updated the patch:
Sorry, applying your patch still fails on these hunks changed in master
on 2025-08-04:
> @@ -2029,9 +2045,9 @@ project-prompt-project-dir
> It's also possible to enter an arbitrary directory not in the list.
> When PROMPT is non-nil, use it as the prompt string."
> (project--ensure-read-project-list)
> - (if-let* (project-prune-zombie-projects
> + (if-let* ((pred (alist-get 'prompt project-prune-zombie-projects))
> (inhibit-message t))
> - (project-forget-zombie-projects))
> + (project--delete-zombie-projects pred))
> (let* ((dir-choice "... (choose a dir)")
> (choices
> ;; XXX: Just using this for the category (for the substring
> @@ -2061,9 +2077,9 @@ project-prompt-project-name
> see `project-list-file'.
> It's also possible to enter an arbitrary directory not in the list.
> When PROMPT is non-nil, use it as the prompt string."
> - (if-let* (project-prune-zombie-projects
> + (if-let* ((pred (alist-get 'prompt project-prune-zombie-projects))
> (inhibit-message t))
> - (project-forget-zombie-projects))
> + (project--delete-zombie-projects pred))
> (let* ((dir-choice "... (choose a dir)")
> project--name-history
> (choices
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#77566; Package
emacs.
(Thu, 21 Aug 2025 17:25:01 GMT)
Full text and
rfc822 format available.
Message #163 received at 77566 <at> debbugs.gnu.org (full text, mbox):
close 77566 31.0.50
thanks
>> Fine, I've updated the patch:
>
> Sorry, applying your patch still fails on these hunks changed in master
> on 2025-08-04:
No problem, I edited the patch, so it applied cleanly
and now pushed and closed. Thanks for this update.
bug marked as fixed in version 31.0.50, send any further explanations to
77566 <at> debbugs.gnu.org and Elijah Gabe Pérez <eg642616 <at> gmail.com>
Request was from
Juri Linkov <juri <at> linkov.net>
to
control <at> debbugs.gnu.org.
(Thu, 21 Aug 2025 17:25:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org.
(Fri, 19 Sep 2025 11:24:11 GMT)
Full text and
rfc822 format available.
This bug report was last modified 64 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.