]> git.eshelyaron.com Git - emacs.git/commitdiff
Macroexpand quoted eval-after-load block early
authorPhil Hudson <phil.hudson@iname.com>
Wed, 23 Jan 2013 20:33:15 +0000 (20:33 +0000)
committerPhil Hudson <phil.hudson@iname.com>
Wed, 23 Jan 2013 20:33:15 +0000 (20:33 +0000)
The main `use-package' macro incorrectly planted code containing a call to the `with-elapsed-timer' macro in a quoted block to be run by `eval-after-load'. If package use-package was not loaded at runtime, the block would error saying correctly that `with-elapsed-timer' is undefined. This mod correctly macroexpands the block at code generation time.

lisp/use-package/use-package.el

index f9bc5c2b32ecf2938bf4743571ab55d7838b50f3..53c96ae1f6c48608e918b1b12c00683a66fad3a7 100644 (file)
                    ,init-body
                    ,(unless (null config-body)
                       `(eval-after-load ,name-string
-                         '(if ,requires-test
-                              (with-elapsed-timer
-                                  ,(format "Configuring package %s" name-string)
-                                ,config-body))))
+                         (quote
+                           (if ,requires-test
+                               ,(macroexpand-all
+                                  `(with-elapsed-timer
+                                       ,(format "Configuring package %s" name-string)
+                                     ,config-body))))))
                    t))
             `(if (and ,(or predicate t)
                       ,requires-test)