emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/transient bb103abb7f 2/2: transient-suffix-object: Rest


From: Jonas Bernoulli
Subject: [elpa] externals/transient bb103abb7f 2/2: transient-suffix-object: Restore fallback behavior during setup
Date: Mon, 4 Nov 2024 07:32:21 -0500 (EST)

branch: externals/transient
commit bb103abb7f20736b6a5bdea7706d0bf850a8c7e1
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    transient-suffix-object: Restore fallback behavior during setup
    
    In [1: 1b7f9be7] we started to signal an error if there are multiple
    bindings for the command and we cannot determine the correct suffix
    object based on the key binding.
    
    When COMMAND is non-nil, then this function is not being called on
    behalf of `this-command'.  In that case `this-command-keys' is also
    meaningless, and when COMMAND has multiple bindings, then COMMAND
    cannot be mapped to a single suffix object.  Go back to returning
    the first object.
    
    Closes #325.
    
    1: 2024-11-02 1b7f9be7b9fbc8acb5d71f028b19e1f78d9dd090
       transient-suffix-object: Drop faulty fallback behavior
---
 lisp/transient.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 5a98654969..fe8fea8fe5 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1709,7 +1709,12 @@ probably use this instead:
                         (listify-key-sequence (this-command-keys))))
                suffixes)
             (car suffixes))
-          (error "BUG: Cannot determine suffix object"))))
+          ;; COMMAND is only provided if `this-command' is meaningless, in
+          ;; which case `this-command-keys' is also meaningless, making it
+          ;; impossible to disambiguate redundant bindings.
+          (if command
+              (car suffixes)
+            (error "BUG: Cannot determine suffix object")))))
    ((and-let* ((obj (transient--suffix-prototype (or command this-command)))
                (obj (clone obj)))
       (progn ; work around debbugs#31840



reply via email to

[Prev in Thread] Current Thread [Next in Thread]