* lisp/vc/vc-hooks.el (vc-default-mode-line-string): Use it.
* lisp/vc/vc-git.el (vc-git-mode-line-string): Use it.
* lisp/vc/vc-hg.el (vc-hg-mode-line-string): Use it.
switches for shortlogs, such as the one produced by 'C-x v L'.
'vc-git-log-switches' is no longer used for shortlogs.
+---
+*** New value 'no-backend' for user option 'vc-display-status'.
+With this value only the revision number is displayed on the mode-line.
+
---
*** Obsolete command 'vc-switch-backend' re-added as 'vc-change-backend'.
The command was previously obsoleted and unbound in Emacs 28.
(rev (vc-working-revision file 'Git))
(disp-rev (or (vc-git--symbolic-ref file)
(and rev (substring rev 0 7))))
- (state-string (concat backend-name indicator disp-rev)))
+ (state-string (concat (unless (eq vc-display-status 'no-backend)
+ backend-name)
+ indicator disp-rev)))
(propertize state-string 'face face 'help-echo
(concat state-echo " under the " backend-name
" version control system"
(and vc-hg-use-file-version-for-mode-line-version
truename)))))
(rev (or rev "???"))
- (state-string (concat backend-name indicator rev)))
+ (state-string (concat (unless (eq vc-display-status 'no-backend)
+ backend-name)
+ indicator rev)))
(propertize state-string 'face face 'help-echo
(concat state-echo " under the " backend-name
" version control system"))))
(defcustom vc-display-status t
"If non-nil, display revision number and lock status in mode line.
-Otherwise, not displayed."
- :type 'boolean
+If nil, only the backend name is displayed. When the value
+is `no-backend', then no backend name is displayed before the
+revision number and lock status."
+ :type '(choice (const :tag "Show only revision/status" no-backend)
+ (const :tag "Show backend and revision/status" t)
+ (const :tag "Show only backend name" nil))
:group 'vc)
(rev (vc-working-revision file backend))
(`(,state-echo ,face ,indicator)
(vc-mode-line-state state))
- (state-string (concat backend-name indicator rev)))
+ (state-string (concat (unless (eq vc-display-status 'no-backend)
+ backend-name)
+ indicator rev)))
(propertize state-string 'face face 'help-echo
(concat state-echo " under the " backend-name
" version control system"))))