GNU bug report logs - #63870
29.0.90; project.el can't dynamically populate the project list

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Sat, 3 Jun 2023 11:56:02 UTC

Severity: normal

Found in version 29.0.90

Full log


View this message in rfc822 format

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Spencer Baugh <sbaugh <at> janestreet.com>, 63870 <at> debbugs.gnu.org
Subject: bug#63870: 29.0.90; project.el can't dynamically populate the project list
Date: Sat, 17 Jun 2023 05:55:59 +0300
Hi!

On 03/06/2023 14:55, Spencer Baugh wrote:
> I'd like a customization point where I can supply a function (or list of
> functions) which project-known-project-roots should run to produce an
> additional list of project root directories, which should then be
> appended to project--list.

Are you sure the existing functions won't cut it? Such as 
project-remember-project and project-forget-project.

The names might seem a little wrong, but keeping in mind that 
project--list is about having a list of projects "remembered" somewhere, 
they're probably fine. And you could let-bind project--list somewhere at 
the top level in your function/command/etc, so the list is not altered 
in the end.

> I don't need project.el to specifically remember these projects; they'll
> be remembered automatically as users use them, and completing-read will
> nicely deduplicate the project roots anyway.

We could add some var like project-list-no-write, so that dynamic 
changes don't get written to disk.

Unless you want to keep the "dynamic" list to be used by regular 
commands, that is.

In that case, the above will probably not suffice. We could go with your 
approach, or even add some project-list-sources hook.

But how would the entries from different sources (e.g. the list file and 
your dynamic list) combined? How will they be sorted?

In case we can't come up with a generic way, we could simply add a 
generic storage abstraction (similar to xref-history-storage), which you 
would override/advise to combine the lists as needed for your usage.




This bug report was last modified 1 year and 325 days ago.

Previous Next


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