Skip to content

Commit

Permalink
Restore ability to change a prefix's level
Browse files Browse the repository at this point in the history
In [1: 1b7f9be] we intentionally started signaling an error in
`transient-suffix-object' if no object can be determined, to learn
whether there actually are any callers for which it actually make
sense to return nil instead.

Now we know about one, but I am still not sure whether that should
be a valid use-case, so we keep the error for now, but ignore the
error in this one case.

Closes #337.

1: 2024-11-02 1b7f9be
   transient-suffix-object: Drop faulty fallback behavior
  • Loading branch information
tarsius committed Dec 8, 2024
1 parent 005e50b commit dd69194
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# -*- mode: org -*-
* v0.8.1 UNRELEASED

Bug fixes:

- Interactively setting the level of a transient prefix resulted in
an error. #337.

* v0.8.0 2024-12-06

- While the minibuffer is in use, the menu window is now hidden by
Expand Down
6 changes: 5 additions & 1 deletion lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -1760,6 +1760,9 @@ probably use this instead:
;; impossible to disambiguate redundant bindings.
(if command
(car suffixes)
;; TODO Decide whether it is legimate to use this function
;; as a predicate, and also whether to return an object for
;; suffixes common to all prefixes. See #29 and #337.
(error "BUG: Cannot determine suffix object")))))
((and-let* ((obj (transient--suffix-prototype (or command this-command)))
(obj (clone obj)))
Expand Down Expand Up @@ -2418,7 +2421,8 @@ value. Otherwise return CHILDREN as is.")
((not (transient--edebug-command-p))
(setq this-command 'transient-undefined))))
((and transient--editp
(transient-suffix-object)
;; See TODO in that function.
(ignore-errors (transient-suffix-object))
(not (memq this-command '(transient-quit-one
transient-quit-all
transient-help))))
Expand Down

0 comments on commit dd69194

Please sign in to comment.