[Top][All Lists]

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

[elpa] externals/transient 2226375 06/11: transient-show-help: Refactor

From: Jonas Bernoulli
Subject: [elpa] externals/transient 2226375 06/11: transient-show-help: Refactor and improve
Date: Thu, 4 Nov 2021 21:02:18 -0400 (EDT)

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

    transient-show-help: Refactor and improve
 lisp/transient.el | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index eac211e..782a764 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -3286,15 +3286,14 @@ Show the first one that is specified."
 (cl-defmethod transient-show-help ((obj transient-suffix))
   "Show the command doc-string."
-  (if (eq this-command 'transient-help)
-      (if-let ((manpage (oref transient--prefix man-page)))
-          (transient--show-manpage manpage)
-        (transient--describe-function (oref transient--prefix command)))
-    (if-let ((prefix (get (transient--suffix-command obj) 'transient--prefix))
-             (manpage (oref prefix man-page))
-             (- (not (eq this-command (oref transient--prefix command)))))
-        (transient--show-manpage manpage)
-      (transient--describe-function this-command))))
+  (cond
+   ((eq this-command 'transient-help)
+    (transient-show-help transient--prefix))
+   ((let ((prefix (get (transient--suffix-command obj)
+                       'transient--prefix)))
+      (and prefix (not (eq (oref transient--prefix command) this-command))
+           (prog1 t (transient-show-help prefix)))))
+   (t (transient--describe-function this-command))))
 (cl-defmethod transient-show-help ((obj transient-infix))
   "Show the manpage if defined or the command doc-string.

reply via email to

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