Skip to content

Commit

Permalink
transient-infix-set(argument): Fix disabling incompatible options
Browse files Browse the repository at this point in the history
When `argument' is unbound, fall back to `argument-format' instead of
`argument-regexp'.  The format can easily be used both as the matcher
and the match candidate, while the regexp is only suitable as matcher.

Fallback from `argument' to `argument-format', not only for the
argument that is being enabled, but also for the arguments that might
have to be disabled in response.
  • Loading branch information
tarsius committed Oct 31, 2023
1 parent 425003a commit ed5bd6f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -3190,16 +3190,18 @@ prompt."
(when-let* ((--- value)
(arg (if (slot-boundp obj 'argument)
(oref obj argument)
(oref obj argument-regexp)))
(oref obj argument-format)))
(spec (oref transient--prefix incompatible))
(incomp (cl-mapcan (lambda (rule)
(and (member arg rule)
(remove arg rule)))
spec)))
(dolist (obj transient--suffixes)
(when (and (cl-typep obj 'transient-argument)
(slot-boundp obj 'argument)
(member (oref obj argument) incomp))
(when-let* ((--- (cl-typep obj 'transient-argument))
(arg (if (slot-boundp obj 'argument)
(oref obj argument)
(oref obj argument-format)))
(--- (member arg incomp)))
(transient-infix-set obj nil)))))

(cl-defgeneric transient-set-value (obj)
Expand Down

0 comments on commit ed5bd6f

Please sign in to comment.