branch: master commit 1eee0f337a8021ef5de90fdf5e6b52638efe64fc Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
hydra.el (hydra-get-property): New defun. * hydra.el (hydra-set-property): Add doc. --- hydra.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hydra.el b/hydra.el index 67b1cb5..7166d32 100644 --- a/hydra.el +++ b/hydra.el @@ -782,6 +782,9 @@ BODY-AFTER-EXIT is added to the end of the wrapper." (defvar hydra-props-alist nil) (defun hydra-set-property (name key val) + "Set hydra property. +NAME is the symbolic name of the hydra. +KEY and VAL are forwarded to `plist-put'." (let ((entry (assoc name hydra-props-alist)) plist) (when (null entry) @@ -790,6 +793,14 @@ BODY-AFTER-EXIT is added to the end of the wrapper." (setq plist (cdr entry)) (setcdr entry (plist-put plist key val)))) +(defun hydra-get-property (name key) + "Get hydra property. +NAME is the symbolic name of the hydra. +KEY is forwarded to `plist-get'." + (let ((entry (assoc name hydra-props-alist))) + (when entry + (plist-get (cdr entry) key)))) + (defun hydra-show-hint (hint caller) (let ((verbosity (plist-get (cdr (assoc caller hydra-props-alist)) :verbosity)))