[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 6f7cef2 22/72: Add teal body color
From: |
Oleh Krehel |
Subject: |
[elpa] master 6f7cef2 22/72: Add teal body color |
Date: |
Fri, 06 Mar 2015 13:04:07 +0000 |
branch: master
commit 6f7cef2600ea3a8ecd3d26e02936785d8329ceb4
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Add teal body color
* hydra.el (hydra-face-teal): New face.
(hydra--face): Update.
(defhydra): Teal color is the same as amaranth, except the heas inherit
blue instead of red.
This Hydra can reasonably be either blue or teal:
(global-set-key
(kbd "C-c C-v")
(defhydra hydra-toggle (:color teal)
"toggle"
("a" abbrev-mode "abbrev")
("d" toggle-debug-on-error "debug")
("f" auto-fill-mode "fill")
("t" toggle-truncate-lines "truncate")
("w" whitespace-mode "whitespace")
("q" nil "cancel")))
---
hydra.el | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/hydra.el b/hydra.el
index dbf3cf2..cfebf5e 100644
--- a/hydra.el
+++ b/hydra.el
@@ -122,6 +122,12 @@ Vanquishable only through a blue head.")
'((t (:foreground "#FF6EB4" :bold t)))
"Pink body has red heads and on intercepting non-heads calls them without
quitting.
Vanquishable only through a blue head.")
+
+(defface hydra-face-teal
+ '((t (:foreground "#367588" :bold t)))
+ "Teal body has blue heads an warns on intercepting non-heads.
+Vanquishable only through a blue head.")
+
;;* Fontification
(defun hydra-add-font-lock ()
"Fontify `defhydra' statements."
@@ -235,6 +241,7 @@ BODY is the second argument to `defhydra'"
(red 'hydra-face-red)
(amaranth 'hydra-face-amaranth)
(pink 'hydra-face-pink)
+ (teal 'hydra-face-teal)
(t (error "Unknown color for %S" h))))
(defun hydra-cleanup ()
@@ -473,7 +480,7 @@ result of `defhydra'."
(setq body-pre `(funcall #',body-pre)))
(when (and body-post (symbolp body-post))
(setq body-post `(funcall #',body-post)))
- (when (memq body-color '(amaranth pink))
+ (when (memq body-color '(amaranth pink teal))
(if (cl-some `(lambda (h)
(eq (hydra--head-color h ',body-color) 'blue))
heads)
@@ -488,8 +495,9 @@ result of `defhydra'."
`(lambda ()
(interactive)
,@(if
- (eq body-color 'amaranth)
- '((message "An amaranth Hydra can only exit through a blue
head"))
+ (memq body-color '(amaranth teal))
+ `((message ,(format "An %S Hydra can only exit through a
blue head"
+ body-color)))
'((let ((kb (key-binding (this-command-keys))))
(if kb
(if (commandp kb)
- [elpa] master caf114a 11/72: Fix unintentional recursion in Emacs 25, (continued)
- [elpa] master caf114a 11/72: Fix unintentional recursion in Emacs 25, Oleh Krehel, 2015/03/06
- [elpa] master c7281e9 17/72: Minor refactoring, Oleh Krehel, 2015/03/06
- [elpa] master 06b35f7 08/72: Remove obsoletes, Oleh Krehel, 2015/03/06
- [elpa] master 806e04b 09/72: Don't clutter Echo Area, Oleh Krehel, 2015/03/06
- [elpa] master 4f0ef62 27/72: hydra.el (hydra-pink-fallback): Add, Oleh Krehel, 2015/03/06
- [elpa] master 4aa8826 18/72: hydra.el (hydra--message): Take same arguments as `defhydra', Oleh Krehel, 2015/03/06
- [elpa] master b81d078 29/72: Generate a global resetter in `defhydradio', Oleh Krehel, 2015/03/06
- [elpa] master 42cb833 21/72: hydra.el (hydra--hint): Take same arguments as `defhydra', Oleh Krehel, 2015/03/06
- [elpa] master 0a3cc60 30/72: Add compat color-less syntax, Oleh Krehel, 2015/03/06
- [elpa] master 92e1922 19/72: hydra.el (hydra--hint): Take same arguments as `defhydra', Oleh Krehel, 2015/03/06
- [elpa] master 6f7cef2 22/72: Add teal body color,
Oleh Krehel <=
- [elpa] master 7010772 32/72: hydra.el (hydra--head-color): Improve, Oleh Krehel, 2015/03/06
- [elpa] master d0e8d57 33/72: hydra.el (hydra-add-font-lock): Add `defhydradio', Oleh Krehel, 2015/03/06
- [elpa] master 0881733 28/72: hydra.el (defhydra): Fix typo, Oleh Krehel, 2015/03/06
- [elpa] master a4c4eb6 36/72: Add example for `Buffer-menu-mode', Oleh Krehel, 2015/03/06
- [elpa] master 88b32d5 24/72: hydra.el (hydra--hint): Add exception, Oleh Krehel, 2015/03/06
- [elpa] master c41c932 31/72: README.md: fix tables, Oleh Krehel, 2015/03/06
- [elpa] master 1eebfed 34/72: Allow `format'-style width specifiers in docstring, Oleh Krehel, 2015/03/06
- [elpa] master e962ff1 39/72: hydra.el: remove no :pre, :post restriction for Emacs<24.4, Oleh Krehel, 2015/03/06
- [elpa] master a6c6a55 38/72: Improve compatibility for Emacs <= 24.3, Oleh Krehel, 2015/03/06
- [elpa] master 2c01db0 42/72: hydra.el (hydra--handle-nonhead): Update signature, Oleh Krehel, 2015/03/06