]> code.delx.au - gnu-emacs-elpa/commitdiff
hydra.el (defhydra): Avoid eager macroexpansion failure
authorOleh Krehel <ohwoeowho@gmail.com>
Sat, 28 Mar 2015 14:34:11 +0000 (15:34 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Sat, 28 Mar 2015 14:34:11 +0000 (15:34 +0100)
* hydra.el (defhydra): Don't test with keymapp, unless the symbol is
  bound. When the mode isn't loaded yet, the keymap symbol isn't bound.

hydra.el

index a3cdfac05e6f2928108c4edf2912fdb75bfe53e4..13bf080796c2137bf60b2dc3817fbd3891845514 100644 (file)
--- a/hydra.el
+++ b/hydra.el
@@ -959,7 +959,9 @@ result of `defhydra'."
                                 ((hydra--callablep bind)
                                  `(funcall ,bind ,final-key (function ,name)))
                                 ((and (symbolp bind)
-                                      (keymapp (symbol-value bind)))
+                                      (if (boundp bind)
+                                          (keymapp (symbol-value bind))
+                                        t))
                                  `(define-key ,bind ,final-key (function ,name)))
                                 (t
                                  (error "Invalid :bind property `%S' for head %S" bind  head)))))))