[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master d44bf58 22/28: Don't bind `hydra-keyboard-quit' in foreign
From: |
Oleh Krehel |
Subject: |
[elpa] master d44bf58 22/28: Don't bind `hydra-keyboard-quit' in foreign keymaps |
Date: |
Sun, 22 Mar 2015 16:34:46 +0000 |
branch: master
commit d44bf581d2c9cb831ccc5ac0fff24be4c36b8eed
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Don't bind `hydra-keyboard-quit' in foreign keymaps
* hydra.el (defhydra): Update.
Fixes #78.
---
hydra.el | 51 ++++++++++++++++++++++++++-------------------------
1 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/hydra.el b/hydra.el
index 975bff7..2680f38 100644
--- a/hydra.el
+++ b/hydra.el
@@ -908,31 +908,32 @@ result of `defhydra'."
(cl-mapcar
(lambda (head)
(let ((name (hydra--head-property head :cmd-name)))
- (when (cadr head)
- (when (or body-key method)
- (let ((bind (hydra--head-property head :bind
'default))
- (final-key
- (if body-key
- (vconcat (kbd body-key) (kbd (car head)))
- (kbd (car head)))))
- (cond ((null bind) nil)
-
- ((eq bind 'default)
- (list
- (if (hydra--callablep method)
- 'funcall
- 'define-key)
- method
- final-key
- (list 'function name)))
-
- ((hydra--callablep bind)
- `(funcall (function ,bind)
- ,final-key
- (function ,name)))
-
- (t
- (error "Invalid :bind property %S"
head))))))))
+ (when (and (cadr head)
+ (not (eq (cadr head) 'hydra-keyboard-quit))
+ (or body-key method))
+ (let ((bind (hydra--head-property head :bind 'default))
+ (final-key
+ (if body-key
+ (vconcat (kbd body-key) (kbd (car head)))
+ (kbd (car head)))))
+ (cond ((null bind) nil)
+
+ ((eq bind 'default)
+ (list
+ (if (hydra--callablep method)
+ 'funcall
+ 'define-key)
+ method
+ final-key
+ (list 'function name)))
+
+ ((hydra--callablep bind)
+ `(funcall (function ,bind)
+ ,final-key
+ (function ,name)))
+
+ (t
+ (error "Invalid :bind property %S" head)))))))
heads))
(defun ,(intern (format "%S/hint" name)) ()
,(hydra--message name body docstring heads))
- [elpa] master c9432e8 12/28: README.md: describe docstring, (continued)
- [elpa] master c9432e8 12/28: README.md: describe docstring, Oleh Krehel, 2015/03/22
- [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 <=
- [elpa] master eb181fd 23/28: Call :post for :timeout, Oleh Krehel, 2015/03/22
- [elpa] master 30a073b 25/28: hydra.el (hydra-keyboard-quit): Clean up the message area, Oleh Krehel, 2015/03/22
- [elpa] master 8e4b1fa 24/28: lv.el (lv-message): Use setq-local for window-min-height, Oleh Krehel, 2015/03/22
- [elpa] master 498d78b 26/28: Set pink/amaranth override recursively, Oleh Krehel, 2015/03/22
- [elpa] master 7783f89 27/28: Minor fixes, Oleh Krehel, 2015/03/22
- [elpa] master a071b60 09/28: README.md: update, Oleh Krehel, 2015/03/22
- [elpa] master 5aa7896 28/28: Merge commit '7783f89cdbb3e3ba57f232552729715148e0b9a1' from hydra, Oleh Krehel, 2015/03/22