[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 8098d17518 13/41: transient--make-predicate-m
|
From: |
Jonas Bernoulli |
|
Subject: |
[elpa] externals/transient 8098d17518 13/41: transient--make-predicate-map: Fix handling of transient-suffix |
|
Date: |
Sun, 12 Nov 2023 20:04:08 -0500 (EST) |
branch: externals/transient
commit 8098d175189b2f0f4c9057548d7cab24ca558dc4
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
transient--make-predicate-map: Fix handling of transient-suffix
The value of the prefix's `transient-suffix' slot has to be handled
differently for different types of suffixes. It makes little sense
to use a predicate as value, and a boolean should be used instead.
In the past a predicate had to be used, so we have no choice but to
continue to support that, and for uniform suffixes it may still make
sense to use a predicate. Also substitute some known predicates based
on the suffix type.
- Infixes must disregard the default transient behavior specified
for all suffixes of the current prefix.
For a select few infixes a different behavior might make sense.
If so, then that must be specified for those infixes individually.
- Sub-prefixes must honor the default transient behavior specified for
all suffixes of the current outer prefix, but to do that they have
to use predicates different from those used for regular suffixes.
The default transient behavior is interpreted more restrictively than
the transient behavior explicitly specified for a single suffix, to
limit surprising behavior but still allow funky behavior if one really
wants that.
---
lisp/transient.el | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index df2b349e61..1e83c33eef 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1782,9 +1782,14 @@ of the corresponding object."
((not (lookup-key transient-predicate-map (vector cmd)))
(define-key map (vector cmd)
(pcase (list kind default)
+ (`(prefix ,(or 'transient--do-stay 'transient--do-call))
+ #'transient--do-recurse)
+ ('(prefix t) #'transient--do-recurse)
(`(prefix ,_) #'transient--do-replace)
- (`(,_ nil) #'transient--do-exit)
- (`(,_ ,do) do)))))))
+ (`(infix ,_) #'transient--do-stay)
+ ('(suffix t) #'transient--do-call)
+ ('(suffix nil) #'transient--do-exit)
+ (`(suffix ,do) do)))))))
map))
(defun transient--make-redisplay-map ()
- [elpa] externals/transient updated (a8829875b2 -> 3cd1de1695), Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient f769486803 02/41: Tweak some docstrings, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 59d602a2e8 05/41: transient--refreshp: New variable, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 92572454b5 06/41: transient-toggle-level-limit: New command, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 8098d17518 13/41: transient--make-predicate-map: Fix handling of transient-suffix,
Jonas Bernoulli <=
- [elpa] externals/transient 10d590dc55 07/41: transient-echo-arguments: Also echo command keys, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient f43aee1a5e 08/41: transient--suffix-prototype: New function, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 9a7eb0d9a3 09/41: transient--make-predicate-map: Use define-key exclusively, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 67671e1ac0 12/41: transient--make-predicate-map: Rearrange pcase cases, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 5e841bb24b 19/41: transient-infix-set(argument): Replace :around with :after method, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient c6e3891537 21/41: transient-infix-set(argument): Cosmetics, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 425003a44b 22/41: transient-infix-set(argument): Limit to other arguments, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 8d8df0f038 20/41: transient-infix-set(argument): Cosmetics, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 9d9e931996 25/41: transient--shadowed-buffer: Renamed from transient--current-buffer, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 8e15a29b59 31/41: transient-format-description: Support function as value of face slot, Jonas Bernoulli, 2023/11/12