summaryrefslogtreecommitdiff
path: root/lisp/transient.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/transient.el')
-rw-r--r--lisp/transient.el17
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/transient.el b/lisp/transient.el
index 96e711e950c..4affc414fa6 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2516,17 +2516,22 @@ prefix argument and pivot to `transient-update'."
(defun transient--invalid (msg)
(ding)
- (message "%s: `%s' (Use `%s' to abort, `%s' for help) [%s]"
+ (message "%s: `%s' (Use `%s' to abort, `%s' for help)%s"
msg
(propertize (key-description (this-single-command-keys))
'face 'font-lock-warning-face)
(propertize "C-g" 'face 'transient-key)
(propertize "?" 'face 'transient-key)
- ;; `this-command' is `transient--undefined' or similar at this
- ;; point. Show the command the user actually tried to invoke.
- (propertize (symbol-name (transient--suffix-symbol
- this-original-command))
- 'face 'font-lock-warning-face))
+ ;; `this-command' is `transient-undefined' or `transient-inapt'.
+ ;; Show the command (`this-original-command') the user actually
+ ;; tried to invoke. For an anonymous inapt command that is a
+ ;; lambda expression, which cannot be mapped to a symbol, so
+ ;; forgo displaying the command.
+ (if-let ((cmd (ignore-errors
+ (symbol-name (transient--suffix-symbol
+ this-original-command)))))
+ (format " [%s]" (propertize cmd 'face 'font-lock-warning-face))
+ ""))
(unless (and transient--transient-map
(memq transient--transient-map overriding-terminal-local-map))
(let ((transient--prefix (or transient--prefix 'sic)))