GNU bug report logs - #67310
[PATCH] Include the project--list as history when prompting for a project

Previous Next

Package: emacs;

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

Date: Mon, 20 Nov 2023 19:59:02 UTC

Severity: wishlist

Tags: patch

Full log


Message #29 received at 67310 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Spencer Baugh <sbaugh <at> janestreet.com>
Cc: 67310 <at> debbugs.gnu.org, eliz <at> gnu.org, juri <at> linkov.net
Subject: Re: bug#67310: [PATCH] Include the project--list as history when
 prompting for a project
Date: Wed, 22 Nov 2023 20:44:53 +0200
On 22/11/2023 18:18, Spencer Baugh wrote:
> Dmitry Gutov <dmitry <at> gutov.dev> writes:
>> On 21/11/2023 17:17, Spencer Baugh wrote:
>>>        (if (equal pr-dir dir-choice)
>>>            (read-directory-name "Select directory: " default-directory nil t)
>>> +      (project--add-dir pr-dir)
>>>          pr-dir)))
>>> ...
>>>        (if (equal pr-name dir-choice)
>>>            (read-directory-name "Select directory: " default-directory nil t)
>>> -      (let ((proj (assoc pr-name choices)))
>>> -        (if (stringp proj) proj (project-root (cdr proj)))))))
>>> +      (let* ((proj (assoc pr-name choices))
>>> +             (root (project-root (cdr proj))))
>>> +        (project--add-dir root)
>>> +        root))))
>>
>> I think in the (equal pr-dir dir-choice) case we want to add the
>> directory name entered by the user into the "history" anyway, don't
>> we?
> 
> Mmmmaybe?  That would change behavior - currently transient projects
> don't go into the project--list, and with that change they would.  Do
> you think they should?

Hmm, maybe not. Anyway, that sentence was supposed to lead into the next 
paragraph anyway.

> I personally never use transient projects so I don't really know how
> they should behave.
> 
>> Though perhaps there's no need to do it here: 'project-current' calls
>> 'project-remember-project' anyway when maybe-prompt is non-nil.
>>
>> So what happens if you drop both of the above 'project--add-dir' calls?
> 
> project-prompter is also called from project-switch-project, which
> doesn't call project-remember-project but should also update the history
> IMO.

I suppose project-switch-project could add a project-remember-project 
call as well?

It's just that until recently it only supported project-related 
commands, and those would invoke (project-current t) right away -- 
adding the just-selected root into the list.




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

Previous Next


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