Stack-based elisp API for Hydra
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.org
hera.el
hera.org

README.org

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))