summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2024-01-14 18:22:36 +0100
committerJonas Bernoulli <jonas@bernoul.li>2024-01-14 18:22:36 +0100
commitf582a9bc4d3ff839a95c8b68d12fefb6397be4ec (patch)
treeec52c96731fbfa46995e2cb4350e92c1f7ab9ea0
parent5b334a51bfcf353d9a85922acd10df932c6db87b (diff)
transient--get-face: Make suffix object available to face function
-rw-r--r--lisp/transient.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/transient.el b/lisp/transient.el
index 1e8819d..ff17c51 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1479,7 +1479,8 @@ drawing in the transient buffer.")
(defvar transient--pending-suffix nil
"The suffix that is currently being processed.
-This is bound while the suffix predicate is being evaluated.")
+This is bound while the suffix predicate is being evaluated,
+and while functions that return faces are being evaluated.")
(defvar transient--pending-group nil
"The group that is currently being processed.
@@ -3920,7 +3921,10 @@ If the OBJ's `key' is currently unreachable, then apply the face
(face (slot-value obj slot)))
(if (and (not (facep face))
(functionp face))
- (funcall face)
+ (let ((transient--pending-suffix obj))
+ (if (= (car (func-arity face)) 1)
+ (funcall face obj)
+ (funcall face)))
face)))
(defun transient--key-face (&optional cmd enforce-type)