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

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

[elpa] externals/transient 222c2bfbeb 38/41: transient--get-face: New fu


From: Jonas Bernoulli
Subject: [elpa] externals/transient 222c2bfbeb 38/41: transient--get-face: New function
Date: Sun, 12 Nov 2023 20:04:10 -0500 (EST)

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

    transient--get-face: New function
---
 lisp/transient.el | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 061d90d63e..45d233bd77 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -3730,8 +3730,7 @@ and its value is returned to the caller."
                              (funcall desc obj)
                            (funcall desc)))
                      desc)))
-    (if-let* ((face (and (slot-exists-p obj 'face) (oref obj face)))
-              (face (if (functionp face) (funcall face) face)))
+    (if-let* ((face (transient--get-face obj 'face)))
         (transient--add-face desc face t)
       desc)))
 
@@ -3809,6 +3808,14 @@ If the OBJ's `key' is currently unreachable, then apply 
the face
               choices
               (propertize "|" 'face 'transient-delimiter))))))
 
+(defun transient--get-face (obj slot)
+  (and-let* ((! (slot-exists-p obj slot))
+             (! (slot-boundp   obj slot))
+             (face (slot-value obj slot)))
+    (if (functionp face)
+        (funcall face)
+      face)))
+
 (defun transient--add-face (string face &optional append beg end)
   (let ((str (copy-sequence string)))
     (add-face-text-property (or beg 0) (or end (length str)) face append str)



reply via email to

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