branch: externals/transient
commit 23ec451280fa1641090a5abcbf75b4b99ec61852
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    transient--init-suffix: Do not use :level twice calling constructor
    
    For class constructors and `clone', if a keyword argument is specified
    multiple times, the latter instance wins, which in our case was the
    outdated one.
    
    As a result, it was impossible to change the level of a suffix if that
    was set inline, in the prefix definition.
    
    Fixes [1: bcc0bf83].
    
    1: 2025-05-16 bcc0bf836808e156262d9ff631be7d91a0ec201d
       Improve format of layout and handling of included groups
---
 CHANGELOG         |  5 +++++
 lisp/transient.el | 10 +++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 25d50e7dde..f1571104f8 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,9 @@
 # -*- mode: org -*-
+* v0.9.2    UNRELEASED
+
+- Fixed a regression in v0.9.0, which made it impossible to change the
+  level of a suffix if that was set inline in the prefix definition.
+
 * v0.9.1    2025-06-03
 
 - As an additional safety measure, unconditionally reset ~inhibit-quit~
diff --git a/lisp/transient.el b/lisp/transient.el
index 29388a990b..a56774c28a 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2511,16 +2511,16 @@ value.  Otherwise return CHILDREN as is.")
                           (alist-get cmd levels)
                           (plist-get args :level)
                           (and proto (oref proto level))
-                          transient--default-child-level)))
+                          transient--default-child-level))
+               (args (plist-put (copy-list plist) :level level)))
     (when (transient--use-level-p level)
       (let ((obj (if (child-of-class-p class 'transient-information)
-                     (apply class :parent parent :level level args)
+                     (apply class :parent parent args)
                    (unless (and cmd (symbolp cmd))
                      (error "BUG: Non-symbolic suffix command: %s" cmd))
                    (if proto
-                       (apply #'clone proto :parent parent :level level args)
-                     (apply class :command cmd :parent parent :level level
-                            args)))))
+                       (apply #'clone proto :parent parent args)
+                     (apply class :command cmd :parent parent args)))))
         (cond ((not cmd))
               ((commandp cmd))
               ((or (cl-typep obj 'transient-switch)

Reply via email to