branch: externals/vc-jj
commit 96a182aca8f313c4ac38d97cfc2128c5bcdaad0a
Author: Kristoffer Balintona <[email protected]>
Commit: Kristoffer Balintona <[email protected]>

    feat: Make fontification of Log View buffer fancier
    
    Several improvements to `vc-jj-log-view-mode` buffers have been made.
    The end result is a style that mimics the default appearance of "jj
    log":
    - Conflict indicators are now fontified.
    - A new face, `vc-jj-log-view-commit`, has been defined. Commit IDs
      now use this face. The default is meant to look less noticeable than
      the change ID but more noticeable than regular text.
    - A new face, `vc-jj-log-view-bookmark` has been defined. Bookmark
      names now use this face. The default is meant to look more
      noticeable than change IDs.
---
 NEWS.org |  6 ++++++
 vc-jj.el | 26 +++++++++++++++++---------
 2 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index 6782346486..a9baa58960 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -10,6 +10,12 @@
   repository to be co-located since we call =vc-git-region-history=, but
   repositories are co-located by default since jujutsu 0.34.
 - Added =vc-jj-clone=, making it possible to run =vc-clone=.
+- Define a new face: =vc-jj-log-view-commit=. This is the face used for commit 
IDs in JJ Log View buffers.
+- Define a new face: =vc-jj-log-view-bookmark=. This is the face used for 
bookmark names in JJ Log View buffers.
+- In the JJ Log View buffer:
+  - Fontify conflict indicators (=vc-conflict-state=)
+  - Fontify commit IDs (=vc-jj-log-view-commit=)
+  - Fontify bookmark names (=vc-jj-log-view-bookmark=)
 
 *** Changed
 
diff --git a/vc-jj.el b/vc-jj.el
index 41469da744..603e193982 100644
--- a/vc-jj.el
+++ b/vc-jj.el
@@ -113,6 +113,14 @@ If nil, use the value of `vc-diff-switches'.  If t, use no 
switches."
                 (string :tag "Argument String")
                 (repeat :tag "Argument List" :value ("") string)))
 
+(defface vc-jj-log-view-commit
+  '((t :weight light :inherit (shadow italic)))
+  "Face for commit IDs in `vc-jj-log-view-mode' buffers.")
+
+(defface vc-jj-log-view-bookmark
+  '((t :weight bold :inherit log-view-message))
+  "Face for bookmark names in `vc-jj-log-view-mode' buffers.")
+
 ;;; Internal Utilities
 
 ;; Note that 'JJ' should come before 'Git' in `vc-handled-backends',
@@ -708,10 +716,9 @@ if(root,
       (+ (any hex)))
     " "
     ;; special states
-    (? (group (or (: "(empty) ")
-                "")))
-    (? (group (or (: "(no description set)" (* nonl))
-                "")))
+    (group (opt "conflict "))
+    (group (opt "(empty) "))
+    (group (opt "(no description set)"))
     ;; regular description
     (* nonl)
     line-end)
@@ -853,11 +860,12 @@ delete."
                  (3 'change-log-list)
                  (4 'change-log-name)
                  (5 'change-log-date)
-                 (6 'change-log-file)
-                 (7 'change-log-list)
-                 (8 'change-log-function)
-                 (9 'change-log-function))))
-  
+                 (6 'vc-jj-log-view-bookmark)
+                 (7 'vc-jj-log-view-commit)
+                 (8 'vc-conflict-state)
+                 (9 'change-log-function)
+                 (10 'change-log-function))))
+
   (keymap-set vc-jj-log-view-mode-map "r" #'vc-jj-log-view-edit-change)
   (keymap-set vc-jj-log-view-mode-map "x" #'vc-jj-log-view-abandon-change)
   (keymap-set vc-jj-log-view-mode-map "i" #'vc-jj-log-view-new-change)

Reply via email to