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

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

[elpa] externals/transient f67500bfd2 2/6: Combine some conditionals


From: Jonas Bernoulli
Subject: [elpa] externals/transient f67500bfd2 2/6: Combine some conditionals
Date: Sun, 29 Sep 2024 15:21:08 -0400 (EDT)

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

    Combine some conditionals
---
 lisp/transient.el | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index b53ea3d709..67d03991d9 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1245,9 +1245,9 @@ commands are aliases for."
                      (and (listp val) (not (eq (car val) 'lambda))))
                  (setq args (plist-put args key (macroexp-quote val))))
                 ((setq args (plist-put args key val)))))))
-    (unless (plist-get args :key)
-      (when-let ((shortarg (plist-get args :shortarg)))
-        (setq args (plist-put args :key shortarg))))
+    (when-let* ((not (plist-get args :key))
+                (shortarg (plist-get args :shortarg)))
+      (setq args (plist-put args :key shortarg)))
     (list 'list
           (or level transient--default-child-level)
           (macroexp-quote (or class 'transient-suffix))
@@ -2197,9 +2197,9 @@ value.  Otherwise return CHILDREN as is."
 (cl-defmethod transient--init-suffix-key ((obj transient-argument))
   (if (transient-switches--eieio-childp obj)
       (cl-call-next-method obj)
-    (unless (slot-boundp obj 'shortarg)
-      (when-let ((shortarg (transient--derive-shortarg (oref obj argument))))
-        (oset obj shortarg shortarg)))
+    (when-let* ((not (slot-boundp obj 'shortarg))
+                (shortarg (transient--derive-shortarg (oref obj argument))))
+      (oset obj shortarg shortarg))
     (unless (slot-boundp obj 'key)
       (if (slot-boundp obj 'shortarg)
           (oset obj key (oref obj shortarg))
@@ -4227,14 +4227,14 @@ manpage, then try to jump to the correct location."
 
 (defun transient--describe-function (fn)
   (describe-function fn)
-  (unless (derived-mode-p 'help-mode)
-    (when-let* ((buf (get-buffer "*Help*"))
-                (win (or (and buf (get-buffer-window buf))
-                         (cl-find-if (lambda (win)
-                                       (with-current-buffer (window-buffer win)
-                                         (derived-mode-p 'help-mode)))
-                                     (window-list)))))
-      (select-window win))))
+  (when-let* (((not (derived-mode-p 'help-mode)))
+              (buf (get-buffer "*Help*"))
+              (win (or (and buf (get-buffer-window buf))
+                       (cl-find-if (lambda (win)
+                                     (with-current-buffer (window-buffer win)
+                                       (derived-mode-p 'help-mode)))
+                                   (window-list)))))
+    (select-window win)))
 
 (defun transient--show-manual (manual)
   (info manual))



reply via email to

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