diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2023-11-12 10:23:48 +0100 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2023-11-12 10:23:48 +0100 |
| commit | 3cd1de1695084df089cc90cff89b32dfd6ca5a0a (patch) | |
| tree | 06dcf6fb0549ed44066ed41b77a0c85d3e01823d | |
| parent | d44c4fce39921436ab94372e5b30318e936ceae4 (diff) | |
Make shadowed buffer current around forge-format{,-description}
| -rw-r--r-- | lisp/transient.el | 23 |
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) |
