1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Don't auto-defer if the package itself was given to :load

Otherwise, we'd be senselessly waiting for the package to load.
This commit is contained in:
John Wiegley 2017-12-05 15:47:53 -08:00
parent 2a9904b9e8
commit 3343cca33b
2 changed files with 25 additions and 0 deletions

View file

@ -552,6 +552,10 @@ extending any keys already present."
;; Certain keywords imply :defer, if :demand was not specified.
(when (and (not (plist-member args :demand))
(not (plist-member args :defer))
(not (or (equal '(t) (plist-get args :load))
(equal (list (use-package-as-string name))
(mapcar #'use-package-as-string
(plist-get args :load)))))
(cl-some #'identity
(mapcar (apply-partially #'plist-member args)
use-package-deferring-keywords)))

View file

@ -1044,6 +1044,27 @@
(ignore
(add-hook 'hook-special #'fun))))))
(ert-deftest use-package-test/:hook-5 ()
(match-expansion
(use-package erefactor
:load-path "foo"
:after elisp-mode
:load t
:hook (emacs-lisp-mode
. (lambda ()
(bind-key "\C-c\C-v" erefactor-map emacs-lisp-mode-map))))
`(progn
(eval-and-compile
(add-to-list 'load-path ,(pred stringp)))
(eval-after-load 'elisp-mode
'(progn
(require 'erefactor nil nil)
(ignore
(add-hook
'emacs-lisp-mode-hook
#'(lambda nil
(bind-key "" erefactor-map emacs-lisp-mode-map)))))))))
(ert-deftest use-package-test-normalize/:custom ()
(flet ((norm (&rest args)
(apply #'use-package-normalize/:custom