[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient a9bdd01 3/5: transient-show-help: Use manpage
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient a9bdd01 3/5: transient-show-help: Use manpage of subprefixes |
Date: |
Tue, 15 Jun 2021 19:03:14 -0400 (EDT) |
branch: externals/transient
commit a9bdd013f90619614c7fbc163bbd825b218b9dbc
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
transient-show-help: Use manpage of subprefixes
When a command that was defined using `transient-define-prefix'
is called as the suffix of another prefix, then the corresponding
suffix object isn't cloned from a specialized prototype, so slots
like `manpage' are undefined. But the `manpage' slot of the
prefix object may be set, so use that.
---
lisp/transient.el | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index 50a8109..51f116b 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -3203,13 +3203,16 @@ Show the first one that is specified."
(transient--show-manpage manpage)
(transient--describe-function (oref obj command)))))
-(cl-defmethod transient-show-help ((_ transient-suffix))
+(cl-defmethod transient-show-help ((obj transient-suffix))
"Show the command doc-string."
(if (eq this-original-command 'transient-help)
(if-let ((manpage (oref transient--prefix man-page)))
(transient--show-manpage manpage)
(transient--describe-function (oref transient--prefix command)))
- (transient--describe-function this-original-command)))
+ (if-let ((prefix (get (transient--suffix-command obj) 'transient--prefix))
+ (manpage (oref prefix man-page)))
+ (transient--show-manpage manpage)
+ (transient--describe-function this-original-command))))
(cl-defmethod transient-show-help ((obj transient-infix))
"Show the manpage if defined or the command doc-string.