[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 1b1d31d 07/17: Support local hydra heads
From: |
Oleh Krehel |
Subject: |
[elpa] master 1b1d31d 07/17: Support local hydra heads |
Date: |
Tue, 10 Feb 2015 07:13:25 +0000 |
branch: master
commit 1b1d31d2d16f525d9f34b55ad5030d13c57f5c2f
Author: François Févotte <address@hidden>
Commit: François Févotte <address@hidden>
Support local hydra heads
Local heads are not bound in the global keymap, only in the transient
keymap.
---
hydra.el | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/hydra.el b/hydra.el
index 47f8670..ccc6279 100644
--- a/hydra.el
+++ b/hydra.el
@@ -163,14 +163,18 @@ It's possible to set this to nil.")
(and (consp x)
(memq (car x) '(function quote)))))
+(defun hydra--head-property (h prop)
+ "Return the value of property PROP for Hydra head H."
+ (let ((plist (if (stringp (cl-caddr h))
+ (cl-cdddr h)
+ (cddr h))))
+ (plist-get plist prop)))
+
(defun hydra--color (h body-color)
"Return the color of a Hydra head H with BODY-COLOR."
(if (null (cadr h))
'blue
- (let ((plist (if (stringp (cl-caddr h))
- (cl-cdddr h)
- (cddr h))))
- (or (plist-get plist :color) body-color))))
+ (or (hydra--head-property h :color) body-color)))
(defun hydra--face (h body-color)
"Return the face for a Hydra head H with BODY-COLOR."
@@ -393,7 +397,9 @@ in turn can be either red or blue."
,@(delq nil
(cl-mapcar
(lambda (head name)
- (unless (or (null body-key) (null method))
+ (unless (or (null body-key)
+ (null method)
+ (hydra--head-property head :local))
(list
(if (hydra--callablep method)
'funcall
- [elpa] master updated (61bddf2 -> 11b130e), Oleh Krehel, 2015/02/10
- [elpa] master b65db57 02/17: Update :post for amaranth Hydras, Oleh Krehel, 2015/02/10
- [elpa] master 9991985 01/17: hydra-test.el: update the test to not fail for older Emacs, Oleh Krehel, 2015/02/10
- [elpa] master 1660d71 05/17: Allow :pre and :post to be function symbols, Oleh Krehel, 2015/02/10
- [elpa] master 7ead8db 06/17: hydra.el (defhydra): Declare indent 2, Oleh Krehel, 2015/02/10
- [elpa] master 1b1d31d 07/17: Support local hydra heads,
Oleh Krehel <=
- [elpa] master 9a8e2f1 04/17: hydra.el (hydra-keyboard-quit): New custom var, Oleh Krehel, 2015/02/10
- [elpa] master 9b31ead 08/17: Update semantics for local heads to `:bind nil', Oleh Krehel, 2015/02/10
- [elpa] master 969fa66 10/17: fix typo - single not singe, Oleh Krehel, 2015/02/10
- [elpa] master d41be74 11/17: `hydra/body' will pass the initial `current-prefix-arg' along, Oleh Krehel, 2015/02/10
- [elpa] master ad771a4 03/17: Move defun-creating code into a defun, Oleh Krehel, 2015/02/10
- [elpa] master 763bb2a 13/17: Allow lambda :bind property for body and heads, Oleh Krehel, 2015/02/10
- [elpa] master 0712a43 12/17: README.md: update, Oleh Krehel, 2015/02/10
- [elpa] master d10c26e 14/17: Update comments and mark the old examples obsolete, Oleh Krehel, 2015/02/10
- [elpa] master 0c08964 16/17: README.md: update, Oleh Krehel, 2015/02/10
- [elpa] master 4ca646e 15/17: Allow a sexp as head's CMD paramater, Oleh Krehel, 2015/02/10