branch: master
commit c3ce0a90028701ba3b907de8cd6e812ae92c27d9
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
`hydra-create' will also define `hydra-...-body'
* hydra.el (hydra-create): Update.
In order to bind hydras in `lispy', I need a way to split the body from
the heads. Now, this is possible:
(hydra-create "C-z"
'(("l" forward-char)
("h" backward-char)
("j" next-line)
("k" previous-line)
("z"))
lispy-mode-map)
(lispy-define-key lispy-mode-map "z" 'hydra-C-z-body)
---
hydra.el | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/hydra.el b/hydra.el
index f1428ab..7959466 100644
--- a/hydra.el
+++ b/hydra.el
@@ -130,6 +130,12 @@ When `(keymapp METHOD)`, it becomes:
(message ,hint))
(setq hydra-last (set-transient-map ',keymap t)))))
heads names)
+ (defun ,(intern (format "hydra-%s-body" body)) ()
+ ,doc
+ (interactive)
+ (when hydra-is-helpful
+ (message ,hint))
+ (setq hydra-last (set-transient-map ',keymap t)))
,@(cl-mapcar
(lambda (head name)
`(,method ,(vconcat (kbd body) (kbd (car head))) #',name))