[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hydra 03eeea324c 10/46: Make first line of hydra docstr
From: |
Stefan Monnier |
Subject: |
[elpa] externals/hydra 03eeea324c 10/46: Make first line of hydra docstrings more informative. |
Date: |
Tue, 25 Oct 2022 22:27:20 -0400 (EDT) |
branch: externals/hydra
commit 03eeea324c15171c3f111de3a582582deb5ec3e7
Author: Justin Burkett <justin@burkett.cc>
Commit: Justin Burkett <justin@burkett.cc>
Make first line of hydra docstrings more informative.
Before this commit every head has the same first line for its docstring. The
distinguishing line is last. This change makes the distinguishing line
appear
first in the docstring along with some minor wording changes.
For an application, see
https://github.com/justbur/emacs-which-key/issues/185#issuecomment-361944776
* hydra.el (hydra--doc): Reword docstring.
(hydra--make-defun): Say which head is called in the first line.
---
hydra.el | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/hydra.el b/hydra.el
index d1f4ee6ff2..57c712fe79 100644
--- a/hydra.el
+++ b/hydra.el
@@ -738,15 +738,14 @@ BODY-KEY is the body key binding.
BODY-NAME is the symbol that identifies the Hydra.
HEADS is a list of heads."
(format
- "Create a hydra with %s body and the heads:\n\n%s\n\n%s"
- (if body-key
- (format "a \"%s\"" body-key)
- "no")
+ "The heads for the associated hydra are:\n\n%s\n\n%s%s."
(mapconcat
(lambda (x)
(format "\"%s\": `%S'" (car x) (cadr x)))
heads ",\n")
- (format "The body can be accessed via `%S'." body-name)))
+ (format "The body can be accessed via `%S'" body-name)
+ (when body-key
+ (format ", which is bound to \"%s\"" body-key))))
(defun hydra--call-interactively-remap-maybe (cmd)
"`call-interactively' the given CMD or its remapped equivalent.
@@ -783,8 +782,10 @@ BODY-AFTER-EXIT is added to the end of the wrapper."
(hydra--make-callable
(cadr head))))
(doc (if (car head)
- (format "%s\n\nCall the head: `%S'." doc (cadr head))
- doc))
+ (format "Call the head `%S' in the \"%s\" hydra.\n\n%s"
+ (cadr head) name doc)
+ (format "Call the body in the \"%s\" hydra.\n\n%s"
+ name doc)))
(hint (intern (format "%S/hint" name)))
(body-foreign-keys (hydra--body-foreign-keys body))
(body-timeout (plist-get body :timeout))
- [elpa] externals/hydra updated (4532f40ae4 -> 7081ee6d44), Stefan Monnier, 2022/10/25
- [elpa] externals/hydra a23046b7d5 06/46: hydra.el (hydra--hint-from-matrix): Refactor, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra b12d37ac00 03/46: hydra.el (hydra--format): Detect macroexpand, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra 6eaf10f52c 05/46: hydra-test.el (hydra-format-5): Fix failing test, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra 462202d7fc 11/46: hydra.el (hydra--doc): Fixup, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra ab67b29835 01/46: Declare the third argument of `defhydra’ as a (potential) docstring., Stefan Monnier, 2022/10/25
- [elpa] externals/hydra 1deed8a00e 09/46: fix typo in readme, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra 03eeea324c 10/46: Make first line of hydra docstrings more informative.,
Stefan Monnier <=
- [elpa] externals/hydra 62e0f37462 14/46: hydra-test.el: Fix tests for previous commit, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra 5b8f662992 16/46: hydra.el (hydra--format): Allow e.g. "M-?" in docstring, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra 44b42598ee 18/46: Fix Typos, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra d071278fcc 20/46: hydra.el (hydra--format): Fix off-by-one, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra 5c5b9ca326 21/46: Silence byte-compiler on Emacs 25, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra e01a79e4b7 24/46: hydra.el (defhydra): Declare "/params" and "/docstring", Stefan Monnier, 2022/10/25
- [elpa] externals/hydra f0745366ff 34/46: hydra.el (hydra--hint-from-matrix-1): Extract, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra 1dab16cd2a 35/46: hydra.el (hydra--hint-from-matrix): Prep to return list, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra 8119d82fe9 13/46: hydra.el (hydra--make-defun): require hydra, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra 1e72f96a14 15/46: hydra.el (defhydra): Add :base-map option to body plist, Stefan Monnier, 2022/10/25