Macroexpand quoted eval-after-load block early

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.
This commit is contained in:
Phil Hudson 2013-01-23 20:33:15 +00:00
parent fbead83731
commit 593f18aff5

View file

@ -461,10 +461,12 @@
,init-body ,init-body
,(unless (null config-body) ,(unless (null config-body)
`(eval-after-load ,name-string `(eval-after-load ,name-string
'(if ,requires-test (quote
(with-elapsed-timer (if ,requires-test
,(macroexpand-all
`(with-elapsed-timer
,(format "Configuring package %s" name-string) ,(format "Configuring package %s" name-string)
,config-body)))) ,config-body))))))
t)) t))
`(if (and ,(or predicate t) `(if (and ,(or predicate t)
,requires-test) ,requires-test)