summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Burkett <justin@burkett.cc>2016-06-23 10:01:33 -0400
committerJustin Burkett <justin@burkett.cc>2016-06-23 10:01:33 -0400
commit59d34cf9ce738f92f6574449b43676b6f2bb6478 (patch)
tree1647d18b674f0aea3a4caa8f71b971acfbdf1f96
parentff0a5e281d68d15720cfd3fc8b98eb1abe4da74c (diff)
downloademacs-59d34cf9ce.tar.gz
Move :init forms before :after and :demand
The docstring of use-package says that :init should run before the package is loaded but using :after moves the require statement ahead of :init when any package specified in :after is already loaded. In the following example, in the first case bar-x might get set before or after bar is loaded depending on if foo is already loaded at the time, while the second case always sets bar-x first. (use-package bar :after (foo) :init (setq bar-x 2) :config (bar-mode)) (use-package bar :init (setq bar-x 2) :config (bar-mode)) This commit fixes the issue and makes sure that bar-x is set before bar is loaded by use-package. Fixes https://github.com/jwiegley/use-package/issues/352.
-rw-r--r--lisp/use-package/use-package.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el
index 8c47678117d..aeea5ea9244 100644
--- a/lisp/use-package/use-package.el
+++ b/lisp/use-package/use-package.el
@@ -144,9 +144,9 @@ the user specified."
:defines
:functions
:defer
+ :init
:after
:demand
- :init
:config
:diminish
:delight)