[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master fd8e1b9 02/22: hydra.el (hydra-fontify-head-default): Add
From: |
Oleh Krehel |
Subject: |
[elpa] master fd8e1b9 02/22: hydra.el (hydra-fontify-head-default): Add "%" exception |
Date: |
Fri, 16 Oct 2015 10:06:54 +0000 |
branch: master
commit fd8e1b96178954d21b04cfc32b19bd5573718d61
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
hydra.el (hydra-fontify-head-default): Add "%" exception
* hydra.el (hydra--hint): Simplify.
Fixes #126
---
hydra.el | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/hydra.el b/hydra.el
index 7e67b2c..67a345e 100644
--- a/hydra.el
+++ b/hydra.el
@@ -425,17 +425,16 @@ BODY, and HEADS are parameters to `defhydra'."
(cons (cadr h)
(cons pstr (cl-caddr h)))
alist)))))
- (mapconcat
- (lambda (x)
- (format
- (if (> (length (cdr x)) 0)
- (concat "[%s]: " (cdr x))
- "%s")
- (if (equal (car x) "%")
- "%%"
- (car x))))
- (nreverse (mapcar #'cdr alist))
- ", ")))
+ (let ((keys (nreverse (mapcar #'cdr alist))))
+ (mapconcat
+ (lambda (x)
+ (format
+ (if (> (length (cdr x)) 0)
+ (concat "[%s]: " (cdr x))
+ "%s")
+ (car x)))
+ keys
+ ", "))))
(defvar hydra-fontify-head-function nil
"Possible replacement for `hydra-fontify-head-default'.")
@@ -457,7 +456,9 @@ HEAD's binding is returned as a string with a colored face."
(when (and (null (cadr head))
(not head-exit))
(hydra--complain "nil cmd can only be blue"))
- (propertize (car head) 'face
+ (propertize (if (string= (car head) "%")
+ "%%"
+ (car head)) 'face
(cl-case head-color
(blue 'hydra-face-blue)
(red 'hydra-face-red)
- [elpa] master updated (2eb4c54 -> bfeccce), Oleh Krehel, 2015/10/16
- [elpa] master fd8e1b9 02/22: hydra.el (hydra-fontify-head-default): Add "%" exception,
Oleh Krehel <=
- [elpa] master a2f8a23 01/22: Allow to escape ^ in docstrings, Oleh Krehel, 2015/10/16
- [elpa] master 2d45839 03/22: lv-window: split-window ignores window parameters, Oleh Krehel, 2015/10/16
- [elpa] master fca56c3 07/22: targets/hydra-init.el: Move, Oleh Krehel, 2015/10/16
- [elpa] master 1a13273 06/22: Allow to pause arbitrary hydras to the stack, Oleh Krehel, 2015/10/16
- [elpa] master adc2997 08/22: Allow for "_[_" and "_]_" in docs, Oleh Krehel, 2015/10/16
- [elpa] master 1acd5f6 05/22: hydra.el (hydra-face-blue): Customize for dark themes, Oleh Krehel, 2015/10/16
- [elpa] master c8b4749 09/22: Allow binding heads to "%", Oleh Krehel, 2015/10/16
- [elpa] master 7aa8187 13/22: Allow to specify :face for each head, Oleh Krehel, 2015/10/16
- [elpa] master df7b079 10/22: hydra.el (hydra-head-format): Customize the key formatting, Oleh Krehel, 2015/10/16
- [elpa] master 900ca34 04/22: Allow access to the current hydra body, Oleh Krehel, 2015/10/16