also check `byte-compile-current-file' for compile time loads, fixes issue

`eval-when-compile' is really `eval-when-macroexpand' which includes
loading from source
GitHub-reference: https://github.com/jwiegley/use-package/issues/44
This commit is contained in:
Noam Postavsky 2013-08-15 21:35:38 -04:00
parent 3d0b14eac2
commit 48975f791b

View file

@ -582,10 +582,11 @@ For full documentation. please see commentary.
pkg-load-path))) pkg-load-path)))
(eval-when-compile (eval-when-compile
,@defines-eval (when (bound-and-true-p byte-compile-current-file)
,(if (stringp name) ,@defines-eval
`(load ,name t) ,(if (stringp name)
`(require ',name nil t))) `(load ,name t)
`(require ',name nil t))))
,(when (boundp 'el-get-sources) ,(when (boundp 'el-get-sources)
(require 'el-get) (require 'el-get)