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

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

[elpa] externals/transient ed5bd6fdc3 23/41: transient-infix-set(argumen


From: Jonas Bernoulli
Subject: [elpa] externals/transient ed5bd6fdc3 23/41: transient-infix-set(argument): Fix disabling incompatible options
Date: Sun, 12 Nov 2023 20:04:08 -0500 (EST)

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

    transient-infix-set(argument): Fix disabling incompatible options
    
    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.
---
 lisp/transient.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 842aab4d9c..af11c3b7e9 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -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)



reply via email to

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