From 338ef1a98b54d5c84e9f7202b1ffb66bb18e9e95 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Mon, 2 Jun 2025 15:55:15 +0200 Subject: 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 --- lisp/transient.el | 10 ++++------ 1 file 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 -- cgit v1.0