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 #141 received at 41821 <at> debbugs.gnu.org (full text, mbox):
>> So analogously, vc.el is one of back-ends of project.el, so in vc.el
>> there should be such line for using project functions:
>> (require 'project)
>
> Not really.
>
> project-vc (which is the project backend) resides in project.el.
>
> It calls to some VC functions, but VC itself needs no awareness of
> project.el.
I see that project.el calls some functions from preloaded vc-hooks.el
and some autoloaded functions from vc.el.
According to this design, this feature should be implemented the same way.
In 'vc-root-diff' command:
(read-directory-name
"Directory for VC root-diff: " nil
(when (featurep 'project)
(project-vc-known-roots)))
Note the same prefix 'project-vc' for vc backend of project.el.
Then 'project-vc-known-roots' in project.el be like this:
(defun project-vc-known-roots ()
"Return a list of known vc roots."
(seq-filter #'project-try-vc (project-known-project-roots)))
Also every command that visits a directory in vc could register their dir
in the project list when project.el is loaded, for example:
(defun vc-dir (dir &optional backend)
...
(when (featurep 'project)
;; Add current vc project dir to project list
(let ((default-directory dir))
(project-current t)))
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.