summaryrefslogtreecommitdiff
path: root/lisp/transient.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2026-02-28 20:28:25 +0100
committerJonas Bernoulli <jonas@bernoul.li>2026-02-28 20:28:25 +0100
commit7637fd025d2f7f34ec83db2180ae50a8e4ef5ed8 (patch)
treed7d2f655dc91f79d884359c7e4105d98a73d4e5f /lisp/transient.el
parent6e7c07a7f6363195707b2eee478fc4626211d5d7 (diff)
Revert "Use functions as format-spec substitutions when supported"
This reverts commit 77e8aa64e800327b523f0eb675223f63dce62fe5. `format-spec' makes a temporary buffer current for internal purposes. Sadly does not undo that, while evaluating the substitution functions. Our substitution functions expect to be called in the buffer, which was current before this function is called.
Diffstat (limited to 'lisp/transient.el')
-rw-r--r--lisp/transient.el23
1 files changed, 7 insertions, 16 deletions
diff --git a/lisp/transient.el b/lisp/transient.el
index 0122a8b..b4c8f3a 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -4772,27 +4772,18 @@ as a button."
%k is formatted using `transient-format-key'.
%d is formatted using `transient-format-description'.
%v is formatted using `transient-format-value'."
- (static-if (>= emacs-major-version 29)
- (format-spec (oref obj format)
- `((?k . ,(lambda () (transient-format-key obj)))
- (?d . ,(lambda () (transient-format-description obj)))
- (?v . ,(lambda () (transient-format-value obj)))))
- (format-spec (oref obj format)
- `((?k . ,(transient-format-key obj))
- (?d . ,(transient-format-description obj))
- (?v . ,(transient-format-value obj))))))
+ (format-spec (oref obj format)
+ `((?k . ,(transient-format-key obj))
+ (?d . ,(transient-format-description obj))
+ (?v . ,(transient-format-value obj)))))
(cl-defmethod transient-format ((obj transient-suffix))
"Return a string generated using OBJ's `format'.
%k is formatted using `transient-format-key'.
%d is formatted using `transient-format-description'."
- (static-if (>= emacs-major-version 29)
- (format-spec (oref obj format)
- `((?k . ,(lambda () (transient-format-key obj)))
- (?d . ,(lambda () (transient-format-description obj)))))
- (format-spec (oref obj format)
- `((?k . ,(transient-format-key obj))
- (?d . ,(transient-format-description obj))))))
+ (format-spec (oref obj format)
+ `((?k . ,(transient-format-key obj))
+ (?d . ,(transient-format-description obj)))))
(cl-defgeneric transient-format-key (obj)
"Format OBJ's `key' for display and return the result.")