[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Add cl-defgeneric project-name; first use case eglot

From: Dmitry Gutov
Subject: Re: Add cl-defgeneric project-name; first use case eglot
Date: Wed, 23 Nov 2022 15:46:50 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 23/11/22 10:33, Juri Linkov wrote:
(1) C-x p p emacs TAB is currently rather crowded, because I stuff a lot
of things under ~/src/emacs: emacs.git worktrees, elpa.git, upstream
repos for *ELPA packages…
If I could "name" projects such that only emacs.git worktrees included
the string "emacs" (rather than all repos under ~/src/emacs), that'd
make completion more efficient.
You're welcome to experiment with project-prompt-project-dir's code. But
note that until now that function didn't require to "materialize" project
instances for every entry, it just works off saved directory names.

The feature you have in mind seems to require fetching a project instance
for every dir and calling 'project-name' on it. The apparent #1 gotcha
would be with remote filesystems where connection is slow/impossible, but
it might be possible to skip those when computing the names.
It's possible to add projects names to project--list that it saved in
~/.emacs.d/projects, e.g. '(("~/project/dir/" (name . "Project name")) ...)

I'm not sure it's a good idea because

a) That breakes the idea that every project type decides things (e.g. Projectile has projectile-project-name[-function]).

b) This file is transient. It should be allowed to clear off the projects that haven't been used for a while (or just all but 10-20 most recently used ones), and if the file contains important info, we won't be allowed to do that automatically.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]