From 48975f791b409fe9aa68dc757d489c37a19a7579 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 15 Aug 2013 21:35:38 -0400 Subject: [PATCH] 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 --- lisp/use-package/use-package.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index 72e287c376a..8077f2e8798 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -582,10 +582,11 @@ For full documentation. please see commentary. pkg-load-path))) (eval-when-compile - ,@defines-eval - ,(if (stringp name) - `(load ,name t) - `(require ',name nil t))) + (when (bound-and-true-p byte-compile-current-file) + ,@defines-eval + ,(if (stringp name) + `(load ,name t) + `(require ',name nil t)))) ,(when (boundp 'el-get-sources) (require 'el-get) -- 2.39.2