diff options
Diffstat (limited to 'lisp/use-package/use-package.el')
-rw-r--r-- | lisp/use-package/use-package.el | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index 28d8587de00..450d5cf9d80 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -419,7 +419,7 @@ For full documentation. please see commentary. ,init-body ,@(mapcar (lambda (elem) (when (not keymap) - (push (cdr elem) commands)) + (push (cdr elem) commands)) (funcall func elem)) cons-list)))))))) @@ -487,22 +487,20 @@ For full documentation. please see commentary. (eval-when-compile (when (bound-and-true-p byte-compile-current-file) ,@defines-eval - (condition-case err - ,(if (stringp name) - `(load ,name t) - `(require ',name nil t)) - (error (message "Error requiring %s: %s" ',name err) nil)))) - - ,(if (and (or commands (use-package-plist-get args :defer) - (use-package-plist-get args :bind-keymap) - (use-package-plist-get args :bind-keymap*)) + (with-demoted-errors + ,(format "Error in %s: %%S" name) + ,(if (stringp name) + `(load ,name t) + `(require ',name nil t))))) + + ,(if (and (or commands (use-package-plist-get args :defer)) (not (use-package-plist-get args :demand))) (let (form) (mapc (lambda (command) - (push `(unless (fboundp (quote ,command)) - (autoload (function ,command) - ,name-string nil t)) - form)) + (push `(unless (fboundp (quote ,command)) + (autoload (function ,command) + ,name-string nil t)) + form)) commands) `(when ,(or predicate t) |