Skip to content

Latest commit

 

History

History
executable file
·
55 lines (40 loc) · 1.26 KB

README.org

File metadata and controls

executable file
·
55 lines (40 loc) · 1.26 KB

Hera

This package provides a simple mechanism for nesting Hydras

api

hera-push HYDRA-BODY

Push current (if any) Hydra onto the stack and execute HYDRA-BODY.

hera-pop

Execute the Hydra ontop of the stack (if any).

hera-start HYDRA-BODY

Execute HYDRA-BODY after clearing the stack.

example

Here are three Hydras, hydra-a, hydra-b, hydra-c.

Notice that heads that exit call (hera-pop) so any stacked Hydras will be re-shown.

Notice also how when using (hera-push) the head always specifies :exit t. This is very important.

Use (hera-start) to execute the first Hydra with a fresh stack.

hydra-a

(defhydra hydra-a (:color blue)
  ("SPC" (hera-pop) "exit" :exit t)
  ("b" (hera-push 'hydra-b/body) :exit t)
  ("c" (hera-push 'hydra-c/body) :exit t))

hydra-b

(defhydra hydra-b (:color blue)
  ("SPC" (hera-pop) "exit" :exit t)
  ("c" (hera-push 'hydra-c/body) :exit t))

hydra-c

(defhydra hydra-c (:color blue)
  ("SPC" (hera-pop) "exit" :exit t)
  ("b" (hera-push 'hydra-b/body) :exit t))

test

(defun hera-test ()
  (interactive)
  (hera-start 'hydra-a/body))