From: John Wiegley Date: Thu, 19 Mar 2015 01:53:55 +0000 (-0500) Subject: Wrap the :preface in an eval-and-compile block X-Git-Tag: emacs-29.0.90~1306^2~15^2~366 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=19ab94cf39809dc1aebce053962930b6c6ab6c4d;p=emacs.git Wrap the :preface in an eval-and-compile block --- diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index e2054d11978..4d30ffe3ca3 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -74,9 +74,9 @@ then the expanded macros do their job silently." :group 'use-package) (defcustom use-package-inject-hooks nil - "If non-nil, add hooks to the `:init' and `:config' sections for a package. + "If non-nil, add hooks to the `:init' and `:config' sections. In particular, for a given package `foo', the following hooks -will become available: +become available: `use-package--foo--pre-init-hook' `use-package--foo--post-init-hook' @@ -100,9 +100,8 @@ This disables: - Printing to the *Messages* buffer of slowly-evaluating forms - Capture of load errors (normally redisplayed as warnings) - Conditional loading of packages (load failures become errors) -The only real advantage is that, if you know your configuration -works, then your byte-compiled init file is as minimal as -possible." +The only advantage is that, if you know your configuration works, +then your byte-compiled init file is as minimal as possible." :type 'boolean :group 'use-package) @@ -469,7 +468,9 @@ ARGS is a list of forms, so `((foo))' if only `foo' is being called." pre-compile-load - (plist-get args :preface) + (mapcar #'(lambda (form) + `(eval-and-compile ,form)) + (plist-get args :preface)) ;; Setup any required autoloads (if defer-loading @@ -606,7 +607,7 @@ this file. Usage: `(not (member nil (mapcar #'featurep ',requires))) `(featurep ',requires)) ,@expansion)))))) - ;; (message "Expanded: %s" (pp-to-string body*)) + ;; (message "Expanded:\n%s" (pp-to-string body*)) `(let ((byte-compile-warnings byte-compile-warnings)) (byte-compile-disable-warning 'redefined) ,body*)))))