]> git.eshelyaron.com Git - emacs.git/commit
Improve deferred installation mechanism
authorRadon Rosborough <radon.neon@gmail.com>
Thu, 9 Mar 2017 03:00:37 +0000 (19:00 -0800)
committerRadon Rosborough <radon.neon@gmail.com>
Thu, 9 Mar 2017 03:03:34 +0000 (19:03 -0800)
commit855a2afbe3167fe6bb9f1993fb825fd180605dd3
treedee661edc80be9be002250e2922634601c30f510
parent89a8f94672ec715f19979bf6e83a2e23814d5476
Improve deferred installation mechanism

This time around, I've gotten rid of the advice on `require' (that was
never going to work) and instead made `use-package' try to handle
loading the package at the appropriate time. In particular, when
deferred installation is active, all the autoloads generated by
`use-package' are not regular autoloads, but regular functions that
will install the relevant package, require the relevant feature, and
only then call the newly defined (autoloaded) function.

Some smarter logic has been added to make sure things like `:demand'
play nicely with the autoloading system; see the extensive comment in
`use-package-handler/:defer-install' for more information on how that
works.

There was a section in `use-package-install-deferred-package' which
referred to a nonexistent variable `use-package--deferred-features';
that has been removed.

There is now, in addition to `use-package-ensure-function', a new
variable called `use-package-pre-ensure-function'. This is intended
for use by package managers which, unlike package.el, activate
autoloads package-by-package instead of all at once. Even if a package
is marked for deferred installation, the user would likely want its
autoloads activated immediately *if* it was already installed. The
logic for doing that can now be put in
`use-package-pre-ensure-function'.
lisp/use-package/use-package.el