[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 48238bf580 236/366: Allow invoking arbitrary
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient 48238bf580 236/366: Allow invoking arbitrary prefixes as non-suffixes |
Date: |
Tue, 25 Jan 2022 18:54:44 -0500 (EST) |
branch: externals/transient
commit 48238bf580c0a3e8ea05ffc5ee86eb104404ea3b
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Allow invoking arbitrary prefixes as non-suffixes
When a prefix is explicitly added as a suffix of another "outer"
prefix, then the `transient--do-replace' pre-command function is
added to the predicate map by `transient--make-predicate-map',
which is aware that this is a sub-prefix.
When the "outer" prefix allows arbitrary non-suffix commands to
be invoked while it is active, by setting `transient-non-suffix'
to `transient--do-stay' or `transient--do-call', then there is no
opportunity to configure another predicate for commands that happen
to be prefixes.
This results in a pre-command being called that is not appropriate
for a sub-prefix command because it fails to clean up after the
"outer" prefix command. In particular it fails to remove the active
transient keymaps before adding new keymaps of the new prefix.
That causes them to stick around forever. The redisplay keymap ends
up consume certain key events, such as "C-x", without unreading them
again so that the real bindings can be looked up.
We deal with this by teaching the code that sets up a prefix to check
whether a transient keymap (`transient--transient-map') is still in
effect and if so to take this as a sign that the above is what has
happened and to clean up accordingly.
---
lisp/transient.el | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lisp/transient.el b/lisp/transient.el
index 592ae654a4..51106e7e30 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1633,6 +1633,12 @@ EDIT may be non-nil."
(transient--pop-keymap 'transient--redisplay-map)
(setq name (oref transient--prefix command))
(setq params (list :scope (oref transient--prefix scope))))
+ (transient--transient-map
+ ;; Invoked as a ":transient-non-suffix 'transient--do-{stay,call}"
+ ;; of an outer prefix. Unlike the usual `transient--do-replace',
+ ;; these predicates fail to clean up after the outer prefix.
+ (transient--pop-keymap 'transient--transient-map)
+ (transient--pop-keymap 'transient--redisplay-map))
((not (or layout ; resuming parent/suspended prefix
transient-current-command)) ; entering child prefix
(transient--stack-zap)) ; replace suspended prefix, if any
- [elpa] externals/transient 1cdadfddf8 340/366: manual: Use source block, (continued)
- [elpa] externals/transient 1cdadfddf8 340/366: manual: Use source block, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient c2875e705a 362/366: transient--delay-post-command: Add debug statement, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient e0b57679f7 359/366: transient--debug: Re-align output, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 73694be44a 179/366: transient-infix-read: Support use by regular commands, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient e2fee19879 204/366: Support using variables in group and suffix specifications, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 9b17afb9a0 214/366: transient-infix-set: Remove outdated claim from doc-string, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient cbc078d84c 215/366: transient--with-emergency-exit: Re-signal errors directly, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient d555d26004 221/366: transient-format-description(lisp-variable): Return string, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 9a1d62699f 222/366: transient-force-fixed-pitch: Fix doc-string, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient d85eb790e8 235/366: transient-read-directory: Pass read value through file-local-name, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 48238bf580 236/366: Allow invoking arbitrary prefixes as non-suffixes,
Jonas Bernoulli <=
- [elpa] externals/transient a3b442243b 241/366: transient-read-{, existing-}file: New functions, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient c4bf4af655 020/366: transient--show-manpage: Fix jumping to argument, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient e4ffb97a68 018/366: transient--layout-member: Match indirect key bindings, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 2d8ceff408 185/366: transient-setup: Add emergency exit, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 601ebf5547 262/366: Quote value of slots' :initform when defining classes, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient b526b9c735 281/366: transient-infix-set: Consider all incompatibility rules, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 459e28e28a 311/366: Add lisp-imenu-generic-expression entry, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 1a1ae03600 324/366: Remove transient--pre-command later, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient e90f7a165e 335/366: Add support for returning from a sub-prefix to the parent prefix, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 8b1f8dcc51 354/366: transient--minibuffer-depth: Must always be a number, Jonas Bernoulli, 2022/01/25