hydra.el (hydra-default-hint): Add option

master
justbur 10 years ago
parent e0454a1005
commit 69529aded3
  1. 12
      hydra.el

@ -193,6 +193,12 @@ warn: keep KEYMAP and issue a warning instead of running the command."
:type 'boolean :type 'boolean
:group 'hydra) :group 'hydra)
(defcustom hydra-default-hint ""
"Default :hint property to use for heads when not specified in
the body or the head."
:type 'sexp
:group 'hydra)
(defcustom hydra-lv t (defcustom hydra-lv t
"When non-nil, `lv-message' (not `message') will be used to display hints." "When non-nil, `lv-message' (not `message') will be used to display hints."
:type 'boolean) :type 'boolean)
@ -975,7 +981,8 @@ result of `defhydra'."
((= len 2) ((= len 2)
(setcdr (cdr h) (setcdr (cdr h)
(list (list
(hydra-plist-get-default body-plist :hint ""))) (hydra-plist-get-default
body-plist :hint hydra-default-hint)))
(setcdr (nthcdr 2 h) (list :exit body-exit))) (setcdr (nthcdr 2 h) (list :exit body-exit)))
(t (t
(let ((hint (cl-caddr h))) (let ((hint (cl-caddr h)))
@ -983,7 +990,8 @@ result of `defhydra'."
(stringp hint) (stringp hint)
(stringp (eval hint))) (stringp (eval hint)))
(setcdr (cdr h) (cons (setcdr (cdr h) (cons
(hydra-plist-get-default body-plist :hint "") (hydra-plist-get-default
body-plist :hint hydra-default-hint)
(cddr h))))) (cddr h)))))
(let ((hint-and-plist (cddr h))) (let ((hint-and-plist (cddr h)))
(if (null (cdr hint-and-plist)) (if (null (cdr hint-and-plist))

Loading…
Cancel
Save