Skip to content

Commit

Permalink
transient-suffix-object: Restore fallback behavior during setup
Browse files Browse the repository at this point in the history
In [1: 1b7f9be] 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 1b7f9be
   transient-suffix-object: Drop faulty fallback behavior
  • Loading branch information
tarsius committed Nov 4, 2024
1 parent 4634815 commit bb103ab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb103ab

Please sign in to comment.