[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 7aa8187 13/22: Allow to specify :face for each head
From: |
Oleh Krehel |
Subject: |
[elpa] master 7aa8187 13/22: Allow to specify :face for each head |
Date: |
Fri, 16 Oct 2015 10:06:58 +0000 |
branch: master
commit 7aa818795758d09ec0c2dd0fdc37e5e418f03f48
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Allow to specify :face for each head
* hydra.el (hydra-fontify-head-default): Update - :face will override
any previously calculated face (red/blue/pink...).
Example:
(defface hydra-face-orange
'((t (:foreground "orange" :bold t)))
"Orange face. For fun.")
(defhydra hydra-projectile (:color blue
:columns 4)
"Projectile"
("a" projectile-ag "ag" :face 'hydra-face-orange)
("b" projectile-switch-to-buffer "switch to buffer")
("c" projectile-invalidate-cache "cache clear")
("d" projectile-find-dir "dir")
("s-f" projectile-find-file "file")
("ff" projectile-find-file-dwim "file dwim")
("fd" projectile-find-file-in-directory "file curr dir")
("g" ggtags-update-tags "update gtags")
("i" projectile-ibuffer "Ibuffer")
("K" projectile-kill-buffers "Kill all buffers")
("o" projectile-multi-occur "multi-occur")
("p" projectile-switch-project "switch")
("r" projectile-recentf "recent file")
("x" projectile-remove-known-project "remove known")
("X" projectile-cleanup-known-projects "cleanup non-existing")
("z" projectile-cache-current-file "cache current")
("q" nil "cancel"))
---
hydra.el | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/hydra.el b/hydra.el
index ef2c5a9..73d6621 100644
--- a/hydra.el
+++ b/hydra.el
@@ -505,13 +505,14 @@ HEAD's binding is returned as a string with a colored
face."
"%%"
(car 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))))))
+ (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 updated (2eb4c54 -> bfeccce), Oleh Krehel, 2015/10/16
- [elpa] master fd8e1b9 02/22: hydra.el (hydra-fontify-head-default): Add "%" exception, Oleh Krehel, 2015/10/16
- [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 <=
- [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
- [elpa] master 1e9276a 12/22: Remove trailing whitespace from :columns docstring, Oleh Krehel, 2015/10/16
- [elpa] master 852ae26 14/22: Use quote instead of function to prevent compiler warnings, Oleh Krehel, 2015/10/16
- [elpa] master ea36afc 19/22: Allow "_", "!", and "&" as keys in docstrings, Oleh Krehel, 2015/10/16
- [elpa] master f58d356 17/22: Allow #'command syntax for heads, just to have it, Oleh Krehel, 2015/10/16
- [elpa] master 27b7f40 15/22: Make find-function work with defhydra, Oleh Krehel, 2015/10/16
- [elpa] master 3fb3168 18/22: hydra.el (hydra--format): Allow "@" key in the docs, Oleh Krehel, 2015/10/16
- [elpa] master 336602f 11/22: Add :columns option for hydra body, Oleh Krehel, 2015/10/16
- [elpa] master 4bf7f1c 21/22: Bump version, Oleh Krehel, 2015/10/16