Closed mcandre closed 2 years ago
You don't mention which packages you think are being loaded too early. You have many forms like this in your init:
(use-package apache-mode)
(use-package clojure-mode)
(use-package coffee-mode)
(use-package cmake-mode)
If you're expecting these to be lazy loaded, you should take a look again at the documentation.
Certain keywords imply deferred loading, but not using any (as above) will immediately load the package.
use-package
is a macro, so you can use macroexpand
to see the code it expands to.
I suggest doing for any declarations you think aren't being loaded properly.
Yes, you'll want at minimum (use-package cmake-mode :defer t)
for deferred loading.
Be careful, if use-package-always-ensure
is false, which is the default, that form will expand to code that does nothing! With use-package-always-ensure
true, as you have in your config, that should cause use-package
to ensure the package is installed, but it won't load the package.
Try M-x pp-macroexpand-last-sexp
when at the end of a use-package
form to see what it does.
It seems like this support question was resolved by the above replies, so I'm closing this now.
Half of the packages in my .emacs file fail to lazy load. For some reason, use-package is trying to load them aggressively early.
https://github.com/mcandre/dotfiles/blob/master/.emacs
I even have to manually
(package-install '<package>)
to fix them! Instead of use-package installing them.