Function: vc-mode-line-state
vc-mode-line-state is a byte-compiled function defined in
vc-hooks.el.gz.
Signature
(vc-mode-line-state STATE)
Documentation
Return a list of data to display on the mode line.
The argument STATE should contain the version control state returned
from vc-state. The returned list includes three elements: the echo
string, the face name, and the indicator that usually is one character.
Source Code
;; Defined in /usr/src/emacs/lisp/vc/vc-hooks.el.gz
(defun vc-mode-line-state (state)
"Return a list of data to display on the mode line.
The argument STATE should contain the version control state returned
from `vc-state'. The returned list includes three elements: the echo
string, the face name, and the indicator that usually is one character."
(let (state-echo face indicator)
(cond ((or (eq state 'up-to-date)
(eq state 'needs-update))
(setq state-echo "Up to date file")
(setq face 'vc-up-to-date-state)
(setq indicator "-"))
((stringp state)
(setq state-echo (concat "File locked by" state))
(setq face 'vc-locked-state)
(setq indicator (concat ":" state ":")))
((eq state 'added)
(setq state-echo "Locally added file")
(setq face 'vc-locally-added-state)
(setq indicator "@"))
((eq state 'conflict)
(setq state-echo "File contains conflicts after the last merge")
(setq face 'vc-conflict-state)
(setq indicator "!"))
((eq state 'removed)
(setq state-echo "File removed from the VC system")
(setq face 'vc-removed-state)
(setq indicator "!"))
((eq state 'missing)
(setq state-echo "File tracked by the VC system, but missing from the file system")
(setq face 'vc-missing-state)
(setq indicator "?"))
((eq state 'ignored)
(setq state-echo "File tracked by the VC system, but ignored")
(setq face 'vc-ignored-state)
(setq indicator "!"))
(t
;; Not just for the 'edited state, but also a fallback
;; for all other states. Think about different symbols
;; for 'needs-update and 'needs-merge.
(setq state-echo "Locally modified file")
(setq face 'vc-edited-state)
(setq indicator ":")))
(list state-echo face indicator)))