[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 62f9b05 01/72: Allow some heads with no hints
From: |
Oleh Krehel |
Subject: |
[elpa] master 62f9b05 01/72: Allow some heads with no hints |
Date: |
Fri, 06 Mar 2015 13:03:58 +0000 |
branch: master
commit 62f9b058f4e680b7cc89e46df05a23571349c846
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Allow some heads with no hints
* hydra.el (hydra--hint): If the HINT part of HEAD is explicitely nil,
omit it from the compound hint.
Example:
(global-set-key
(kbd "C-M-o")
(defhydra hydra-window (:color amaranth)
"window"
("h" windmove-left nil)
("j" windmove-down nil)
("k" windmove-up nil)
("l" windmove-right nil)
("v" (lambda ()
(interactive)
(split-window-right)
(windmove-right))
"vert")
("x" (lambda ()
(interactive)
(split-window-below)
(windmove-down))
"horz")
("q" nil "cancel")))
Here, "h", "j", "k", "l" will not be in the echo area.
---
hydra.el | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/hydra.el b/hydra.el
index 2770fbc..a1bc9e9 100644
--- a/hydra.el
+++ b/hydra.el
@@ -225,7 +225,12 @@ It's intended for the echo area, when a Hydra is active."
(propertize
(car h) 'face
(hydra--face h body-color))))
- heads ", ")))
+ (cl-remove-if
+ (lambda (x)
+ (and (> (length x) 2)
+ (null (cl-caddr x))))
+ heads)
+ ", ")))
(defun hydra-disable ()
"Disable the current Hydra."
- [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 <=
- [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
- [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