emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading a package applies automatically to future sessions?


From: Stefan Monnier
Subject: Re: Loading a package applies automatically to future sessions?
Date: Mon, 29 Jan 2018 14:08:49 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> Thanks to use-package, I don't need to think very hard to make such a setup
> work.  And since there's almost no cost to adding in more functionality to my
> Emacs, I add tons and tons: all within easy reach should I need it.

We were talking about package activation rather than configuration, so
use-package is not an apples-to-apples comparison.

`package-initialize` is supposed to do things like:

> 1. A set of keybinding(s) that should "activate" the package and make its
>    functionality available. Until I press one of those keys, the package
>    can stay dormant, and no time should be spent on it.
>
> 2. An entry in auto-mode-alist, interpreter-mode-list, etc.
>
> 3. A command I must invoke via M-x to trigger autoload.

and pretty much nothing else, i.e. a subset of what use-package is often
used for.  AFAIK for packages installed with package.el, this part of
use-package only makes sense when the packages is not properly packaged
(i.e. doesn't do 1/2/3 correctly in their <pkg>-autoloads.el).

Regarding the other two points:

> 4. Some other condition, like the loading of one of the aforementioned
>    packages.
>
> 5. Waiting until some amount of idle time has passed, since the mode in
>    question is just a "bell & whistle", and I shouldn't need to wait for
>    it to start using Emacs.

These have to do with configuration, not with activation, so
package-initialize should never do any of that nor prevent doing any of
that.  This part of use-package is just as useful for ELPA-installed
packages as for any others.

> I do use them, all of them. At present there are just over 385 in my local
> configuration.
[...]
> to trigger activation, I can have Emacs available within 0.4 seconds after
> startup, with all the other functionality coming online as I perform the

I don't think I can easily bring down the speed of package-initialize
much below 0.1s for my 200 packages on my Thinkpad T61.  Whether that
would still let you startup in 0.4s with your config, I can't tell.

There's no doubt that with use-package you have a finer control about
what happens when, so you can delay some of the things done during
package-initialize, but without looking more deeply into it, it's hard
to tell whether that would really be needed.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]