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

    transient-suffix-object: Limit use of this-original-command
    
    We only need to use `this-original-command' is `transient-set-level',
    but for other commands it doesn't matter, so we used it for all
    commands.  There is an exception though; when `this-original-command'
    is `transient-push-button', then we need to use `this-command'.
---
 lisp/transient.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index ab01332d90..8b4d4da5ad 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1476,10 +1476,11 @@ probably use this instead:
               (lambda (obj)
                 (eq (transient--suffix-command obj)
                     (or command
-                        ;; When `this-command' is `transient-set-level',
-                        ;; its reader needs to know what command is being
-                        ;; configured.
-                        this-original-command)))
+                        (if (eq this-command 'transient-set-level)
+                            ;; This is how it can look up for which
+                            ;; command it is setting the level.
+                            this-original-command
+                          this-command))))
               (or transient--suffixes
                   transient-current-suffixes))))
         (or (and (cdr suffixes)

Reply via email to