]> code.delx.au - gnu-emacs-elpa/commitdiff
Use quote instead of function to prevent compiler warnings
authorOleh Krehel <ohwoeowho@gmail.com>
Thu, 23 Jul 2015 08:54:50 +0000 (10:54 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Thu, 23 Jul 2015 08:54:50 +0000 (10:54 +0200)
* hydra.el (defhydra): In generated `define-key' statement use `quote'
  instead of `function'.

* hydra-test.el (hydra-red-error): Update test.

This should fix the byte compiler warning for hydra-examples.el.

hydra-test.el
hydra.el

index dd6f31e5b20cf17ee4eb6c7e87944ad755402101..cc871a7d6221d1760aa30f20f1e86df29d94785d 100644 (file)
@@ -119,14 +119,14 @@ Call the head: `first-error'."
           (setq hydra-curr-body-fn
                 (quote hydra-error/body)))
         (condition-case err
-            (progn
-              (setq this-command
-                    (quote first-error))
-              (call-interactively
-               (function first-error)))
-          ((quit error)
-           (message "%S" err)
-           (unless hydra-lv (sit-for 0.8))))
+                        (progn
+                          (setq this-command
+                                (quote first-error))
+                          (call-interactively
+                           (function first-error)))
+                        ((quit error)
+                         (message "%S" err)
+                         (unless hydra-lv (sit-for 0.8))))
         (when hydra-is-helpful
           (if hydra-lv
               (lv-message
@@ -157,14 +157,14 @@ Call the head: `next-error'."
           (setq hydra-curr-body-fn
                 (quote hydra-error/body)))
         (condition-case err
-            (progn
-              (setq this-command
-                    (quote next-error))
-              (call-interactively
-               (function next-error)))
-          ((quit error)
-           (message "%S" err)
-           (unless hydra-lv (sit-for 0.8))))
+                        (progn
+                          (setq this-command
+                                (quote next-error))
+                          (call-interactively
+                           (function next-error)))
+                        ((quit error)
+                         (message "%S" err)
+                         (unless hydra-lv (sit-for 0.8))))
         (when hydra-is-helpful
           (if hydra-lv
               (lv-message
@@ -195,14 +195,14 @@ Call the head: `previous-error'."
           (setq hydra-curr-body-fn
                 (quote hydra-error/body)))
         (condition-case err
-            (progn
-              (setq this-command
-                    (quote previous-error))
-              (call-interactively
-               (function previous-error)))
-          ((quit error)
-           (message "%S" err)
-           (unless hydra-lv (sit-for 0.8))))
+                        (progn
+                          (setq this-command
+                                (quote previous-error))
+                          (call-interactively
+                           (function previous-error)))
+                        ((quit error)
+                         (message "%S" err)
+                         (unless hydra-lv (sit-for 0.8))))
         (when hydra-is-helpful
           (if hydra-lv
               (lv-message
@@ -222,14 +222,12 @@ Call the head: `previous-error'."
         (define-key global-map (kbd "M-g")
           nil))
       (define-key global-map [134217831 104]
-       (function
-        hydra-error/first-error))
+        (quote hydra-error/first-error))
       (define-key global-map [134217831 106]
-       (function
-        hydra-error/next-error))
+        (quote hydra-error/next-error))
       (define-key global-map [134217831 107]
-       (function
-        hydra-error/previous-error))
+        (quote
+         hydra-error/previous-error))
       (defun hydra-error/body nil
         "Create a hydra with a \"M-g\" body and the heads:
 
index 73d6621f45dea962e9945d423377d68acdc0d942..fa4f641d7ab22e4c5999338176d9f6278fe99b54 100644 (file)
--- a/hydra.el
+++ b/hydra.el
@@ -1030,7 +1030,7 @@ result of `defhydra'."
                                           (if (boundp bind)
                                               (keymapp (symbol-value bind))
                                             t))
-                                     `(define-key ,bind ,final-key (function ,name)))
+                                     `(define-key ,bind ,final-key (quote ,name)))
                                     (t
                                      (error "Invalid :bind property `%S' for head %S" bind head)))))))
                       heads))