[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master aa486801704: Fix VC mode-line indication for registerd but ignore
From: |
Eli Zaretskii |
Subject: |
master aa486801704: Fix VC mode-line indication for registerd but ignored files |
Date: |
Fri, 1 Sep 2023 07:32:59 -0400 (EDT) |
branch: master
commit aa4868017043e60c0875e40e0a67ac1365a477b0
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
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.
---
doc/emacs/maintaining.texi | 7 ++++---
lisp/vc/vc-hooks.el | 9 +++++++++
2 files changed, 13 insertions(+), 3 deletions(-)
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master aa486801704: Fix VC mode-line indication for registerd but ignored files,
Eli Zaretskii <=