GNU bug report logs -
#67310
[PATCH] Include the project--list as history when prompting for a project
Previous Next
Full log
Message #35 received at 67310 <at> debbugs.gnu.org (full text, mbox):
On 23/11/2023 01:14, Spencer Baugh wrote:
> @@ -1769,27 +1778,40 @@ project-prompt-project-dir
> ;; completion style).
> (project--file-completion-table
> (append project--list `(,dir-choice))))
> + (project--dir-history project--list)
> (pr-dir ""))
> (while (equal pr-dir "")
> ;; If the user simply pressed RET, do this again until they don't.
> - (setq pr-dir (completing-read "Select project: " choices nil t)))
> + (setq pr-dir
> + (let ((history-add-new-input nil))
> + (completing-read "Select project: " choices nil t nil 'project--dir-history))))
> (if (equal pr-dir dir-choice)
> (read-directory-name "Select directory: " default-directory nil t)
> + (let q((history-delete-duplicates t)
^
typo
> + (history-length t))
> + (add-to-history 'project--list pr-dir))
> pr-dir)))
Sorry, I thought we agreed that project-prompt-project-dir and
project-prompt-project-name shouldn't add-to-history?
Because project-current calls project-remember-project already
(including the cases when the prompter isn't used: when the project is
auto-detected). And to cover the remaining cases, we can have
project-switch-project call project-remember-project as well.
This way also we keep the project-prompter implementations with less
logic inside, meaning it's a bit easier to write the next one.
More DRY, too. At least while there's no other code using
project-prompter directly (but then we could add a helper).
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.