Endless Parentheses

Ramblings on productivity and technical subjects.

profile for Malabarba on Stack Exchange

New in Emacs 25.1: Better dependency management

Package.el has gotten a series of improvements after the release of 24.4. Since I’ve found that people like to read about upcoming features, I’m starting a new series exclusively about our favorite package manager. Today, we talk dependencies.

Package.el’s dependency management has always been just enough to do the job it’s supposed to do. If you install a package that has dependencies, those requirements get installed as well. End of story.

This leaves a little to be desired for two reasons. Firstly, if you later remove the first package, the dependencies will be left on your computer. Secondly, even if you notice those dependencies lying around and want to remove them, you never know if that’s safe because Package.el won’t tell you if another package depends on them and, what’s worse, it will let you remove it even if another installed package does depend on them (which will lead to breakage).

The situation is being improved on both accounts, thanks to Thierry Volpiatto.

  1. Package.el will differentiate between packages you’ve installed explicitly and those which were just pulled along as dependencies. So you get a new package-autoremove command to cleanup dependencies that are no longer needed.
  2. Package.el will never let you remove a package if some other package depends on it. So you’re free to try to delete anything you don’t want, and nothing is going to break if it happens to be a dependency (you’ll just fail).

And this led to some UI improvements to the package menu, thanks to yours truly.

  1. Packages that were pulled in as dependencies are marked as such in the package menu.
  2. The description buffer (the one you get when hitting RET on a package) is now kind enough to list all packages that depend on this one.

package-menu-dependencies-1.png package-menu-dependencies-2.png

As a whole, this is a great user experience improvement. Instead of seeing installed packages that they never actually installed, the user will see dependency packages. Every once in a while, after removing some package, they might get notified that “these dependencies are no longer necessary”, and can easily clean them up with package-autoremove.

If you want more 25.1 news, there’s also a whole series just about that, and you can always just check out the emacs-25 tag.

comments powered by Disqus