From: Eli Zaretskii Date: Fri, 1 Sep 2023 11:31:35 +0000 (+0300) Subject: Fix VC mode-line indication for registerd but ignored files X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=aa4868017043e60c0875e40e0a67ac1365a477b0;p=emacs.git Fix VC mode-line indication for registerd but ignored files * lisp/vc/vc-hooks.el (vc-ignored-state): New face. (vc-default-mode-line-string): Add special indication and tooltip for files that are registered, but also ignored. See https://lists.gnu.org/archive/html/emacs-devel/2023-09/msg00006.html for the details of the use case. * doc/emacs/maintaining.texi (VC Mode Line): Mention the additional meaning of '!' in the VC status mode-line display. --- diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 2dad70d3d13..2785ccb5109 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -447,9 +447,10 @@ merge-based version control system, a @samp{-} character indicates that the work file is unmodified, and @samp{:} indicates that it has been modified. @samp{!} indicates that the file contains conflicts as result of a recent merge operation (@pxref{Merging}), or that the file -was removed from the version control. Finally, @samp{?} means that -the file is under version control, but is missing from the working -tree. +was removed from the version control, or that it is versioned but also +@dfn{ignored}, something that usually should not happen (@pxref{VC +Ignore}). Finally, @samp{?} means that the file is under version +control, but is missing from the working tree. In a lock-based system, @samp{-} indicates an unlocked file, and @samp{:} a locked file; if the file is locked by another user (for diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index e75165ea2e9..a4de0a6e791 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -87,6 +87,11 @@ "Face for VC modeline state when the file is edited." :version "25.1") +(defface vc-ignored-state + '((default :inherit vc-state-base)) + "Face for VC modeline state when the file is registered, but ignored." + :version "30.1") + ;; Customization Variables (the rest is in vc.el) (defcustom vc-ignore-dir-regexp @@ -743,6 +748,10 @@ This function assumes that the file is registered." (setq state-echo "File tracked by the VC system, but missing from the file system") (setq face 'vc-missing-state) (concat backend-name "?" rev)) + ((eq state 'ignored) + (setq state-echo "File tracked by the VC system, but ignored") + (setq face 'vc-ignored-state) + (concat backend-name "!" rev)) (t ;; Not just for the 'edited state, but also a fallback ;; for all other states. Think about different symbols