Skip to content

Commit 7637fd0

Browse files
committed
Revert "Use functions as format-spec substitutions when supported"
This reverts commit 77e8aa6. `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.
1 parent 6e7c07a commit 7637fd0

1 file changed

Lines changed: 7 additions & 16 deletions

File tree

lisp/transient.el

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4772,27 +4772,18 @@ as a button."
47724772
%k is formatted using `transient-format-key'.
47734773
%d is formatted using `transient-format-description'.
47744774
%v is formatted using `transient-format-value'."
4775-
(static-if (>= emacs-major-version 29)
4776-
(format-spec (oref obj format)
4777-
`((?k . ,(lambda () (transient-format-key obj)))
4778-
(?d . ,(lambda () (transient-format-description obj)))
4779-
(?v . ,(lambda () (transient-format-value obj)))))
4780-
(format-spec (oref obj format)
4781-
`((?k . ,(transient-format-key obj))
4782-
(?d . ,(transient-format-description obj))
4783-
(?v . ,(transient-format-value obj))))))
4775+
(format-spec (oref obj format)
4776+
`((?k . ,(transient-format-key obj))
4777+
(?d . ,(transient-format-description obj))
4778+
(?v . ,(transient-format-value obj)))))
47844779

47854780
(cl-defmethod transient-format ((obj transient-suffix))
47864781
"Return a string generated using OBJ's `format'.
47874782
%k is formatted using `transient-format-key'.
47884783
%d is formatted using `transient-format-description'."
4789-
(static-if (>= emacs-major-version 29)
4790-
(format-spec (oref obj format)
4791-
`((?k . ,(lambda () (transient-format-key obj)))
4792-
(?d . ,(lambda () (transient-format-description obj)))))
4793-
(format-spec (oref obj format)
4794-
`((?k . ,(transient-format-key obj))
4795-
(?d . ,(transient-format-description obj))))))
4784+
(format-spec (oref obj format)
4785+
`((?k . ,(transient-format-key obj))
4786+
(?d . ,(transient-format-description obj)))))
47964787

47974788
(cl-defgeneric transient-format-key (obj)
47984789
"Format OBJ's `key' for display and return the result.")

0 commit comments

Comments
 (0)