branch: externals/transient commit 45de8e46f066eab3160f62cbcc76859022c9c1cc Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
transient-parse-suffix: Accept object as prefix And if PREFIX is a symbol, actually assert that it identifies a prefix. --- lisp/transient.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/transient.el b/lisp/transient.el index 1b332ede44..198a867569 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -1456,20 +1456,24 @@ symbol property.") (defun transient-parse-suffix (prefix suffix) "Parse SUFFIX, to be added to PREFIX. -PREFIX is a prefix command, a symbol. +PREFIX is a prefix command symbol or object. SUFFIX is a suffix command or a group specification (of the same forms as expected by `transient-define-prefix'). Intended for use in a group's `:setup-children' function." - (cl-assert (and prefix (symbolp prefix))) + (if (cl-typep prefix 'transient-prefix) + (setq prefix (oref prefix command)) + (transient--get-layout prefix)) ; validate (eval (car (transient--parse-child prefix suffix)) t)) (defun transient-parse-suffixes (prefix suffixes) "Parse SUFFIXES, to be added to PREFIX. -PREFIX is a prefix command, a symbol. +PREFIX is a prefix command symbol or object. SUFFIXES is a list of suffix command or a group specification (of the same forms as expected by `transient-define-prefix'). Intended for use in a group's `:setup-children' function." - (cl-assert (and prefix (symbolp prefix))) + (if (cl-typep prefix 'transient-prefix) + (setq prefix (oref prefix command)) + (transient--get-layout prefix)) ; validate (mapcar (apply-partially #'transient-parse-suffix prefix) suffixes)) ;;; Edit