This package provides a simple mechanism for nesting Hydras
Push current (if any) Hydra onto the stack and execute HYDRA-BODY.
Execute the Hydra ontop of the stack (if any).
Execute HYDRA-BODY after clearing the stack.
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.
(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))
(defhydra hydra-b (:color blue)
("SPC" (hera-pop) "exit" :exit t)
("c" (hera-push 'hydra-c/body) :exit t))
(defhydra hydra-c (:color blue)
("SPC" (hera-pop) "exit" :exit t)
("b" (hera-push 'hydra-b/body) :exit t))
(defun hera-test ()
(interactive)
(hera-start 'hydra-a/body))