branch: externals/transient commit 4f7ee368994d69ba07f1b98581713f9c2bedf58d Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
transient-infix-set: Bugfixes - Do not disable the incompatible argument when disabling this argument. - A `transient-suffixes' is a `transient-argument' but its `argument' slot is unbound. Use the `argument-regexp' slot instead. --- lisp/transient.el | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/lisp/transient.el b/lisp/transient.el index bc2c97a624..cfe997394a 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -2187,20 +2187,22 @@ commands." (cl-defmethod transient-infix-set :around ((obj transient-argument) value) "Unset incompatible infix arguments." - (if-let ((sic transient--unset-incompatible) - (arg (oref obj argument)) - (spec (oref transient--prefix incompatible)) - (incomp (remove arg (cl-find-if (lambda (elt) (member arg elt)) spec)))) - (progn - (cl-call-next-method obj value) - (dolist (arg incomp) - (when-let ((obj (cl-find-if (lambda (obj) - (and (slot-boundp obj 'argument) - (equal (oref obj argument) arg))) - transient--suffixes))) - (let ((transient--unset-incompatible nil)) - (transient-infix-set obj nil))))) - (cl-call-next-method obj value))) + (let ((arg (if (slot-boundp obj 'argument) + (oref obj argument) + (oref obj argument-regexp)))) + (if-let ((sic (and value arg transient--unset-incompatible)) + (spec (oref transient--prefix incompatible)) + (incomp (remove arg (cl-find-if (lambda (elt) (member arg elt)) spec)))) + (progn + (cl-call-next-method obj value) + (dolist (arg incomp) + (when-let ((obj (cl-find-if (lambda (obj) + (and (slot-boundp obj 'argument) + (equal (oref obj argument) arg))) + transient--suffixes))) + (let ((transient--unset-incompatible nil)) + (transient-infix-set obj nil))))) + (cl-call-next-method obj value)))) (cl-defmethod transient-set-value ((obj transient-prefix)) (oset (oref obj prototype) value (transient-args))