Endless Parentheses

Concise ramblings on Emacs productivity.

New in Emacs 25.1: Asynchronous Package Menu

It was six months ago, to the day, when I alluded to the fact that Emacs’ package menu needed to go async. The time it took to do a simple list-packages bothered me the most, closely followed by having to go play Minesweeper every time I did a package upgrade. The latter was partially addressed when I added asynchronous package transactions to Paradox, but the former took a bit more work. In Emacs 25.1, at last, the package menu is going async.

You don’t need to do anything special to benefit from this. As soon as you issue M-x list-packages, instead of those “Contacting host: ...” messages which always foretell a many-second hang, the package menu will come up almost instantly. The download of archive information will go on in the background, and once it is done the new information is updated in place.

This has two big advantages.

  1. A fraction of a second after issuing the command you’re already in the menu, free to navigate, search, or mark stuff while the background download is happening.
  2. If you have multiple archives configured (which you should), they are fetched simultaneously. So the entire download will be 2–4 times faster now, even if you decide to sit and wait for it to finish.

It should be noted this only applies to refreshing. Package transactions (installation, upgrade, and deletion) are still synchronous in package.el. Async transactions where implemented for a while, but the outcome was quite far from satisfactory. However, so as not to end on a sad note, you can always go to Paradox for that.

Lastly, if you’re the kind of person that hates nice things, you can disable this feature with the package-menu-async variable.

That should be enough about (a)synchronicity for the moment. Come back on Monday, when we go into some big improvements on the filtering engine.

Tags: emacs-25, package, emacs

Say thanks on Gratipay
comments powered by Disqus