Hera (ˈhɛrə, ˈhɪərə; Greek: Ἥρᾱ Hērā, equivalently Ἥρη Hērē, in Ionic and Homer) is the goddess of women and marriage in Greek mythology and religion. She is the daughter of the Titans Cronus and Rhea.
Slain by Hercules, Hera created the Hydra constellation.
This code allows the registration of major-mode specific hydras, and a default one. Any hydra is of course free to show the default hydra if wanted.
;; this is an alist of major mode -> hydra body
(defvar hera-hydras nil)
;; the hydra body to run if no major mode specific hydra is set
(defvar hera-default-hydra nil)
;; return the hydra body for the current mode, or the default one
(defun hera--current-hydra ()
(or (second (assoc major-mode hera-hydras)) hera-default-hydra))
;; execute the hydra body for the current mode, or the default one
(defun hera-run ()
(interactive)
(let ((context (hera--current-context)))
(when context (funcall (second context)))))
;; bind hera-run
(global-set-key (kbd "<f19>") 'hera-run)