use-package-expand: use display-warning

instead of with-demoted-errors. This prevents errors from getting lost
in the *Messages* buffer.
This commit is contained in:
Noam Postavsky 2015-03-14 11:33:12 -04:00
parent 4ae584f3ff
commit 27cba067ee

View file

@ -282,9 +282,12 @@ then the expanded macros do their job silently."
(defsubst use-package-expand (name label form)
(declare (indent 1))
(and form
`(with-demoted-errors
,(format "Failure in %s of %s: %%S" label name)
,form)))
(let ((err (make-symbol "err"))
(fmt (format "Failure in %s of %s: %%S" label name)))
`(condition-case-unless-debug ,err
,form
(error (display-warning 'use-package (format ,fmt ,err) :error)
nil)))))
(defun use--package (name-symbol name-string args)
"See docstring for `use-package'."