From 6e702a435a0de1aa50ac4991e382b4107c724cd6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 3 Aug 2020 19:11:15 -0400 Subject: [PATCH] Warn when :ensure t is used When package.el isn't initialized. --- core/core-modules.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/core-modules.el b/core/core-modules.el index a88a9dfdd..48624a73b 100644 --- a/core/core-modules.el +++ b/core/core-modules.el @@ -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