diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2025-06-02 15:55:15 +0200 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2025-06-02 15:55:15 +0200 |
| commit | 338ef1a98b54d5c84e9f7202b1ffb66bb18e9e95 (patch) | |
| tree | 15eaa9f3fa270e8d7b13111def9cea2782e259a0 /lisp | |
| parent | b326421f93bbdb89a2aa33b85416afe5e8064671 (diff) | |
transient-parse-{suffix,suffixes}: Do not validate PREFIX
We only started this validation in [1: 45de8e46] and the justification
boiled down to "we might as well".
However these functions are being called by `transient--get-layout',
*before* that had a chance to upgrade from the old to the new format,
and here we perform the validation by calling `transient--get-layout',
which together resulted in an infinite loop, and this errors being
repeated many times:
Not a legacy group definition: PREFIX: \
(error "Not a transient prefix command or group definition: PREFIX")
1: 2025-05-16 45de8e46f066eab3160f62cbcc76859022c9c1cc
transient-parse-suffix: Accept object as prefix
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/transient.el | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lisp/transient.el b/lisp/transient.el index 445a457..c2eb5ef 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -1519,9 +1519,8 @@ 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." - (if (cl-typep prefix 'transient-prefix) - (setq prefix (oref prefix command)) - (transient--get-layout prefix)) ; validate + (when (cl-typep prefix 'transient-prefix) + (setq prefix (oref prefix command))) (eval (car (transient--parse-child prefix suffix)) t)) (defun transient-parse-suffixes (prefix suffixes) @@ -1530,9 +1529,8 @@ 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." - (if (cl-typep prefix 'transient-prefix) - (setq prefix (oref prefix command)) - (transient--get-layout prefix)) ; validate + (when (cl-typep prefix 'transient-prefix) + (setq prefix (oref prefix command))) (mapcar (apply-partially #'transient-parse-suffix prefix) suffixes)) ;;; Edit |
