summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2023-11-12 10:23:48 +0100
committerJonas Bernoulli <jonas@bernoul.li>2023-11-12 10:23:48 +0100
commit3cd1de1695084df089cc90cff89b32dfd6ca5a0a (patch)
tree06dcf6fb0549ed44066ed41b77a0c85d3e01823d
parentd44c4fce39921436ab94372e5b30318e936ceae4 (diff)
Make shadowed buffer current around forge-format{,-description}
-rw-r--r--lisp/transient.el23
1 files changed, 12 insertions, 11 deletions
diff --git a/lisp/transient.el b/lisp/transient.el
index afba620..f71f3e9 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -3503,7 +3503,8 @@ have a history of their own.")
(cl-defmethod transient--insert-group :around ((group transient-group))
"Insert GROUP's description, if any."
- (when-let ((desc (transient-format-description group)))
+ (when-let ((desc (transient-with-shadowed-buffer
+ (transient-format-description group))))
(insert desc ?\n))
(let ((transient--max-group-level
(max (oref group level) transient--max-group-level))
@@ -3513,14 +3514,14 @@ have a history of their own.")
(cl-defmethod transient--insert-group ((group transient-row))
(transient--maybe-pad-keys group)
(dolist (suffix (oref group suffixes))
- (insert (transient-format suffix))
+ (insert (transient-with-shadowed-buffer (transient-format suffix)))
(insert " "))
(insert ?\n))
(cl-defmethod transient--insert-group ((group transient-column))
(transient--maybe-pad-keys group)
(dolist (suffix (oref group suffixes))
- (let ((str (transient-format suffix)))
+ (let ((str (transient-with-shadowed-buffer (transient-format suffix))))
(insert str)
(unless (string-match-p ".\n\\'" str)
(insert ?\n)))))
@@ -3530,10 +3531,11 @@ have a history of their own.")
(mapcar
(lambda (column)
(transient--maybe-pad-keys column group)
- (let ((rows (mapcar #'transient-format (oref column suffixes))))
- (when-let ((desc (transient-format-description column)))
- (push desc rows))
- (flatten-tree rows)))
+ (transient-with-shadowed-buffer
+ (let ((rows (mapcar #'transient-format (oref column suffixes))))
+ (when-let ((desc (transient-format-description column)))
+ (push desc rows))
+ (flatten-tree rows))))
(oref group suffixes)))
(vp (or (oref transient--prefix variable-pitch)
transient-align-variable-pitch))
@@ -3725,10 +3727,9 @@ called inside the correct buffer (see `transient--insert-group')
and its value is returned to the caller."
(and-let* ((desc (oref obj description))
(desc (if (functionp desc)
- (transient-with-shadowed-buffer
- (if (= (car (func-arity desc)) 1)
- (funcall desc obj)
- (funcall desc)))
+ (if (= (car (func-arity desc)) 1)
+ (funcall desc obj)
+ (funcall desc))
desc)))
(if-let* ((face (transient--get-face obj 'face)))
(transient--add-face desc face t)