branch: externals/transient
commit 56f9bb96b9e376ed1c80676c9898f15b70e0d1f0
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    transient-prompt(infix): Support non-string arguments and variables
---
 lisp/transient.el | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 028dc90441..b7359c5f0f 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -3865,15 +3865,14 @@ prompt."
                       prompt)))
         (if (stringp prompt)
             prompt
-          "(BUG: no prompt): "))
-    (or (and-let* ((arg (and (slot-boundp obj 'argument) (oref obj argument))))
-          (if (and (stringp arg) (string-suffix-p "=" arg))
-              arg
-            (concat arg ": ")))
-        (and-let* ((var (and (slot-boundp obj 'variable) (oref obj variable))))
-          (and (stringp var)
-               (concat var ": ")))
-        "(BUG: no prompt): ")))
+          "[BUG: invalid prompt]: "))
+    (if-let* ((name (or (and (slot-boundp obj 'argument) (oref obj argument))
+                        (and (slot-boundp obj 'variable) (oref obj 
variable)))))
+        (if (and (stringp name)
+                 (string-suffix-p "=" name))
+            name
+          (format "%s: " name))
+      "[BUG: no prompt]: ")))
 
 ;;;; Set
 

Reply via email to