[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c9432e8 12/28: README.md: describe docstring
From: |
Oleh Krehel |
Subject: |
[elpa] master c9432e8 12/28: README.md: describe docstring |
Date: |
Sun, 22 Mar 2015 16:34:42 +0000 |
branch: master
commit c9432e848b3dde61e85e41fedac0229f71785fec
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
README.md: describe docstring
---
README.md | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/README.md b/README.md
index e871643..cbc4898 100644
--- a/README.md
+++ b/README.md
@@ -299,6 +299,28 @@ instead of `define-key` you can use this option.
The `:bind` key can be overridden by each head. This is useful if you want to
have a few heads that
are not bound outside the hydra.
+### `awesome-docstring`
+
+This can be a simple string used to build the final hydra hint. However, if
you start it with a
+newline, the key-highlighting and Ruby-style string interpolation becomes
enabled, as you can see in
+`hydra-buffer-menu` above.
+
+To highlight a key, just wrap it in underscores. Note that the key must belong
to one of the heads.
+The key will be highlighted with the color that is appropriate to the behavior
of the key, i.e. if
+the key will make the hydra exit, the color will be blue.
+
+To insert an empty character, use `^`. The only use of this is to have your
code aligned as
+nicely as the result.
+
+To insert a dynamic Elisp variable, use `%`` followed by the variable.
Each time the variable
+changes due to a head, the docstring will be updated. `format`-style width
specifiers can be used.
+
+To insert a dynamic Elisp expression, use e.g. `%(length
(dired-get-marked-files))`. If a head will
+change the amount of marked files, for example, it will be appropriately
updated.
+
+If the result of the Elisp expression is a string and you don't want to quote
it, use this form:
+`%s(shell-command-to-string "du -hs")`.
+
### `awesome-head-1`
Each head looks like this:
- [elpa] master 9623625 02/28: hydra-ox.el (hydra-ox): Update parameter list, (continued)
- [elpa] master 9623625 02/28: hydra-ox.el (hydra-ox): Update parameter list, Oleh Krehel, 2015/03/22
- [elpa] master b840227 03/28: Update `golden-ratio-mode' work-around, Oleh Krehel, 2015/03/22
- [elpa] master 77c8e40 01/28: Add option to specify :hint in body, Oleh Krehel, 2015/03/22
- [elpa] master 88c7dc4 04/28: Fix wrong type argument in hydra-timeout, Oleh Krehel, 2015/03/22
- [elpa] master 5c2f420 06/28: hydra-examples.el: Fixup, Oleh Krehel, 2015/03/22
- [elpa] master 58075f5 08/28: hydra-examples.el (hydra-buffer-menu): Fix example, Oleh Krehel, 2015/03/22
- [elpa] master bca2441 07/28: Makefile: Simplify, Oleh Krehel, 2015/03/22
- [elpa] master a867927 05/28: "C-g" (`hydra-keyboard-quit' ) should run :post, Oleh Krehel, 2015/03/22
- [elpa] master 7f4c835 11/28: README.md: finish up the rules, Oleh Krehel, 2015/03/22
- [elpa] master 556db52 14/28: Wiki link to the "Home" page instead., Oleh Krehel, 2015/03/22
- [elpa] master c9432e8 12/28: README.md: describe docstring,
Oleh Krehel <=
- [elpa] master 3c4b3fd 16/28: lv.el: Update truncation rules, Oleh Krehel, 2015/03/22
- [elpa] master 3f11348 13/28: README.md: Add toc, Oleh Krehel, 2015/03/22
- [elpa] master 5e8c7f2 18/28: hydra.el (hydra--format): Extend key regex with "; :", Oleh Krehel, 2015/03/22
- [elpa] master 3a77bf6 20/28: hydra-examples.el (hydra-apropos): Add., Oleh Krehel, 2015/03/22
- [elpa] master 622c798 10/28: README.md: move some stuff to wiki, add more stuff, Oleh Krehel, 2015/03/22
- [elpa] master 9f9dcf9 17/28: Bind [switch-frame] to `hydra-keyboard-quit', Oleh Krehel, 2015/03/22
- [elpa] master 543e97b 19/28: Fix switch-frame handling., Oleh Krehel, 2015/03/22
- [elpa] master 97d6987 21/28: Add hydra-rectangle example, Oleh Krehel, 2015/03/22
- [elpa] master bfe65da 15/28: README.md: Fix up typos, Oleh Krehel, 2015/03/22
- [elpa] master d44bf58 22/28: Don't bind `hydra-keyboard-quit' in foreign keymaps, Oleh Krehel, 2015/03/22