Skip to content

Commit

Permalink
hydra-examples.el: Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
abo-abo committed Mar 11, 2015
1 parent a867927 commit 5c2f420
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions hydra-examples.el
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@

;;** Example 4: toggle rarely used modes
(when (bound-and-true-p hydra-examples-verbatim)
(defvar whitespace-mode nil)
(global-set-key
(kbd "C-c C-v")
(defhydra hydra-toggle (:color blue)
Expand Down Expand Up @@ -167,15 +168,13 @@
_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"))
Expand All @@ -188,30 +187,31 @@ _w_ whitespace-mode: %`whitespace-mode
;;
;; This means that you actually see the state of the mode that you're changing.
;;** Example 8: the whole menu for `Buffer-menu-mode'
(defhydra hydra-buffer-menu (:color pink)
(defhydra hydra-buffer-menu (:color pink
:hint nil)
"
Mark Unmark Actions Search
------------------------------------------------------------------------- (__)
^Mark^ ^Unmark^ ^Actions^ ^Search
^^^^^^^^----------------------------------------------------------------- (__)
_m_: mark _u_: unmark _x_: execute _R_: re-isearch (oo)
_s_: save _U_: unmark up _b_: bury _I_: isearch /------\\/
_d_: delete _g_: refresh _O_: multi-occur / | ||
_D_: delete up _T_: files only: % -28`Buffer-menu-files-only * /\\---/\\
_~_: modified ~~ ~~
_d_: delete ^ ^ _g_: refresh _O_: multi-occur / | ||
_D_: delete up ^ ^ _T_: files only: % -28`Buffer-menu-files-only^^ * /\\---/\\
_~_: modified ^ ^ ^ ^ ^^ ~~ ~~
"
("m" Buffer-menu-mark nil)
("u" Buffer-menu-unmark nil)
("U" Buffer-menu-backup-unmark nil)
("d" Buffer-menu-delete nil)
("D" Buffer-menu-delete-backwards nil)
("s" Buffer-menu-save nil)
("~" Buffer-menu-not-modified nil)
("x" Buffer-menu-execute nil)
("b" Buffer-menu-bury nil)
("g" revert-buffer nil)
("T" Buffer-menu-toggle-files-only nil)
("O" Buffer-menu-multi-occur nil :color blue)
("I" Buffer-menu-isearch-buffers nil :color blue)
("R" Buffer-menu-isearch-buffers-regexp nil :color blue)
("m" Buffer-menu-mark)
("u" Buffer-menu-unmark)
("U" Buffer-menu-backup-unmark)
("d" Buffer-menu-delete)
("D" Buffer-menu-delete-backwards)
("s" Buffer-menu-save)
("~" Buffer-menu-not-modified)
("x" Buffer-menu-execute)
("b" Buffer-menu-bury)
("g" revert-buffer)
("T" Buffer-menu-toggle-files-only)
("O" Buffer-menu-multi-occur:color blue)
("I" Buffer-menu-isearch-buffers :color blue)
("R" Buffer-menu-isearch-buffers-regexp :color blue)
("c" nil "cancel")
("v" Buffer-menu-select "select" :color blue)
("o" Buffer-menu-other-window "other-window" :color blue)
Expand All @@ -221,12 +221,12 @@ _~_: modified
;;** Example 9: s-expressions in the docstring
;; You can inline s-expresssions into the docstring like this:
(when (bound-and-true-p hydra-examples-verbatim)
(eval-after-load 'dired
(defhydra hydra-marked-items (dired-mode-map "")
"
(require 'dired)
(defhydra hydra-marked-items (dired-mode-map "")
"
Number of marked items: %(length (dired-get-marked-files))
"
("m" dired-mark "mark"))))
("m" dired-mark "mark")))

;; This results in the following dynamic docstring:
;;
Expand Down

0 comments on commit 5c2f420

Please sign in to comment.