branch: master commit dfe127346d4678003bbf86f04293a1a1746ea443 Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
Simplify and improve the generated defuns * hydra.el (hydra-create): Update. --- hydra.el | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hydra.el b/hydra.el index 915ab9d..067b629 100644 --- a/hydra.el +++ b/hydra.el @@ -128,12 +128,12 @@ When `(keymapp METHOD)`, it becomes: `(defun ,name () ,(format "%s\n\nCall the head: `%S'." doc (cadr head)) (interactive) - (if (null ',(cadr head)) - (funcall hydra-last) - (call-interactively #',(cadr head)) - (when hydra-is-helpful - (message ,hint)) - (setq hydra-last (set-transient-map ',keymap t))))) + ,@(if (null (cadr head)) + '((funcall hydra-last)) + `((call-interactively #',(cadr head)) + (when hydra-is-helpful + (message ,hint)) + (setq hydra-last (set-transient-map ',keymap t)))))) heads names) (defun ,(intern (format "hydra-%s-body" body)) () ,doc