GNU bug report logs - #41821
28.0.50; read-directory-name in vc commands should provide defaults from projects

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 41821 <at> debbugs.gnu.org
Subject: bug#41821: 28.0.50; read-directory-name in vc commands should provide defaults from projects
Date: Fri, 19 Jun 2020 02:28:17 +0300
[Message part 1 (text/plain, inline)]
>> For example, typing 'C-x v L' (vc-print-root-log) outside of a project
>> displays the minibuffer with the prompt "Directory for VC revision log: ".
>> It should provide a list of the default values from the project list
>> saved in ~/.emacs.d/projects
>
> Note that one would have to verify that each directory in the list is
> a part of a VC repository.

Maybe something like:

[project-vc-list.patch (text/x-diff, inline)]
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 7a41df614b..fcba4136b0 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -897,6 +897,12 @@ project-prompt-project-dir
         (read-directory-name "Select directory: " default-directory nil t)
       pr-dir)))
 
+;;;###autoload
+(defun project-vc-list ()
+  "Return a list of VC-based projects."
+  (project--ensure-read-project-list)
+  (seq-filter #'project-try-vc (mapcar #'car project--list)))
+
 
 ;;; Project switching
 
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 08b1a85c9b..a640067de1 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -2559,7 +2559,8 @@ vc-print-root-log
 	 rootdir)
     (if backend
 	(setq rootdir (vc-call-backend backend 'root default-directory))
-      (setq rootdir (read-directory-name "Directory for VC revision log: "))
+      (setq rootdir (read-directory-name "Directory for VC revision log: " nil
+                                         (project-vc-list)))
       (setq backend (vc-responsible-backend rootdir))
       (unless backend
         (error "Directory is not version controlled")))

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.