1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

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).
This commit is contained in:
Dmitry Gutov 2022-11-23 04:16:23 +02:00
parent c69858b3f0
commit efe599df31

View file

@ -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