summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2025-06-02 15:55:15 +0200
committerJonas Bernoulli <jonas@bernoul.li>2025-06-02 15:55:15 +0200
commit338ef1a98b54d5c84e9f7202b1ffb66bb18e9e95 (patch)
tree15eaa9f3fa270e8d7b13111def9cea2782e259a0
parentb326421f93bbdb89a2aa33b85416afe5e8064671 (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
-rw-r--r--lisp/transient.el10
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