[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))
- [elpa] externals/transient updated (306645aa59 -> 5fcd713873), Jonas Bernoulli, 2024/09/29
- [elpa] externals/transient f67500bfd2 2/6: Combine some conditionals,
Jonas Bernoulli <=
- [elpa] externals/transient 732ec975ec 5/6: transient--describe-function: Refactor setting help buffer/window, Jonas Bernoulli, 2024/09/29
- [elpa] externals/transient 4587f8d8de 3/6: Update changelog, Jonas Bernoulli, 2024/09/29
- [elpa] externals/transient 683e5104a0 4/6: fixup(f67500bf): Combine some conditionals, Jonas Bernoulli, 2024/09/29
- [elpa] externals/transient 5fcd713873 6/6: transient-with-help-window: New macro, Jonas Bernoulli, 2024/09/29
- [elpa] externals/transient 880b21adfa 1/6: gitignore: /lisp/*-pkg.el, Jonas Bernoulli, 2024/09/29