branch: externals/transient
commit 28491e1f8e8d7548a1aa126618d15a35d7bbc57b
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
Properly deal with stealth undefined command
If a valid but incomplete prefix sequence is followed by
an unbound key, then Emacs calls the `undefined' command
but does not set `this-command', `this-original-command'
or `real-this-command' accordingly. Instead they are nil.
Deal with this by adding a corresponding entry to
`transient-predicate-map', replacing the old kludge
we used when we didn't know what was going on yet.
---
lisp/transient.el | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index 6897811b5a..1b27637b67 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1554,6 +1554,11 @@ to `transient-predicate-map'. Also see
`transient-base-map'.")
(define-key map [transient-forward-button] #'transient--do-move)
(define-key map [transient-isearch-backward] #'transient--do-move)
(define-key map [transient-isearch-forward] #'transient--do-move)
+ ;; If a valid but incomplete prefix sequence is followed by
+ ;; an unbound key, then Emacs calls the `undefined' command
+ ;; but does not set `this-command', `this-original-command'
+ ;; or `real-this-command' accordingly. Instead they are nil.
+ (define-key map [nil] #'transient--do-warn)
map)
"Base keymap used to map common commands to their transient behavior.
@@ -2029,11 +2034,6 @@ value. Otherwise return CHILDREN as is."
(defun transient--post-command ()
(transient--debug 'post-command)
- (unless this-command
- (transient--debug "-- force pre-exit from post-command")
- (message "Quit transient!")
- (transient--pre-exit)
- (setq transient--exitp t))
(if transient--exitp
(progn
(unless (and (eq transient--exitp 'replace)