[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 7b78b37 27/27: Merge commit '440c41cc3f5137d694211719abaa3
From: |
Oleh Krehel |
Subject: |
[elpa] master 7b78b37 27/27: Merge commit '440c41cc3f5137d694211719abaa38c0193a08a2' from hydra |
Date: |
Sat, 24 Jan 2015 20:36:38 +0000 |
branch: master
commit 7b78b37f6ae1588e7c91c0edb4ae341f4bad868c
Merge: f31d537 440c41c
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Merge commit '440c41cc3f5137d694211719abaa38c0193a08a2' from hydra
---
packages/hydra/hydra-examples.el | 7 ++++++
packages/hydra/hydra.el | 40 +++++++++++++++++++++----------------
2 files changed, 30 insertions(+), 17 deletions(-)
diff --git a/packages/hydra/hydra-examples.el b/packages/hydra/hydra-examples.el
index c07bd8e..c1b02df 100644
--- a/packages/hydra/hydra-examples.el
+++ b/packages/hydra/hydra-examples.el
@@ -81,5 +81,12 @@ Works best if you have not more than 4 windows.")
"A three-headed hydra for jumping between \"errors\".
Useful for e.g. `occur', `rgrep' and the like.")
+(defvar hydra-example-windmove
+ '(("h" windmove-left)
+ ("j" windmove-down)
+ ("k" windmove-up)
+ ("l" windmove-right))
+ "A four-headed hydra for `windmove'.")
+
(provide 'hydra-examples)
;;; hydra-examples.el ends here
diff --git a/packages/hydra/hydra.el b/packages/hydra/hydra.el
index 932cea2..5ef69ee 100644
--- a/packages/hydra/hydra.el
+++ b/packages/hydra/hydra.el
@@ -5,7 +5,7 @@
;; Author: Oleh Krehel <address@hidden>
;; Maintainer: Oleh Krehel <address@hidden>
;; URL: https://github.com/abo-abo/hydra
-;; Version: 0.3.0
+;; Version: 0.3.1
;; Keywords: bindings
;; Package-Requires: ((cl-lib "0.5"))
@@ -112,20 +112,7 @@ When `(keymapp METHOD)`, it becomes:
(mapconcat
(lambda (x)
(format "\"%s\": `%S'" (car x) (cadr x)))
- heads ",\n")))
- map
- (method
- (cond ((null method)
- (unless (keymapp (global-key-binding (kbd body)))
- (global-set-key (kbd body) nil))
- 'global-set-key)
- ((keymapp (setq map (eval method)))
- (unless (keymapp (lookup-key map (kbd body)))
- (define-key map (kbd body) nil))
- `(lambda (key command)
- (define-key ,method key command)))
- (t
- method))))
+ heads ",\n"))))
`(progn
,@(cl-mapcar
(lambda (head name)
@@ -137,7 +124,8 @@ When `(keymapp METHOD)`, it becomes:
`((call-interactively #',(cadr head))
(when hydra-is-helpful
(message ,hint))
- (setq hydra-last (hydra-set-transient-map ',keymap
t))))))
+ (setq hydra-last
+ (hydra-set-transient-map ',keymap t))))))
heads names)
(defun ,(intern (format "hydra-%s-body" body)) ()
,doc
@@ -145,9 +133,27 @@ When `(keymapp METHOD)`, it becomes:
(when hydra-is-helpful
(message ,hint))
(setq hydra-last (hydra-set-transient-map ',keymap t)))
+ ,@(cond ((null method)
+ `((unless (keymapp (global-key-binding (kbd ,body)))
+ (global-set-key (kbd ,body) nil))))
+ ((or (functionp method)
+ (and (consp method)
+ (memq (car method) '(function quote))))
+ nil)
+ (t
+ `((unless (keymapp (lookup-key ,method (kbd ,body)))
+ (define-key ,method (kbd ,body) nil)))))
,@(cl-mapcar
(lambda (head name)
- `(,method ,(vconcat (kbd body) (kbd (car head))) #',name))
+ `(,@(cond ((null method)
+ (list 'global-set-key))
+ ((or (functionp method)
+ (and (consp method)
+ (memq (car method) '(function quote))))
+ (list 'funcall method))
+ (t
+ (list 'define-key method)))
+ ,(vconcat (kbd body) (kbd (car head))) #',name))
heads names))))
(provide 'hydra)
- [elpa] master c3ce0a9 15/27: `hydra-create' will also define `hydra-...-body', (continued)
- [elpa] master c3ce0a9 15/27: `hydra-create' will also define `hydra-...-body', Oleh Krehel, 2015/01/24
- [elpa] master 8884698 17/27: Don't undefine BODY's map binding when it's a prefix, Oleh Krehel, 2015/01/24
- [elpa] master dfe1273 19/27: Simplify and improve the generated defuns, Oleh Krehel, 2015/01/24
- [elpa] master 301b500 16/27: Don't undefine BODY's global binding when it's a prefix, Oleh Krehel, 2015/01/24
- [elpa] master 42538fa 18/27: Add a `next-error'/`previous-error'/`first-error' example, Oleh Krehel, 2015/01/24
- [elpa] master dc0246e 20/27: hydra-examples.el (hydra-example-goto-error): add doc, Oleh Krehel, 2015/01/24
- [elpa] master ddd96d1 23/27: hydra-examples.el: add a `windmove' Hydra, Oleh Krehel, 2015/01/24
- [elpa] master 64e5b91 22/27: Avoid evaling METHOD., Oleh Krehel, 2015/01/24
- [elpa] master 440c41c 24/27: Bump version, Oleh Krehel, 2015/01/24
- [elpa] master cfac8bd 21/27: Prepare for the first version in GNU ELPA, Oleh Krehel, 2015/01/24
- [elpa] master 7b78b37 27/27: Merge commit '440c41cc3f5137d694211719abaa38c0193a08a2' from hydra,
Oleh Krehel <=
- [elpa] master 685c83b 25/27: Setup git subtree add for hydra, Oleh Krehel, 2015/01/24
- [elpa] master f31d537 26/27: Add 'packages/hydra/' from commit 'cfac8bd9e73ea1e219250867b22881354fc2d56e', Oleh Krehel, 2015/01/24