GNU bug report logs -
#76307
[PATCH] Add 'project-forget-projects-under-dirs', limit dir selection to relevant dirs
Previous Next
To reply to this bug, email your comments to 76307 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76307
; Package
emacs
.
(Sat, 15 Feb 2025 17:51:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Ship Mints <shipmints <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 15 Feb 2025 17:51: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)]
*** Improved directory selection in 'project-forget-projects-under'.
This command now prompts using a directory list limited to those in the
remembered project list. Previously, it would prompt using general
directories from the file system.
I hope this isn't controversial...it made limited sense to me that the
prompt candidates had no relationship to remembered projects.
*** New command 'project-forget-projects-under-dirs'.
This command prompts for multiple directories under which to forget
remembered projects. The candidate directory list is limited to those
in the remembered project list.
-Stephane
[Message part 2 (text/html, inline)]
[0001-Add-project-forget-projects-under-dirs-limit-dir-sel.patch (application/octet-stream, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76307
; Package
emacs
.
(Sat, 15 Feb 2025 19:19:03 GMT)
Full text and
rfc822 format available.
Message #8 received at 76307 <at> debbugs.gnu.org (full text, mbox):
Hi there,
Ship Mints <shipmints <at> gmail.com> writes:
> *** Improved directory selection in 'project-forget-projects-under'.
>
> This command now prompts using a directory list limited to those in the
> remembered project list. Previously, it would prompt using general
> directories from the file system.
>
> I hope this isn't controversial...it made limited sense to me that the prompt candidates had no relationship to
> remembered projects.
I fully agree, the project-forget-projects-under prompt could be more helpful.
> +(defun project--list-common-dir-prefixes ()
> + "Return a list of common directory prefixes from `project--list'.
> +The returned list is lexically sorted."
> + (project--ensure-read-project-list)
> + (let ((non-essential t) ; inhibit remote-file actions
> + (file-name-handler-alist nil) ; ditto
> + (dirs (seq-uniq
> + (mapcar (lambda (x)
> + (expand-file-name (file-name-as-directory (car x))))
> + project--list)))
> + (prefixes))
> + ;; Surely, there's a better algorithm than n^2.
> + (dolist (dir dirs)
> + (dolist (dir2 dirs)
> + ;; dir equal dir2 might be a singlet we want, so don't prune.
> + (when-let* ((common-prefix
> + (fill-common-string-prefix dir dir2))
> + ((string-suffix-p "/" common-prefix)) ; ignore naked remote ":" prefixes
> + (common-prefix (abbreviate-file-name common-prefix))
> + ((not (member common-prefix prefixes))))
> + (push common-prefix prefixes))))
> + (sort prefixes #'string<)))
> +
> (defun project-forget-zombie-projects ()
> "Forget all known projects that don't exist any more."
> (interactive)
> @@ -2099,13 +2125,25 @@ project-forget-zombie-projects
>
> (defun project-forget-projects-under (dir &optional recursive)
> "Forget all known projects below a directory DIR.
> -Interactively, prompt for DIR.
> +Interactively, prompt for DIR, and default to the current directory.
> Optional argument RECURSIVE, if non-nil (interactively, the prefix
> argument), means recurse into subdirectories under DIR
> to remove those projects from the index.
> Display a message at the end summarizing what was forgotten.
> Return the number of forgotten projects."
> - (interactive "DDirectory: \nP")
> + (interactive
> + (list
> + (let* ((candidates
> + (append (list (abbreviate-file-name
> + (file-name-as-directory
> + default-directory)))
> + (project--list-common-dir-prefixes)))
> + (comps
> + (completing-read "Directory: "
> + (project--file-completion-table candidates 'no-sort)
> + nil t))
> + comps))
> + (not (null current-prefix-arg))))
> (let ((count 0))
> (if recursive
> (dolist (proj (project-known-project-roots))
ISTM that we can stick to read-directory-name, but add a completion
predicate that only keeps directories that lead to project roots.
Here's how that could look:
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 35bf66c9ffb..b20e3d5981d 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -2097,6 +2097,18 @@ project-forget-zombie-projects
(unless (file-exists-p proj)
(project-forget-project proj))))
+(defun project-read-ancestor-directory (prompt)
+ "Prompt with PROMPT for an ancestor directory of one or more project roots."
+ (project--ensure-read-project-list)
+ (read-directory-name
+ prompt nil nil nil nil
+ (let ((ps (mapcar (lambda (p) (expand-file-name (car p))) project--list)))
+ (lambda (dir)
+ (catch 'ball
+ (dolist (p ps)
+ (when (string-prefix-p (expand-file-name dir) p)
+ (throw 'ball t))))))))
+
(defun project-forget-projects-under (dir &optional recursive)
"Forget all known projects below a directory DIR.
Interactively, prompt for DIR.
@@ -2105,7 +2117,9 @@ project-forget-projects-under
to remove those projects from the index.
Display a message at the end summarizing what was forgotten.
Return the number of forgotten projects."
- (interactive "DDirectory: \nP")
+ (interactive
+ (list (project-read-ancestor-directory "Forget projects under directory: ")
+ current-prefix-arg))
(let ((count 0))
(if recursive
(dolist (proj (project-known-project-roots))
Best,
Eshel
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76307
; Package
emacs
.
(Sat, 15 Feb 2025 19:33:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 76307 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Sat, Feb 15, 2025 at 2:18 PM Eshel Yaron <me <at> eshelyaron.com> wrote:
> Hi there,
>
> Ship Mints <shipmints <at> gmail.com> writes:
>
> > *** Improved directory selection in 'project-forget-projects-under'.
> >
> > This command now prompts using a directory list limited to those in the
> > remembered project list. Previously, it would prompt using general
> > directories from the file system.
> >
> > I hope this isn't controversial...it made limited sense to me that the
> prompt candidates had no relationship to
> > remembered projects.
>
> I fully agree, the project-forget-projects-under prompt could be more
> helpful.
>
> > +(defun project--list-common-dir-prefixes ()
> > + "Return a list of common directory prefixes from `project--list'.
> > +The returned list is lexically sorted."
> > + (project--ensure-read-project-list)
> > + (let ((non-essential t) ; inhibit remote-file actions
> > + (file-name-handler-alist nil) ; ditto
> > + (dirs (seq-uniq
> > + (mapcar (lambda (x)
> > + (expand-file-name (file-name-as-directory (car
> x))))
> > + project--list)))
> > + (prefixes))
> > + ;; Surely, there's a better algorithm than n^2.
> > + (dolist (dir dirs)
> > + (dolist (dir2 dirs)
> > + ;; dir equal dir2 might be a singlet we want, so don't prune.
> > + (when-let* ((common-prefix
> > + (fill-common-string-prefix dir dir2))
> > + ((string-suffix-p "/" common-prefix)) ; ignore
> naked remote ":" prefixes
> > + (common-prefix (abbreviate-file-name common-prefix))
> > + ((not (member common-prefix prefixes))))
> > + (push common-prefix prefixes))))
> > + (sort prefixes #'string<)))
> > +
> > (defun project-forget-zombie-projects ()
> > "Forget all known projects that don't exist any more."
> > (interactive)
> > @@ -2099,13 +2125,25 @@ project-forget-zombie-projects
> >
> > (defun project-forget-projects-under (dir &optional recursive)
> > "Forget all known projects below a directory DIR.
> > -Interactively, prompt for DIR.
> > +Interactively, prompt for DIR, and default to the current directory.
> > Optional argument RECURSIVE, if non-nil (interactively, the prefix
> > argument), means recurse into subdirectories under DIR
> > to remove those projects from the index.
> > Display a message at the end summarizing what was forgotten.
> > Return the number of forgotten projects."
> > - (interactive "DDirectory: \nP")
> > + (interactive
> > + (list
> > + (let* ((candidates
> > + (append (list (abbreviate-file-name
> > + (file-name-as-directory
> > + default-directory)))
> > + (project--list-common-dir-prefixes)))
> > + (comps
> > + (completing-read "Directory: "
> > + (project--file-completion-table candidates
> 'no-sort)
> > + nil t))
> > + comps))
> > + (not (null current-prefix-arg))))
> > (let ((count 0))
> > (if recursive
> > (dolist (proj (project-known-project-roots))
>
> ISTM that we can stick to read-directory-name, but add a completion
> predicate that only keeps directories that lead to project roots.
>
> Here's how that could look:
>
> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
> index 35bf66c9ffb..b20e3d5981d 100644
> --- a/lisp/progmodes/project.el
> +++ b/lisp/progmodes/project.el
> @@ -2097,6 +2097,18 @@ project-forget-zombie-projects
> (unless (file-exists-p proj)
> (project-forget-project proj))))
>
> +(defun project-read-ancestor-directory (prompt)
> + "Prompt with PROMPT for an ancestor directory of one or more project
> roots."
> + (project--ensure-read-project-list)
> + (read-directory-name
> + prompt nil nil nil nil
> + (let ((ps (mapcar (lambda (p) (expand-file-name (car p)))
> project--list)))
> + (lambda (dir)
> + (catch 'ball
> + (dolist (p ps)
> + (when (string-prefix-p (expand-file-name dir) p)
> + (throw 'ball t))))))))
> +
> (defun project-forget-projects-under (dir &optional recursive)
> "Forget all known projects below a directory DIR.
> Interactively, prompt for DIR.
> @@ -2105,7 +2117,9 @@ project-forget-projects-under
> to remove those projects from the index.
> Display a message at the end summarizing what was forgotten.
> Return the number of forgotten projects."
> - (interactive "DDirectory: \nP")
> + (interactive
> + (list (project-read-ancestor-directory "Forget projects under
> directory: ")
> + current-prefix-arg))
> (let ((count 0))
> (if recursive
> (dolist (proj (project-known-project-roots))
>
Thank you for your thoughtful feedback.
A couple of things stand out. First, calling completing-read directly means
we can reuse the project-file completion category (and if you use something
like marginalia, you get nice metadata in your completion list), and which
also now can inhibit sorting the completion candidate list, which I find
can be annoying for this kind of use case.
Second, since this is forget "under" directories, prompting with the common
prefixes that allow one to forget under the whole shebang makes more sense
to me. Perhaps your ancestor list generator can be more efficient than the
common-prefix code that I quickly wrote, and it would be helpful for it to
show all common prefixes, don't you agree?
-Stephane
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76307
; Package
emacs
.
(Sat, 15 Feb 2025 22:10:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 76307 <at> debbugs.gnu.org (full text, mbox):
Ship Mints <shipmints <at> gmail.com> writes:
> Thank you for your thoughtful feedback.
>
> A couple of things stand out. First, calling completing-read directly means we can reuse the project-file
> completion category (and if you use something like marginalia, you get nice metadata in your completion list),
In my suggested approach we get the "file" completion category, which
AFAICT marginalia picks up just as well and provides the same kind of
completion annotations.
> and which also now can inhibit sorting the completion candidate list, which I find can be annoying for this kind of
> use case.
Sorry, I'm not sure I understand the problem.
FWIW there are several ways to control sorting besides specifying
display-sort-function in the completion metadata, like completions-sort,
completion-category-overrides and completion-extra-properties.
> Second, since this is forget "under" directories, prompting with the common prefixes that allow one to forget
> under the whole shebang makes more sense to me.
You could still select a common ancestor directory (prefix) to forget
all projects under it, if that's what you mean.
> Perhaps your ancestor list generator can be more efficient than the
> common-prefix code that I quickly wrote, and it would be helpful for
> it to show all common prefixes, don't you agree?
I don't see a lot of benefit in the flat list of all possible choices in
this case, but no strong objection either, just a personal preference.
Eshel
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76307
; Package
emacs
.
(Sun, 16 Feb 2025 12:27:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 76307 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Sat, Feb 15, 2025 at 5:09 PM Eshel Yaron <me <at> eshelyaron.com> wrote:
> Ship Mints <shipmints <at> gmail.com> writes:
>
> > Thank you for your thoughtful feedback.
> >
> > A couple of things stand out. First, calling completing-read directly
> means we can reuse the project-file
> > completion category (and if you use something like marginalia, you get
> nice metadata in your completion list),
>
> In my suggested approach we get the "file" completion category, which
> AFAICT marginalia picks up just as well and provides the same kind of
> completion annotations.
>
> > and which also now can inhibit sorting the completion candidate list,
> which I find can be annoying for this kind of
> > use case.
>
> Sorry, I'm not sure I understand the problem.
>
> FWIW there are several ways to control sorting besides specifying
> display-sort-function in the completion metadata, like completions-sort,
> completion-category-overrides and completion-extra-properties.
>
Hewing to the style of the project.el code base, considered choices like a
dedicated project-file category, and reusing/improving its own code seem
like good things to me. I'm not one of its maintainers, so I try to keep it
easy for those who are.
> > Second, since this is forget "under" directories, prompting with the
> common prefixes that allow one to forget
> > under the whole shebang makes more sense to me.
>
> You could still select a common ancestor directory (prefix) to forget
> all projects under it, if that's what you mean.
>
> > Perhaps your ancestor list generator can be more efficient than the
> > common-prefix code that I quickly wrote, and it would be helpful for
> > it to show all common prefixes, don't you agree?
>
> I don't see a lot of benefit in the flat list of all possible choices in
> this case, but no strong objection either, just a personal preference.
>
Not sure the common-prefix list is "flatter" than any other kind of list,
but it is convenient when one wants to forget projects on a remote host en
masse, or in the root of a directory tree that has script-kiddie git repos
everywhere (one day, they'll all learn that monorepos are the way) and I
want to forget everything I've seen (for more than one reason!).
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76307
; Package
emacs
.
(Sun, 16 Feb 2025 13:33:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 76307 <at> debbugs.gnu.org (full text, mbox):
Hi,
Ship Mints <shipmints <at> gmail.com> writes:
> Not sure the common-prefix list is "flatter" than any other kind of list, but it is convenient when one wants to
> forget projects on a remote host en masse, or in the root of a directory tree that has script-kiddie git repos
> everywhere (one day, they'll all learn that monorepos are the way) and I want to forget everything I've seen
> (for more than one reason!).
I'm confused. You can do those things in the current implementation,
and in my proposal too.
Could you perhaps spell out the benefit of your suggested implementation
for a concrete use case? That might help to clear the confusion.
Thanks,
Eshel
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76307
; Package
emacs
.
(Sun, 16 Feb 2025 17:36:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 76307 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
I tried your code to do a side-by-side but:
Debugger entered--Lisp error: (wrong-number-of-arguments
read-directory-name 6)
(read-directory-name prompt nil nil nil nil (let ((ps (mapcar #'(lambda
(p) (expand-file-name ...)) project--list))) #'(lambda (dir) (catch 'ball
(let ((tail ps)) (while tail (let ... ... ...)))))))
In any case, my approach produces all legitimate possibilities a user could
want to clear projects under any common prefix, including "/" (which means
forget everything), common prefixes for remote directories, common roots
for multiple projects at the same level and common roots up the tree for
projects that are in a deeper hierarchy. This is effectively what I think
people would want, and I assume you agree. If your code produces the same
and is more efficient, that's great.
-Stephane
On Sun, Feb 16, 2025 at 8:32 AM Eshel Yaron <me <at> eshelyaron.com> wrote:
> Hi,
>
> Ship Mints <shipmints <at> gmail.com> writes:
>
> > Not sure the common-prefix list is "flatter" than any other kind of
> list, but it is convenient when one wants to
> > forget projects on a remote host en masse, or in the root of a directory
> tree that has script-kiddie git repos
> > everywhere (one day, they'll all learn that monorepos are the way) and I
> want to forget everything I've seen
> > (for more than one reason!).
>
> I'm confused. You can do those things in the current implementation,
> and in my proposal too.
>
> Could you perhaps spell out the benefit of your suggested implementation
> for a concrete use case? That might help to clear the confusion.
>
>
> Thanks,
>
> Eshel
>
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76307
; Package
emacs
.
(Sun, 16 Feb 2025 18:02:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 76307 <at> debbugs.gnu.org (full text, mbox):
Hi,
Ship Mints <shipmints <at> gmail.com> writes:
> I tried your code to do a side-by-side but:
>
> Debugger entered--Lisp error: (wrong-number-of-arguments read-directory-name 6)
> (read-directory-name prompt nil nil nil nil (let ((ps (mapcar #'(lambda (p) (expand-file-name ...))
> project--list))) #'(lambda (dir) (catch 'ball (let ((tail ps)) (while tail (let ... ... ...)))))))
Try with a current build from master :)
> In any case, my approach produces all legitimate possibilities a user could want to clear projects under any
> common prefix, including "/" (which means forget everything), common prefixes for remote directories, common
> roots for multiple projects at the same level and common roots up the tree for projects that are in a deeper
> hierarchy. This is effectively what I think people would want, and I assume you agree.
I don't: that's the flat list which I find inappropriate in this case.
Projects may (and do) reside all over the filesystem, so producing all
possible prefixes of one or more project roots amounts to a huge list
with potentially many irrelevant entries. Here I prefer completing the
directory name incrementally, by following the filesystem hierarchy,
with the usual Emacs file/directory name completion.
> If your code produces the same and is more efficient, that's great.
My suggestion basically preserves the current behavior, it just filters
the directories you can complete at each level to only include those
that actually lead to one or more project roots.
Best,
Eshel
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76307
; Package
emacs
.
(Sun, 16 Feb 2025 18:10:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 76307 <at> debbugs.gnu.org (full text, mbox):
Eshel Yaron <me <at> eshelyaron.com> writes:
> Hi,
>
> Ship Mints <shipmints <at> gmail.com> writes:
>
>> I tried your code to do a side-by-side but:
>>
>> Debugger entered--Lisp error: (wrong-number-of-arguments read-directory-name 6)
>> (read-directory-name prompt nil nil nil nil (let ((ps (mapcar #'(lambda (p) (expand-file-name ...))
>> project--list))) #'(lambda (dir) (catch 'ball (let ((tail ps)) (while tail (let ... ... ...)))))))
>
> Try with a current build from master :)
>
>> In any case, my approach produces all legitimate possibilities a user could want to clear projects under any
>> common prefix, including "/" (which means forget everything), common prefixes for remote directories, common
>> roots for multiple projects at the same level and common roots up the tree for projects that are in a deeper
>> hierarchy. This is effectively what I think people would want, and I assume you agree.
>
> I don't: that's the flat list which I find inappropriate in this case.
> Projects may (and do) reside all over the filesystem, so producing all
> possible prefixes of one or more project roots amounts to a huge list
> with potentially many irrelevant entries. Here I prefer completing the
> directory name incrementally, by following the filesystem hierarchy,
> with the usual Emacs file/directory name completion.
>
>> If your code produces the same and is more efficient, that's great.
>
> My suggestion basically preserves the current behavior, it just filters
> the directories you can complete at each level to only include those
> that actually lead to one or more project roots.
BTW, here's a slightly improved project-read-ancestor-directory, it uses
try-completion to check if a candidate directory is a prefix of any
project root, which seems to be faster than the Lisp implementation I
tried at first:
--8<---------------cut here---------------start------------->8---
(defun project-read-ancestor-directory (prompt)
"Prompt with PROMPT for an ancestor directory of one or more project roots."
(project--ensure-read-project-list)
(read-directory-name
prompt nil nil nil nil
(let ((ps (mapcar (lambda (p) (expand-file-name (car p))) project--list)))
(lambda (dir) (try-completion (expand-file-name dir) ps)))))
--8<---------------cut here---------------end--------------->8---
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76307
; Package
emacs
.
(Sun, 16 Feb 2025 19:42:02 GMT)
Full text and
rfc822 format available.
Message #32 received at 76307 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Perhaps we're using different completion tools. A more expansive list
doesn't bother me.
Let's see what Dmitry and Juri have to add.
On Sun, Feb 16, 2025 at 1:09 PM Eshel Yaron <me <at> eshelyaron.com> wrote:
> Eshel Yaron <me <at> eshelyaron.com> writes:
>
> > Hi,
> >
> > Ship Mints <shipmints <at> gmail.com> writes:
> >
> >> I tried your code to do a side-by-side but:
> >>
> >> Debugger entered--Lisp error: (wrong-number-of-arguments
> read-directory-name 6)
> >> (read-directory-name prompt nil nil nil nil (let ((ps (mapcar
> #'(lambda (p) (expand-file-name ...))
> >> project--list))) #'(lambda (dir) (catch 'ball (let ((tail ps)) (while
> tail (let ... ... ...)))))))
> >
> > Try with a current build from master :)
> >
> >> In any case, my approach produces all legitimate possibilities a user
> could want to clear projects under any
> >> common prefix, including "/" (which means forget everything), common
> prefixes for remote directories, common
> >> roots for multiple projects at the same level and common roots up the
> tree for projects that are in a deeper
> >> hierarchy. This is effectively what I think people would want, and I
> assume you agree.
> >
> > I don't: that's the flat list which I find inappropriate in this case.
> > Projects may (and do) reside all over the filesystem, so producing all
> > possible prefixes of one or more project roots amounts to a huge list
> > with potentially many irrelevant entries. Here I prefer completing the
> > directory name incrementally, by following the filesystem hierarchy,
> > with the usual Emacs file/directory name completion.
> >
> >> If your code produces the same and is more efficient, that's great.
> >
> > My suggestion basically preserves the current behavior, it just filters
> > the directories you can complete at each level to only include those
> > that actually lead to one or more project roots.
>
>
> BTW, here's a slightly improved project-read-ancestor-directory, it uses
> try-completion to check if a candidate directory is a prefix of any
> project root, which seems to be faster than the Lisp implementation I
> tried at first:
>
> --8<---------------cut here---------------start------------->8---
> (defun project-read-ancestor-directory (prompt)
> "Prompt with PROMPT for an ancestor directory of one or more project
> roots."
> (project--ensure-read-project-list)
> (read-directory-name
> prompt nil nil nil nil
> (let ((ps (mapcar (lambda (p) (expand-file-name (car p)))
> project--list)))
> (lambda (dir) (try-completion (expand-file-name dir) ps)))))
> --8<---------------cut here---------------end--------------->8---
>
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76307
; Package
emacs
.
(Tue, 18 Feb 2025 02:55:01 GMT)
Full text and
rfc822 format available.
Message #35 received at 76307 <at> debbugs.gnu.org (full text, mbox):
Hi!
On 15/02/2025 19:50, Ship Mints wrote:
> *** Improved directory selection in 'project-forget-projects-under'.
>
> This command now prompts using a directory list limited to those in the
> remembered project list. Previously, it would prompt using general
> directories from the file system.
>
> I hope this isn't controversial...it made limited sense to me that the
> prompt candidates had no relationship to remembered projects.
This is interesting. I'm not sure that we should reuse the same helper
(project--file-completion-table) or the category, but reading from a
more limited list seems like a good idea.
> *** New command 'project-forget-projects-under-dirs'.
>
> This command prompts for multiple directories under which to forget
> remembered projects. The candidate directory list is limited to those
> in the remembered project list.
This last one might be overkill. How often would one have to "forget
project dirs" for us to make sense to optimize this scenario, rather
than simply have them call the command multiple times?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76307
; Package
emacs
.
(Tue, 18 Feb 2025 03:10:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 76307 <at> debbugs.gnu.org (full text, mbox):
On 16/02/2025 15:32, Eshel Yaron via Bug reports for GNU Emacs, the
Swiss army knife of text editors wrote:
>> Not sure the common-prefix list is "flatter" than any other kind of list, but it is convenient when one wants to
>> forget projects on a remote host en masse, or in the root of a directory tree that has script-kiddie git repos
>> everywhere (one day, they'll all learn that monorepos are the way) and I want to forget everything I've seen
>> (for more than one reason!).
> I'm confused. You can do those things in the current implementation,
> and in my proposal too.
>
> Could you perhaps spell out the benefit of your suggested implementation
> for a concrete use case? That might help to clear the confusion.
ISTM the proposal aims at allowing to easily choose a directory at a
remote host, for example. The current read-directory-name UI makes that
not too trivial.
Severity set to 'wishlist' from 'normal'
Request was from
Stefan Kangas <stefankangas <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Sun, 23 Feb 2025 00:01:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 172 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.