From: John Wiegley Date: Sun, 3 Dec 2017 18:57:42 +0000 (-0800) Subject: Always catch errors during configuration X-Git-Tag: emacs-29.0.90~1306^2~15^2~186 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=223c321a1d;p=emacs.git Always catch errors during configuration --- diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index 3dab8ec8521..e34fb735cbd 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -1618,31 +1618,30 @@ no more than once." (use-package-process-keywords name args (and (plist-get args :demand) (list :demand t)))))) - (if (not (eq use-package-verbose 'debug)) + (if use-package-expand-minimally body `(condition-case-unless-debug err ,body (error (let ((msg (format "%s: %s" ',name (error-message-string err)))) - (with-current-buffer (get-buffer-create "*use-package*") - (goto-char (point-max)) - (insert "-----\n" msg "\n\n" - (pp-to-string ',`(use-package ,name ,@orig-args)) - "\n -->\n\n" - (pp-to-string ',`(use-package ,name ,@args)) - "\n ==>\n\n" - (pp-to-string - ',(let ((use-package-verbose 'errors) - (use-package-expand-minimally t)) - (macroexp-progn - (use-package-process-keywords name args - (and (plist-get args :demand) - (list :demand t))))))) - (emacs-lisp-mode)) - (ignore - (display-warning - 'use-package (concat msg " (see the *use-package* buffer)") - :error))))))))) + (when (eq use-package-verbose 'debug) + (setq msg (concat msg " (see the *use-package* buffer)")) + (with-current-buffer (get-buffer-create "*use-package*") + (goto-char (point-max)) + (insert "-----\n" msg "\n\n" + (pp-to-string ',`(use-package ,name ,@orig-args)) + "\n -->\n\n" + (pp-to-string ',`(use-package ,name ,@args)) + "\n ==>\n\n" + (pp-to-string + ',(let ((use-package-verbose 'errors) + (use-package-expand-minimally t)) + (macroexp-progn + (use-package-process-keywords name args + (and (plist-get args :demand) + (list :demand t))))))) + (emacs-lisp-mode))) + (ignore (display-warning 'use-package msg :error))))))))) ;;;###autoload (defmacro use-package (name &rest args)