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

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

[elpa] externals/transient 76647bfb9b 17/23: transient--inapt-suffix-p:


From: Jonas Bernoulli
Subject: [elpa] externals/transient 76647bfb9b 17/23: transient--inapt-suffix-p: Return t if parent is inapt
Date: Sun, 22 Dec 2024 08:44:40 -0500 (EST)

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

    transient--inapt-suffix-p: Return t if parent is inapt
    
    Instead of making the callers do it.  One caller didn't do it before,
    which was a mistake.
---
 lisp/transient.el | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index a3207c273d..4b09bead8c 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2261,8 +2261,7 @@ value.  Otherwise return CHILDREN as is.")
                (obj (apply class :parent parent :level level args))
                ((transient--use-suffix-p obj))
                ((prog1 t
-                  (when (or (and parent (oref parent inapt))
-                            (transient--inapt-suffix-p obj))
+                  (when (transient--inapt-suffix-p obj)
                     (oset obj inapt t))))
                (suffixes (mapcan (lambda (c) (transient--init-child levels c 
obj))
                                  (transient-setup-children obj children))))
@@ -2304,8 +2303,7 @@ value.  Otherwise return CHILDREN as is.")
         (unless (cl-typep obj 'transient-information)
           (transient--init-suffix-key obj))
         (when (transient--use-suffix-p obj)
-          (if (or (and parent (oref parent inapt))
-                  (transient--inapt-suffix-p obj))
+          (if (transient--inapt-suffix-p obj)
               (oset obj inapt t)
             (transient-init-scope obj)
             (transient-init-value obj))
@@ -2347,18 +2345,20 @@ value.  Otherwise return CHILDREN as is.")
      t)))
 
 (defun transient--inapt-suffix-p (obj)
-  (let ((transient--shadowed-buffer (current-buffer))
-        (transient--pending-suffix obj))
-    (transient--do-suffix-p
-     (oref obj inapt-if)
-     (oref obj inapt-if-not)
-     (oref obj inapt-if-nil)
-     (oref obj inapt-if-non-nil)
-     (oref obj inapt-if-mode)
-     (oref obj inapt-if-not-mode)
-     (oref obj inapt-if-derived)
-     (oref obj inapt-if-not-derived)
-     nil)))
+  (or (and-let* ((parent (oref obj parent)))
+        (oref parent inapt))
+      (let ((transient--shadowed-buffer (current-buffer))
+            (transient--pending-suffix obj))
+        (transient--do-suffix-p
+         (oref obj inapt-if)
+         (oref obj inapt-if-not)
+         (oref obj inapt-if-nil)
+         (oref obj inapt-if-non-nil)
+         (oref obj inapt-if-mode)
+         (oref obj inapt-if-not-mode)
+         (oref obj inapt-if-derived)
+         (oref obj inapt-if-not-derived)
+         nil))))
 
 (defun transient--do-suffix-p
     (if if-not if-nil if-non-nil if-mode if-not-mode if-derived if-not-derived



reply via email to

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