How to load all function in package with use-package ?
I modified crux package, and make my own simple-crux.el
Inside simple-crux.el
, say I have function foo
, bar
and baz
.
when I use
(use-package simple-crux
:load-path "~/.emacs.d/somewhare"
:bind ("C-c w" . foo))
I only have foo
function loaded when emacs start. I have all three function, only after I invoke C-c w
(foo function)
I can have all three function loaded after emacs start using (require 'simple-crux)
, but it is different case.
Things that make me confused
why
use-package
only load function mentioned in:bind
, and other functions are loaded after the specified binding invoked (in my simple-crux.el). even I have add###autoload
on the top of every function.But why I can have all function from
helm
,magit
, etc. even I don't hook them to emacs startup nor I don't invoke their specified binding. (with the same use-package scheme as my simple-crux.el)
(use-package magit
:ensure t
:bind ("C-c g" . magit-status))
:commands
keyword. The reason that commands from other packages are autoloaded is that you probably installed them with package manager which loads them for you inpackage-initialize
.