emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/transient 5e841bb24b 19/41: transient-infix-set(argumen


From: Jonas Bernoulli
Subject: [elpa] externals/transient 5e841bb24b 19/41: transient-infix-set(argument): Replace :around with :after method
Date: Sun, 12 Nov 2023 20:04:08 -0500 (EST)

branch: externals/transient
commit 5e841bb24ba5a0b5f169b432349871dd04721a39
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    transient-infix-set(argument): Replace :around with :after method
---
 lisp/transient.el | 33 +++++++++++++++------------------
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 5087a7f770..599d6c7c0c 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -3185,28 +3185,25 @@ prompt."
   "Set the value of infix object OBJ to value."
   (oset obj value value))
 
-(cl-defmethod transient-infix-set :around ((obj transient-argument) value)
+(cl-defmethod transient-infix-set :after ((obj transient-argument) value)
   "Unset incompatible infix arguments."
   (let ((arg (if (slot-boundp obj 'argument)
                  (oref obj argument)
                (oref obj argument-regexp))))
-    (if-let ((sic (and value arg))
-             (spec (oref transient--prefix incompatible))
-             (incomp (cl-mapcan (lambda (rule)
-                                  (and (member arg rule)
-                                       (remove arg rule)))
-                                spec)))
-        (progn
-          (cl-call-next-method obj value)
-          (dolist (arg incomp)
-            (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)))
-              (transient-infix-set obj nil))))
-      (cl-call-next-method obj value))))
+    (when-let ((sic (and value arg))
+               (spec (oref transient--prefix incompatible))
+               (incomp (cl-mapcan (lambda (rule)
+                                    (and (member arg rule)
+                                         (remove arg rule)))
+                                  spec)))
+      (dolist (arg incomp)
+        (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)))
+          (transient-infix-set obj nil))))))
 
 (cl-defgeneric transient-set-value (obj)
   "Set the value of the transient prefix OBJ.")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]