Warn when :ensure t is used

When package.el isn't initialized.
This commit is contained in:
Henrik Lissner 2020-08-03 19:11:15 -04:00
parent 9ac9deb0fd
commit 6e702a435a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -330,7 +330,9 @@ This value is cached. If REFRESH-P, then don't use the cached value."
;; packages with package.el, by copying over old `use-package' declarations with
;; an :ensure t property. Doom doesn't use package.el, so this will throw an
;; error that will confuse beginners, so we disable `:ensure'.
(setq use-package-ensure-function #'ignore)
(setq use-package-ensure-function
(lambda (name &rest _)
(message "Ignoring ':ensure t' in '%s' config" name)))
;; ...On the other hand, if the user has loaded `package', then we should assume
;; they know what they're doing and restore the old behavior:
(add-transient-hook! 'package-initialize