]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix VC mode-line indication for registerd but ignored files
authorEli Zaretskii <eliz@gnu.org>
Fri, 1 Sep 2023 11:31:35 +0000 (14:31 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 1 Sep 2023 11:31:35 +0000 (14:31 +0300)
* 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.

doc/emacs/maintaining.texi
lisp/vc/vc-hooks.el

index 2dad70d3d1379e9c51e650d762e7fdbb3ffe51de..2785ccb510975d7046df89607459e537e37e8349 100644 (file)
@@ -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
index e75165ea2e9feda2ddba0914dccbd09de9aeaef0..a4de0a6e791f9084b66914d01ed363623496852b 100644 (file)
   "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