GNU bug report logs -
#41821
28.0.50; read-directory-name in vc commands should provide defaults from projects
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Thu, 11 Jun 2020 23:39:02 UTC
Severity: wishlist
Tags: fixed
Fixed in version 28.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #165 received at 41821 <at> debbugs.gnu.org (full text, mbox):
On 02.07.2020 01:10, Juri Linkov wrote:
>> we at least put this feature request on hold (and, for now,
>> revert the installed patches).
>
> Ok, reverted the installed patches.
>
> It's easy to achieve the same in the init file with these
> simple advises. Now this works perfectly from POV of users
> who prefer to use project directories everywhere in all prompts
> that ask for a directory:
>
> #+begin_src emacs-lisp
> ;; When a prompt of some commands such as 'rgrep' or 'vc-print-log' asks for
> ;; a directory name, allow 'M-n' to access the most recently used project
> ;; directories saved in ~/.emacs.d/projects:
>
> (advice-add 'read-directory-name :around
I figured you might want to define a vc-specific wrapper function for
read-directory-name, for ease of advising. But now I'm not so sure.
> (when (featurep 'project)
> ;; Update project list with selected project dir
> (let ((default-directory ret))
> (project-current t)))
The 't' argument is counter-productive here. You don't want it to
prompt, which will happen when the target directory is in the end
outside of any detected projects.
And really if you just do this in an ad-hoc advice (and recommend it to
other users), it's probably better to just remove this call for
simplicity. After all, you probably interact with "proper" project
commands anyway. And they will put the current project at the top of the
history.
This bug report was last modified 4 years and 319 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.