branch: externals/transient
commit 7637fd025d2f7f34ec83db2180ae50a8e4ef5ed8
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    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.
---
 lisp/transient.el | 23 +++++++----------------
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 0122a8be38..b4c8f3a63e 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.")

Reply via email to