Skip to content

dustinlacewell/hera

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

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

About

Stack-based elisp API for Hydra

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages