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: John Wiegley
Subject: Re: Loading a package applies automatically to future sessions?
Date: Sun, 28 Jan 2018 22:55:52 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (darwin)

>>>>> "SM" == Stefan Monnier <address@hidden> writes:

SM> - In the case of JW, why does he have so many packages installed to slow
SM> down his startup, yet he doesn't want them activated? Are these packages
SM> that he does use, but just rarely? Or does he just have lots of packages
SM> installed that he doesn't use (e.g. that's my case: I always have all GNU
SM> ELPA packages installed, even though I use very few of them)? If so, why
SM> does he have so many packages installed even tho he doesn't use them?

I do use them, all of them. At present there are just over 385 in my local
configuration.

However, they don't all need to be active and available immediately after
startup. They fall into several categories, all of which can be deferred:

  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.

  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.

In fact, the packages I require to be immediately available, the instant Emacs
becomes ready, are incredibly few (I'm not even sure there are any!). By
deferring absolutely everything, and autoloading only precisely what is needed
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
actions that cause them to lazy load.

And before you ask: Yes, I do restart my Emacs. A lot. This is the whole
reason I evolved this technique. Sometimes I restart Emacs over a 100 times a
day, simply because it's the only way I can be completely sure that my state
has been reset (which includes Emacs state, Nix state, shell state, OS state).

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.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2

Attachment: signature.asc
Description: PGP signature


reply via email to

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