* lisp/vc/vc-hooks.el (vc-display-status): New value 'no-backend' (bug#66464).
* 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.
This commit is contained in:
parent
ece62f5c1c
commit
b3d57d4397
4 changed files with 19 additions and 5 deletions
4
etc/NEWS
4
etc/NEWS
|
@ -392,6 +392,10 @@ This is a string or a list of strings that specifies the Git log
|
|||
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.
|
||||
|
|
|
@ -423,7 +423,9 @@ in the order given by `git status'."
|
|||
(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"
|
||||
|
|
|
@ -365,7 +365,9 @@ specific file to query."
|
|||
(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"))))
|
||||
|
|
|
@ -152,8 +152,12 @@ visited and a warning displayed."
|
|||
|
||||
(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)
|
||||
|
||||
|
||||
|
@ -766,7 +770,9 @@ This function assumes that the file is registered."
|
|||
(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"))))
|
||||
|
|
Loading…
Add table
Reference in a new issue