emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master efe599df31: Add a way to override project name for project-vc bac


From: Dmitry Gutov
Subject: master efe599df31: Add a way to override project name for project-vc backend
Date: Tue, 22 Nov 2022 21:17:35 -0500 (EST)

branch: master
commit efe599df3127bea4c6251ce20513945fdd947c26
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    Add a way to override project name for project-vc backend
    
    * lisp/progmodes/project.el (project-vc-name): New user option.
    (project-name): Override for VC project backend (bug#48747).
---
 lisp/progmodes/project.el | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 751e240a56..c7b2c386cc 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -395,6 +395,15 @@ you might have to restart Emacs to see the effect."
   :version "29.1"
   :safe #'booleanp)
 
+(defcustom project-vc-name nil
+  "When non-nil, the name of the current VC project.
+
+The best way to change the value a VC project reports as its
+name, is by setting this in .dir-locals.el."
+  :type 'string
+  :version "29.1"
+  :safe #'stringp)
+
 ;; FIXME: Using the current approach, major modes are supposed to set
 ;; this variable to a buffer-local value.  So we don't have access to
 ;; the "external roots" of language A from buffers of language B, which
@@ -694,6 +703,10 @@ DIRS must contain directory names."
         (push buf bufs)))
     (nreverse bufs)))
 
+(cl-defmethod project-name ((_project (head vc)))
+  (or project-vc-name
+      (cl-call-next-method)))
+
 
 ;;; Project commands
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]