emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/transient 0509c90e53 11/26: transient--key-face: New fu


From: Jonas Bernoulli
Subject: [elpa] externals/transient 0509c90e53 11/26: transient--key-face: New function
Date: Sun, 26 Nov 2023 19:42:03 -0500 (EST)

branch: externals/transient
commit 0509c90e5363ebc51b91cc9ebe1a7d7dab93b632
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    transient--key-face: New function
    
    Replacing `transient--colorize-key'.
---
 lisp/transient.el | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index b9cdbb29bf..ccc7c5befa 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -3742,22 +3742,16 @@ When `transient-enable-popup-navigation' is non-nil 
then format
                 (setq suf (string-replace " " "" suf)))
               (concat (propertize pre 'face 'transient-unreachable-key)
                       (and (string-prefix-p (concat pre " ") key) " ")
-                      (transient--colorize-key suf cmd)
+                      (propertize suf 'face (transient--key-face cmd))
                       (save-excursion
                         (and (string-match " +\\'" key)
                              (propertize (match-string 0 key)
                                          'face 'fixed-pitch))))))
            ((transient--lookup-key transient-sticky-map (kbd key))
-            (transient--colorize-key key cmd))
+            (propertize key 'face (transient--key-face cmd)))
            (t
             (propertize key 'face 'transient-unreachable-key))))
-      (transient--colorize-key key cmd))))
-
-(defun transient--colorize-key (key command)
-  (propertize key 'face
-              (or (and (transient--semantic-coloring-p)
-                       (transient--suffix-color command))
-                  'transient-key)))
+      (propertize key 'face (transient--key-face cmd)))))
 
 (cl-defmethod transient-format-key :around ((obj transient-argument))
   "Handle `transient-highlight-mismatched-keys'."
@@ -3875,6 +3869,11 @@ If the OBJ's `key' is currently unreachable, then apply 
the face
         (funcall face)
       face)))
 
+(defun transient--key-face (&optional cmd)
+  (or (and (transient--semantic-coloring-p)
+           (transient--suffix-color cmd))
+      'transient-key))
+
 (defun transient--key-unreachable-p (obj)
   (and transient--redisplay-key
        (let ((key (oref obj key)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]