Skip to content

Commit

Permalink
Combine some conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed Sep 28, 2024
1 parent 880b21a commit f67500b
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit f67500b

Please sign in to comment.