]> code.delx.au - gnu-emacs-elpa/commitdiff
ivy-hydra.el (defhydra): Wrap in eval-when-compile
authorOleh Krehel <ohwoeowho@gmail.com>
Tue, 16 Jun 2015 14:08:23 +0000 (16:08 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Tue, 16 Jun 2015 14:08:23 +0000 (16:08 +0200)
ivy-hydra.el

index a5b4dde98e07ebc8690f7eb53b1c92f4a9f2bad6..38a346700205b531c769eed01ef26efacbbc0def 100644 (file)
 (require 'hydra nil t)
 (require 'ivy)
 
-(unless (package-installed-p 'hydra)
-  (defmacro defhydra (name &rest _)
-    "This is a stub for the uninstalled `hydra' package."
-    `(defun ,(intern (format "%S/body" name)) ()
-       (interactive)
-       (let ((enable-recursive-minibuffers t))
-         (if (yes-or-no-p "Package `hydra' not installed. Install?")
-             (progn
-               (package-install 'hydra)
-               (save-window-excursion
-                 (find-library "ivy-hydra")
-                 (byte-compile-file (buffer-file-name) t)))
-           (error "Please install `hydra' and recompile/reinstall `ivy-hydra'"))))))
+(eval-when-compile
+  (unless (package-installed-p 'hydra)
+    (defmacro defhydra (name &rest _)
+      "This is a stub for the uninstalled `hydra' package."
+      `(defun ,(intern (format "%S/body" name)) ()
+         (interactive)
+         (let ((enable-recursive-minibuffers t))
+           (if (yes-or-no-p "Package `hydra' not installed. Install?")
+               (progn
+                 (package-install 'hydra)
+                 (save-window-excursion
+                   (find-library "ivy-hydra")
+                   (byte-compile-file (buffer-file-name) t)))
+             (error "Please install `hydra' and recompile/reinstall `ivy-hydra'")))))))
 
 (defhydra hydra-ivy (:hint nil
                      :color pink)