[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 2c01db0 42/72: hydra.el (hydra--handle-nonhead): Update si
From: |
Oleh Krehel |
Subject: |
[elpa] master 2c01db0 42/72: hydra.el (hydra--handle-nonhead): Update signature |
Date: |
Fri, 06 Mar 2015 13:04:15 +0000 |
branch: master
commit 2c01db0966e557cb2b9d085e2ea80ac01332ac62
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
hydra.el (hydra--handle-nonhead): Update signature
* hydra.el (hydra--format): Update docstring.
(hydra-pink-fallback): Add docstring.
(defhydra): Update call to `hydra--handle-nonhead'.
---
hydra.el | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/hydra.el b/hydra.el
index fe54892..ace2552 100644
--- a/hydra.el
+++ b/hydra.el
@@ -362,7 +362,7 @@ HEAD's binding is returned as a string with a colored face."
(defun hydra--format (name body docstring heads)
"Generate a `format' statement from STR.
\"%`...\" expressions are extracted into \"%S\".
-NAME, HEADS and BODY-COLOR are parameters of `defhydra'.
+NAME, BODY, DOCSTRING and HEADS are parameters of `defhydra'.
The expressions can be auto-expanded according to NAME."
(setq docstring (replace-regexp-in-string "\\^" "" docstring))
(let ((rest (hydra--hint name body docstring heads))
@@ -451,6 +451,7 @@ BODY-COLOR, BODY-PRE, BODY-POST, and OTHER-POST are used as
well."
,other-post))))))
(defun hydra-pink-fallback ()
+ "On intercepting a non-head, try to run it."
(let ((keys (this-command-keys))
kb)
(when (equal keys [backspace])
@@ -467,7 +468,9 @@ BODY-COLOR, BODY-PRE, BODY-POST, and OTHER-POST are used as
well."
(message "Pink Hydra can't currently handle prefixes, continuing"))
(message "Pink Hydra could not resolve: %S" keys))))
-(defun hydra--handle-nonhead (body heads keymap hint-name)
+(defun hydra--handle-nonhead (keymap name body heads)
+ "Setup KEYMAP for intercepting non-head bindings.
+NAME, BODY and HEADS are parameters to `defhydra'."
(let ((body-color (hydra--body-color body))
(body-post (plist-get (cddr body) :post)))
(when (and body-post (symbolp body-post))
@@ -491,10 +494,10 @@ BODY-COLOR, BODY-PRE, BODY-POST, and OTHER-POST are used
as well."
(when hydra-is-helpful
(unless hydra-lv
(sit-for 0.8))
- (,hint-name)))))
- (error
- "An %S Hydra must have at least one blue head in order to exit"
- body-color))
+ (,(intern (format "%S/hint" name)))))))
+ (error
+ "An %S Hydra must have at least one blue head in order to exit"
+ body-color))
(when hydra-keyboard-quit
(define-key keymap hydra-keyboard-quit
`(lambda ()
@@ -585,7 +588,7 @@ result of `defhydra'."
(setq body-pre `(funcall #',body-pre)))
(when (and body-post (symbolp body-post))
(setq body-post `(funcall #',body-post)))
- (hydra--handle-nonhead body heads keymap hint-name)
+ (hydra--handle-nonhead keymap name body heads)
`(progn
,@(cl-mapcar
(lambda (head name)
- [elpa] master 6f7cef2 22/72: Add teal body color, (continued)
- [elpa] master 6f7cef2 22/72: Add teal body color, Oleh Krehel, 2015/03/06
- [elpa] master 7010772 32/72: hydra.el (hydra--head-color): Improve, Oleh Krehel, 2015/03/06
- [elpa] master d0e8d57 33/72: hydra.el (hydra-add-font-lock): Add `defhydradio', Oleh Krehel, 2015/03/06
- [elpa] master 0881733 28/72: hydra.el (defhydra): Fix typo, Oleh Krehel, 2015/03/06
- [elpa] master a4c4eb6 36/72: Add example for `Buffer-menu-mode', Oleh Krehel, 2015/03/06
- [elpa] master 88b32d5 24/72: hydra.el (hydra--hint): Add exception, Oleh Krehel, 2015/03/06
- [elpa] master c41c932 31/72: README.md: fix tables, Oleh Krehel, 2015/03/06
- [elpa] master 1eebfed 34/72: Allow `format'-style width specifiers in docstring, Oleh Krehel, 2015/03/06
- [elpa] master e962ff1 39/72: hydra.el: remove no :pre, :post restriction for Emacs<24.4, Oleh Krehel, 2015/03/06
- [elpa] master a6c6a55 38/72: Improve compatibility for Emacs <= 24.3, Oleh Krehel, 2015/03/06
- [elpa] master 2c01db0 42/72: hydra.el (hydra--handle-nonhead): Update signature,
Oleh Krehel <=
- [elpa] master a71b76e 35/72: Intercept quit signals, Oleh Krehel, 2015/03/06
- [elpa] master ae70e9a 41/72: Fix pink and teal Hydras running :post, Oleh Krehel, 2015/03/06
- [elpa] master 71d70f6 46/72: Add :body-pre switch, Oleh Krehel, 2015/03/06
- [elpa] master cb28124 44/72: Allow sexps in Ruby-style docstrings, Oleh Krehel, 2015/03/06
- [elpa] master ace99b3 51/72: hydra.el (hydra--make-defun): Update signature, Oleh Krehel, 2015/03/06
- [elpa] master efcffc0 45/72: hydra-examples.el: Add example 9, Oleh Krehel, 2015/03/06
- [elpa] master ef1f61d 40/72: hydra.el (hydra--handle-nonhead): Fix bug, Oleh Krehel, 2015/03/06
- [elpa] master 2eddb83 43/72: hydra-test.el (hydra-format): New test, Oleh Krehel, 2015/03/06
- [elpa] master 5242aad 48/72: Fix :exit t / :exit nil inheritance issue, Oleh Krehel, 2015/03/06
- [elpa] master 0f733d8 37/72: Add an option to fontify heads in a custom way, Oleh Krehel, 2015/03/06