emacs-elpa-diffs
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]