Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* hydra.el (hydra-plist-get-default): New defun, extended `plist-get'. (hydra--head-property): Use `hydra-plist-get-default'. (defhydra): The heads will inherit their hint from body :hint parameter. They can override it, of course. The most use you can get out of this parameter is to specify :hint nil for hydras with a format-style docstring. Example: (defhydra hydra-org-template (:color blue :hint nil) " _c_enter _q_uote _L_aTeX: _l_atex _e_xample _i_ndex: _a_scii _v_erse _I_NCLUDE: _s_rc ^ ^ _H_TML: _h_tml ^ ^ _A_SCII: " ("s" (hot-expand "<s")) ("e" (hot-expand "<e")) ("q" (hot-expand "<q")) ("v" (hot-expand "<v")) ("c" (hot-expand "<c")) ("l" (hot-expand "<l")) ("h" (hot-expand "<h")) ("a" (hot-expand "<a")) ("L" (hot-expand "<L")) ("i" (hot-expand "<i")) ("I" (hot-expand "<I")) ("H" (hot-expand "<H")) ("A" (hot-expand "<A")) ("<" self-insert-command "ins") ("o" nil "quit")) Some setup: (defun hot-expand (str) "Expand org template." (insert str) (org-try-structure-completion)) (define-key org-mode-map "<" (lambda () (interactive) (if (looking-back "^") (hydra-org-template/body) (self-insert-command 1))))
- Loading branch information