[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 926d9a4 15/72: Add pink body color
From: |
Oleh Krehel |
Subject: |
[elpa] master 926d9a4 15/72: Add pink body color |
Date: |
Fri, 06 Mar 2015 13:04:05 +0000 |
branch: master
commit 926d9a4b28032cdfbcade78468e78ff33f2cfd9b
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Add pink body color
* hydra.el (hydra-face-pink): New face.
(hydra--face): Update.
(defhydra): Pink is a variation on amaranth. It still intercepts all
bindings, but will call the intercepted bindings if they're valid.
Re #38.
---
hydra.el | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/hydra.el b/hydra.el
index f4c0842..ff03722 100644
--- a/hydra.el
+++ b/hydra.el
@@ -116,6 +116,10 @@ It's possible to set this to nil.")
(defface hydra-face-amaranth
'((t (:foreground "#E52B50" :bold t)))
"Amaranth Hydra can exit only through a blue head.")
+
+(defface hydra-face-pink
+ '((t (:foreground "#FF6EB4" :bold t)))
+ "Amaranth Hydra can exit only through a blue head.")
;;* Fontification
(defun hydra-add-font-lock ()
"Fontify `defhydra' statements."
@@ -223,6 +227,7 @@ Return DEFAULT if PROP is not in H."
(blue 'hydra-face-blue)
(red 'hydra-face-red)
(amaranth 'hydra-face-amaranth)
+ (pink 'hydra-face-pink)
(t (error "Unknown color for %S" h))))
(defun hydra--hint (docstring heads body-color)
@@ -430,7 +435,7 @@ result of `defhydra'."
(setq body-pre `(funcall #',body-pre)))
(when (and body-post (symbolp body-post))
(setq body-post `(funcall #',body-post)))
- (when (eq body-color 'amaranth)
+ (when (memq body-color '(amaranth pink))
(if (cl-some `(lambda (h)
(eq (hydra--color h ',body-color) 'blue))
heads)
@@ -438,17 +443,22 @@ result of `defhydra'."
(when (cl-some `(lambda (h)
(eq (hydra--color h ',body-color) 'red))
heads)
- (warn "Amaranth body color: upgrading all red heads to
amaranth"))
+ (warn "%S body color: upgrading all red heads to %S" body-color
body-color))
(define-key keymap [t]
`(lambda ()
(interactive)
- (message "An amaranth Hydra can only exit through a blue
head")
+ ,@(if (eq body-color 'amaranth)
+ '((message "An amaranth Hydra can only exit through a
blue head"))
+ '((let ((kb (key-binding (this-command-keys))))
+ (if kb
+ (call-interactively kb)
+ (message "A pink Hydra can only exit through a
blue head")))))
(hydra-set-transient-map hydra-curr-map t)
(when hydra-is-helpful
(unless hydra-lv
(sit-for 0.8))
(,hint-name)))))
- (error "An amaranth Hydra must have at least one blue head in order to
exit"))
+ (error "An %S Hydra must have at least one blue head in order to exit"
body-color))
(when hydra-keyboard-quit
(define-key keymap hydra-keyboard-quit
`(lambda ()
- [elpa] master updated (ffa5405 -> 3222b0c), Oleh Krehel, 2015/03/06
- [elpa] master bb38641 05/72: hydra.el (hydra--make-defun): simplify, Oleh Krehel, 2015/03/06
- [elpa] master 614e1f7 07/72: `defhydra' should be indented as `defun', Oleh Krehel, 2015/03/06
- [elpa] master 8bca51b 04/72: Warn about explict red heads on amaranth body, Oleh Krehel, 2015/03/06
- [elpa] master 216550e 06/72: Add option to font-lock `defhydra', Oleh Krehel, 2015/03/06
- [elpa] master f3c4dd7 02/72: hydra.el (hydra--hint): allow duplicate functions in heads, Oleh Krehel, 2015/03/06
- [elpa] master 62f9b05 01/72: Allow some heads with no hints, Oleh Krehel, 2015/03/06
- [elpa] master f04f14c 14/72: hydra.el (defhydra): Update doc, Oleh Krehel, 2015/03/06
- [elpa] master 2086614 10/72: hydra.el (defhydradio): New macro, Oleh Krehel, 2015/03/06
- [elpa] master d04ef9b 12/72: hydra.el (hydra-cleanup): reorder, Oleh Krehel, 2015/03/06
- [elpa] master 926d9a4 15/72: Add pink body color,
Oleh Krehel <=
- [elpa] master d25e560 03/72: Fix head color for heads with nil as HINT, Oleh Krehel, 2015/03/06
- [elpa] master abb76e8 13/72: lv.el (lv-message): Don't deactivate mark, Oleh Krehel, 2015/03/06
- [elpa] master 81ffca0 20/72: Update faces, Oleh Krehel, 2015/03/06
- [elpa] master 9769143 25/72: hydra-examples.el: Add example 7, Oleh Krehel, 2015/03/06
- [elpa] master c049a33 16/72: Allow for Ruby-style Hydra docstrings, Oleh Krehel, 2015/03/06
- [elpa] master 688e8fd 23/72: hydra.el (hydra--head-color): fix for teal color, Oleh Krehel, 2015/03/06
- [elpa] master 0cda4ce 26/72: Fix typos, Oleh Krehel, 2015/03/06
- [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