[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 9769143 25/72: hydra-examples.el: Add example 7
From: |
Oleh Krehel |
Subject: |
[elpa] master 9769143 25/72: hydra-examples.el: Add example 7 |
Date: |
Fri, 06 Mar 2015 13:04:08 +0000 |
branch: master
commit 976914322d7db3294b9dfffb73d89ed738397d40
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
hydra-examples.el: Add example 7
---
hydra-examples.el | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/hydra-examples.el b/hydra-examples.el
index 3a23d8a..586bb2f 100644
--- a/hydra-examples.el
+++ b/hydra-examples.el
@@ -160,6 +160,33 @@
;; This example will bind "C-x `" in `global-map', but it will not
;; bind "C-x j" and "C-x k".
;; You can still "C-x `jjk" though.
+;;** Example 7: toggle with Ruby-style docstring
+(when (bound-and-true-p hydra-examples-verbatim)
+ (defhydra hydra-toggle (:color pink)
+ "
+_a_ abbrev-mode: %`abbrev-mode
+_d_ debug-on-error: %`debug-on-error
+_f_ auto-fill-mode: %`auto-fill-function
+_g_ golden-ratio-mode: %`golden-ratio-mode
+_t_ truncate-lines: %`truncate-lines
+_w_ whitespace-mode: %`whitespace-mode
+
+"
+ ("a" abbrev-mode nil)
+ ("d" toggle-debug-on-error nil)
+ ("f" auto-fill-mode nil)
+ ("g" golden-ratio-mode nil)
+ ("t" toggle-truncate-lines nil)
+ ("w" whitespace-mode nil)
+ ("q" nil "quit"))
+ (global-set-key (kbd "C-c C-v") 'hydra-toggle/body))
+
+;; Here, using e.g. "_a_" translates to "a" with proper face.
+;; More interestingly:
+;;
+;; "foobar %`abbrev-mode" means roughly (format "foobar %S" abbrev-mode)
+;;
+;; This means that you actually see the state of the mode that you're changing.
;;* Windmove helpers
(require 'windmove)
- [elpa] master 216550e 06/72: Add option to font-lock `defhydra', (continued)
- [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
- [elpa] master 9769143 25/72: hydra-examples.el: Add example 7,
Oleh Krehel <=
- [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
- [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