branch: externals/transient
commit 4a36b1d92298ae9ee68a81375af2b445cb2917ba
Author: Psionik K <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
Interpret t and nil for sub-prefixes in define-transient-prefix
If a sub-prefix has :transient t, it should recurse (and its suffixes
return). Correspondingly, explicit :transient nil should replace.
---
lisp/transient.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index 1b1e53400a..22838d1f61 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1658,11 +1658,12 @@ of the corresponding object.")
(define-key map (vector sym)
(let ((do (oref obj transient)))
(pcase (list do sub-prefix)
- (`(t t) #'transient--do-replace)
+ (`(t t) #'transient--do-recurse)
(`(t nil) (if (cl-typep obj 'transient-infix)
#'transient--do-stay
#'transient--do-call))
- (`(nil ,_) #'transient--do-exit)
+ (`(nil t) #'transient--do-replace)
+ (`(nil nil) #'transient--do-exit)
(_ do)))))
((not (lookup-key transient-predicate-map (vector sym)))
(define-key map (vector sym)
@@ -2269,8 +2270,8 @@ If there is no parent prefix, then just call the command."
(let ((command (oref prefix-obj command)))
(when-let ((suffix-obj (transient-suffix-object command)))
(when (and (slot-boundp suffix-obj 'transient)
- (eq (oref suffix-obj transient)
- 'transient--do-recurse))
+ (memq (oref suffix-obj transient)
+ (list t #'transient--do-recurse)))
(oset prefix-obj transient-suffix 'transient--do-return))))))
(defun transient--do-replace ()