all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Spencer Baugh <sbaugh@janestreet.com>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: 63870@debbugs.gnu.org
Subject: bug#63870: 29.0.90; project.el can't dynamically populate the project list
Date: Tue, 27 Jun 2023 15:29:48 -0400	[thread overview]
Message-ID: <ier7cro1z6b.fsf@janestreet.com> (raw)
In-Reply-To: <aa0618d7-e868-07ae-9cc4-ebe76f9803e1@gutov.dev> (Dmitry Gutov's message of "Sat, 17 Jun 2023 05:55:59 +0300")

Dmitry Gutov <dmitry@gutov.dev> writes:
> 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.

Oh, certainly project-{remember,forget}-project work, indeed I've used
them in the patch I just posted.  I think I was unclear about what I
wanted, perhaps that patch clarifies what exactly I was looking for.

>> 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.

I don't think these changes are necessary after all.  (Which is good,
because they would add a fair bit of complexity.)  This file-notify
approach I think should work perfectly for a wide variety of uses.





  reply	other threads:[~2023-06-27 19:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-03 11:55 bug#63870: 29.0.90; project.el can't dynamically populate the project list Spencer Baugh
2023-06-15 19:30 ` Spencer Baugh
2023-06-16  5:45   ` Eli Zaretskii
2023-06-17  2:55 ` Dmitry Gutov
2023-06-27 19:29   ` Spencer Baugh [this message]
2023-06-27 19:27 ` Spencer Baugh
2023-06-28 11:24   ` Eli Zaretskii
2023-06-28 12:05     ` Spencer Baugh
2023-06-28 12:18       ` Eli Zaretskii
2023-06-28 12:37         ` Spencer Baugh
2023-06-28 12:56           ` Eli Zaretskii
2023-07-18  2:21             ` Dmitry Gutov
2023-07-18 16:28               ` Spencer Baugh
2023-07-18 17:41                 ` Juri Linkov
2023-07-27  1:59                   ` Dmitry Gutov
2023-07-27  1:57                 ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ier7cro1z6b.fsf@janestreet.com \
    --to=sbaugh@janestreet.com \
    --cc=63870@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.