Fixes https://github.com/jwiegley/use-package/issues/529
(not (memq :defer args)))
(plist-put args :demand t)
args))))
+ ;; The :demand keyword should not override :after
+ (if (and (plist-member args* :after)
+ (plist-member args* :demand))
+ (setq args* (use-package-plist-delete args* :demand)))
(when (and use-package-always-ensure
(plist-member args* :load-path)
(not (plist-member orig-args :ensure)))
(load "foo" nil t))))
(require 'foo nil 'nil)
(config)
- t))))
+ t)))
+
+ ;; #529 - :demand should not override an explicit use of :after
+ (match-expansion
+ (use-package foo :demand t :after bar)
+ `(progn
+ (eval-after-load 'bar
+ '(require 'foo nil t))))
+
+ (let ((byte-compile-current-file t))
+ (match-expansion
+ (use-package foo :demand t :after bar)
+ `(progn
+ (eval-and-compile
+ (eval-when-compile
+ (with-demoted-errors "Cannot load foo: %S" nil
+ (load "foo" nil t))))
+ (eval-after-load 'bar
+ '(require 'foo nil t))))))
(ert-deftest use-package-test/:config ()
(match-expansion