summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2015-03-16 11:58:37 -0500
committerJohn Wiegley <johnw@newartisans.com>2015-03-16 11:58:37 -0500
commit9e35dd95d95ef3006cfd8d87d3e2099ec03ba021 (patch)
tree45d8aa11083005165b71efb75e9c4c14239f5f98
parent34bc31e1d4a83a2a8ae9d13439de1a59e1e21d56 (diff)
downloademacs-9e35dd95d9.tar.gz
More fixes related to byte-compilation
-rw-r--r--lisp/use-package/use-package.el30
1 files changed, 17 insertions, 13 deletions
diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el
index d81d7e4e77e..e77ff96dc5e 100644
--- a/lisp/use-package/use-package.el
+++ b/lisp/use-package/use-package.el
@@ -427,6 +427,13 @@ possible."
`(diminish (quote ,var))))
(plist-get args :diminish))))
+ (config-body*
+ (and config-body
+ (macroexpand
+ `(use-package-with-elapsed-timer
+ ,(format "Configuring package %s" name-string)
+ ,@config-body))))
+
(config-defun
(make-symbol (concat "use-package--" name-string "--config"))))
@@ -437,8 +444,7 @@ possible."
(list (plist-get args :preface))
;; Setup the load-path
- (mapcar #'(lambda (path)
- `(eval-and-compile (add-to-list 'load-path ,path)))
+ (mapcar #'(lambda (path) `(add-to-list 'load-path ,path))
(plist-get args :load-path))
;; Setup any required autoloads
@@ -461,10 +467,7 @@ possible."
(append (plist-get args :functions) commands)))
;; (if (and defer-loading config-body)
- ;; `((defun ,config-defun ()
- ;; (use-package-with-elapsed-timer
- ;; ,(format "Configuring package %s" name-string)
- ;; ,@config-body))))
+ ;; `((defalias ',config-defun #'(lambda () ,config-body*))))
;; The user's initializations
(list (use-package-hook-injector name-string :init args))
@@ -474,10 +477,8 @@ possible."
bindings
(if config-body
`((eval-after-load ',name
- ',(macroexpand
- `(use-package-with-elapsed-timer
- ,(format "Configuring package %s" name-string)
- ,@config-body))))))
+ ;; '(,config-defun)
+ ',config-body*))))
`(,(macroexpand
`(use-package-with-elapsed-timer
,(format "Loading package %s" name-string)
@@ -486,12 +487,15 @@ possible."
(use-package-cat-maybes
(list `(require ',name-symbol))
bindings
- config-body))
+ (list config-body*)))
`(if (not (require ',name-symbol nil t))
- (error "Could not load package %s" ,name-string)
+ (display-warning
+ 'use-package
+ (format "Could not load package %s" ,name-string)
+ :error)
,@(use-package-cat-maybes
bindings
- config-body))))))))))
+ (list config-body*)))))))))))
(defmacro use-package (name &rest args)
"Declare an Emacs package by specifying a group of configuration options.