[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 8bca51b 04/72: Warn about explict red heads on amaranth bo
From: |
Oleh Krehel |
Subject: |
[elpa] master 8bca51b 04/72: Warn about explict red heads on amaranth body |
Date: |
Fri, 06 Mar 2015 13:04:00 +0000 |
branch: master
commit 8bca51bfa18c931a433eb2de42d1a275384a8ae1
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Warn about explict red heads on amaranth body
* hydra.el (defhydra): With amaranth body, all heads that aren't blue
become amaranth. Specifying red explicitly does nothing. Add a check and
warn when this happens.
re #29
---
hydra.el | 23 ++++++++++++++---------
1 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/hydra.el b/hydra.el
index f57c9d3..fd24d0c 100644
--- a/hydra.el
+++ b/hydra.el
@@ -180,7 +180,7 @@ It's possible to set this to nil.")
(defun hydra--make-callable (x)
"Generate a callable symbol from X.
If X is a function symbol or a lambda, return it. Otherwise, it
-should be a single statement. Wrap it in an interactive lambda."
+should be a single statement. Wrap it in an interactive lambda."
(if (or (symbolp x) (functionp x))
x
`(lambda ()
@@ -419,14 +419,19 @@ except a blue head can stop the Hydra state.
(if (cl-some `(lambda (h)
(eq (hydra--color h ',body-color) 'blue))
heads)
- (define-key keymap [t]
- `(lambda ()
- (interactive)
- (message "An amaranth Hydra can only exit through a blue head")
- (hydra-set-transient-map hydra-curr-map t)
- (when hydra-is-helpful
- (sit-for 0.8)
- (message ,hint))))
+ (progn
+ (when (cl-some `(lambda (h)
+ (eq (hydra--color h ',body-color) 'red))
+ heads)
+ (warn "Amaranth body color: upgrading all red heads to
amaranth"))
+ (define-key keymap [t]
+ `(lambda ()
+ (interactive)
+ (message "An amaranth Hydra can only exit through a blue
head")
+ (hydra-set-transient-map hydra-curr-map t)
+ (when hydra-is-helpful
+ (sit-for 0.8)
+ (message ,hint)))))
(error "An amaranth Hydra must have at least one blue head in order to
exit"))
(when hydra-keyboard-quit
(define-key keymap hydra-keyboard-quit
- [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 <=
- [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, 2015/03/06
- [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