[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient d9b3a54128 5/8: transient--delay-post-command
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient d9b3a54128 5/8: transient--delay-post-command: Handle execute-extended-command |
Date: |
Wed, 11 May 2022 18:05:34 -0400 (EDT) |
branch: externals/transient
commit d9b3a54128065222d35ce4ba49cdb39e23a06d2f
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
transient--delay-post-command: Handle execute-extended-command
When using `execute-extended-command' to call another command that
also uses the minibuffer, then this hook function is never called
with `this-command' being `execute-extended-command' and the event
being non-nil, so this failed to resume the transient state.
`execute-extended-command' sets `this-command' and `real-this-command'
so we need to rely on a different signal to determine when to resume.
This function also changes the value returned by `this-command-keys'
in predictable fashion, so we can rely on that.
Not that we would want to do that anyway, but note that editing
`execute-extended-command' so that it does not set `this-command' and
`real-this-command' does not work. I was unable to determine where
that happens, but something else is setting these variable on behalf
of this command. Using a (renamed) copy of this command with only the
code that sets these variables removed, however succeeds.
---
lisp/transient.el | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index ebe6848dc2..d28eba6344 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2169,8 +2169,13 @@ value. Otherwise return CHILDREN as is."
(unless abort-only
(setq post-command
(lambda () "@transient--delay-post-command"
- (let ((act (and (eq this-command command)
- (not (eq (this-command-keys-vector) [])))))
+ (let ((act (and (not (eq (this-command-keys-vector) []))
+ (or (eq this-command command)
+ ;; `execute-extended-command' was
+ ;; used to call another command
+ ;; that also uses the minibuffer.
+ (equal (this-command-keys)
+ (format "\M-x%s\r" this-command))))))
(transient--debug 'post-command-hook "act: %s" act)
(when act
(remove-hook 'transient--post-command-hook post-command)
- [elpa] externals/transient updated (84f2d12ef3 -> 6fc09a663e), Jonas Bernoulli, 2022/05/11
- [elpa] externals/transient 7467a79c57 3/8: transient--suspend-override: Cancel display timer, Jonas Bernoulli, 2022/05/11
- [elpa] externals/transient 5686a792f6 4/8: transient--suspend-override: Cancel prefix key display, Jonas Bernoulli, 2022/05/11
- [elpa] externals/transient 09fdd454ff 2/8: transient-current-command: Fix docstring, Jonas Bernoulli, 2022/05/11
- [elpa] externals/transient d9b3a54128 5/8: transient--delay-post-command: Handle execute-extended-command,
Jonas Bernoulli <=
- [elpa] externals/transient 6fc09a663e 8/8: make: Run check-declare-directory, Jonas Bernoulli, 2022/05/11
- [elpa] externals/transient 8c62d0d223 1/8: Fix documentation typos, Jonas Bernoulli, 2022/05/11
- [elpa] externals/transient 1c84d7adb1 6/8: Remap kp-subtract, kp-equal and kp-add, Jonas Bernoulli, 2022/05/11
- [elpa] externals/transient bd0e5e85ab 7/8: Improve function declarations, Jonas Bernoulli, 2022/05/11