[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a72d68a 28/36: hydra.el (hydra-fontify-head-default): Fix
From: |
Oleh Krehel |
Subject: |
[elpa] master a72d68a 28/36: hydra.el (hydra-fontify-head-default): Fix head keys as "%f" |
Date: |
Sat, 22 Jul 2017 11:22:25 -0400 (EDT) |
branch: master
commit a72d68a0f6492af6201fbdb88211cb2f7488f3be
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
hydra.el (hydra-fontify-head-default): Fix head keys as "%f"
Fixes #223
For example, this should work now:
(defhydra hydra-test ()
"test"
("%f" forward-char))
---
hydra.el | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/hydra.el b/hydra.el
index 61fb01c..eaedd6c 100644
--- a/hydra.el
+++ b/hydra.el
@@ -555,18 +555,17 @@ 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 (if (string= (car head) "%")
- "%%"
- (car head))
- 'face
- (or (hydra--head-property head :face)
- (cl-case head-color
- (blue 'hydra-face-blue)
- (red 'hydra-face-red)
- (amaranth 'hydra-face-amaranth)
- (pink 'hydra-face-pink)
- (teal 'hydra-face-teal)
- (t (error "Unknown color for %S" head)))))))
+ (propertize
+ (replace-regexp-in-string "%" "%%" (car head))
+ 'face
+ (or (hydra--head-property head :face)
+ (cl-case head-color
+ (blue 'hydra-face-blue)
+ (red 'hydra-face-red)
+ (amaranth 'hydra-face-amaranth)
+ (pink 'hydra-face-pink)
+ (teal 'hydra-face-teal)
+ (t (error "Unknown color for %S" head)))))))
(defun hydra-fontify-head-greyscale (head _body)
"Produce a pretty string from HEAD and BODY.
- [elpa] master 200a444 10/36: hydra.el (hydra--hint): Revert return "" for :hint nil, (continued)
- [elpa] master 200a444 10/36: hydra.el (hydra--hint): Revert return "" for :hint nil, Oleh Krehel, 2017/07/22
- [elpa] master 798684a 13/36: hydra-examples.el: Don't byte-compile, Oleh Krehel, 2017/07/22
- [elpa] master 1eee0f3 18/36: hydra.el (hydra-get-property): New defun., Oleh Krehel, 2017/07/22
- [elpa] master 272dc4a 05/36: hydra.el (hydra-docstring-keys-translate-alist): Update, Oleh Krehel, 2017/07/22
- [elpa] master 5be27f4 02/36: Add a shortcut to supply a head's eval-able docstring, Oleh Krehel, 2017/07/22
- [elpa] master 585db09 17/36: hydra-examples.el: Add example of setting verbosity, Oleh Krehel, 2017/07/22
- [elpa] master 6d5bdf7 11/36: Introduce (:hint none), Oleh Krehel, 2017/07/22
- [elpa] master 76d51ec 23/36: Fix compile warnings, Oleh Krehel, 2017/07/22
- [elpa] master dd5f703 27/36: hydra.el: Use error-message-string, not message, Oleh Krehel, 2017/07/22
- [elpa] master d2aaf86 20/36: Fix e.g. _f_(foo) in format string, Oleh Krehel, 2017/07/22
- [elpa] master a72d68a 28/36: hydra.el (hydra-fontify-head-default): Fix head keys as "%f",
Oleh Krehel <=
- [elpa] master 3527b32 24/36: Fix byte compiler warnings, Oleh Krehel, 2017/07/22
- [elpa] master 943636f 35/36: hydra.el: Bump version, Oleh Krehel, 2017/07/22
- [elpa] master 3db82e5 29/36: Implement named columns, Oleh Krehel, 2017/07/22
- [elpa] master 95008ea 30/36: hydra.el: Add automatic lookup for remaped cmd, Oleh Krehel, 2017/07/22
- [elpa] master 32b8352 36/36: Merge commit '943636fe4a35298d9d234222bc4520dec9ef2305' from hydra, Oleh Krehel, 2017/07/22
- [elpa] master 91f8e7c 22/36: hydra.el: Bump version, Oleh Krehel, 2017/07/22
- [elpa] master a85a617 03/36: Allow to use e.g. "↑" in place of "<up>" in the docstring, Oleh Krehel, 2017/07/22
- [elpa] master 9c2589f 19/36: Update the package description, Oleh Krehel, 2017/07/22
- [elpa] master 63de503 21/36: hydra.el (hydra-key-regex): Add "$", Oleh Krehel, 2017/07/22
- [elpa] master 81d88e4 15/36: hydra.el (hydra-show-hint): Extract from defhydra, Oleh Krehel, 2017/07/22