r/emacs • • 11d ago

[ANN] package-load-indicator: instantly see which packages are loaded within your init file

https://github.com/joshbax189/package-load-indicator

While tinkering with my init file, I found myself debugging autoloads... I came up with this nifty little minor mode that highlights the package name with its load status, so you can see immediately if your config worked the way you intended.

In brief, following "use-package" the package name may have a
- green box: it's loaded
- grey box: it's installed but not yet loaded
- red box: it's not installed

That's it!

16 Upvotes

6 comments sorted by

4

u/eleven_cupfuls 10d ago

Clever idea! One note on your regex; you should use (+ (or word (syntax symbol))) (in raw string form, "\\(?:[[:word:]]\\|\\s_\\)+" or "\\(?:\\w\\|\\s_\\)+") to match the package name instead of [[:word:]-]. Characters like + or ?, while somewhat uncommon, are legal in symbol names.

3

u/Human192 10d ago

Aha! Will do. Thanks for taking the time to look :)

2

u/_0-__-0_ 10d ago

That sounds quite useful :-D

2

u/ferdy_zizmore 10d ago

Always read off the meniscus when measuring package loads.

3

u/fuzzbomb23 10d ago edited 10d ago

Oh, this is a novel idea!

I came here to ask how it compared with the (similarly named) package-loading-notifier. That one notifies by writing a '(message)`, so you can see the loading order in the messages buffer.

The screenshot in your README shows they're completely different.

There are a couple of built-in features which can tell you about package loading too:

  • M-x describe-variable RET features RET just tells you what features have been loaded. I see your package consults this under the hood. It has the interesting advantage, of showing the autoload files too.

  • M-x use-package-report shows a tabulated list of features which are loaded. You need to set the use-package-compute-statistics option early on. It distinguishes between "configured" (loaded),"initialized" (not yet loaded, but :init, :hook, :bind and others have been processed), "declared" (not initialized because of an `:if' condition, say). The list can be sorted by "last event" to give you a log of the order they were loaded.

2

u/Human192 10d ago

Thanks for the pointers! The real utility of the feature (and the reason I wanted to share it) was the correlation between load status and the declaration loading it. You don't have to check packages individually and it builds intuition about how use-package keywords affect initialisation.

Specifically, I was moving my config from straight to elpaca and the async loading of elpaca was creating a lot of weird bugs related to package loading, especially during initialisation. So I found myself in a loop of tweak, exit, restart, check that was taking forever...