[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 62edeffd10 1/2: Fix bug using :incompatible u
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient 62edeffd10 1/2: Fix bug using :incompatible using suffixes before infixes |
Date: |
Wed, 31 May 2023 12:17:05 -0400 (EDT) |
branch: externals/transient
commit 62edeffd1021537ae9a6181734e483dc143d184c
Author: Steve Molitor <steve.molitor@zapier.com>
Commit: Jonas Bernoulli <jonas@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))))