branch: externals/transient commit 62edeffd1021537ae9a6181734e483dc143d184c Author: Steve Molitor <steve.moli...@zapier.com> Commit: Jonas Bernoulli <jo...@bernoul.li>
Fix bug using :incompatible using suffixes before infixes Fix #247. When using `:incompatible' with another option that has defined suffix no argument, if that option comes before the incompatible options, you get an (invalid-slot-name "#<transient-suffix transient-suffix-53012386>" argument) error. This happens because `transient-infix-set' calls (slot-boundp obj 'argument), and `argument' will not be bound for suffixes with no argument, signaling the error. To fix, add a (slot-exist-p obj 'argument) guard first, to avoid tripping the signal. --- lisp/transient.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lisp/transient.el b/lisp/transient.el index c70a3313d0..86e653651b 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -3044,10 +3044,12 @@ prompt." (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))) + (when-let ((obj (cl-find-if + (lambda (obj) + (and (slot-exists-p obj 'argument) + (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))))