New in Emacs 25.1: Better dependency management21 May 2015, by Artur Malabarba.
New in Package.el post series
- New in Emacs 25.1: Better dependency management
- New in Emacs 25.1: User-selected packages
- New in Emacs 25.1: Asynchronous Package Menu
- New in Emacs 25.1: Filtering by status and archive
- New in Emacs 25.1: Archive priorities and downgrading packages
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.
- 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-autoremovecommand to cleanup dependencies that are no longer needed.
- 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.
- Packages that were pulled in as dependencies are marked as such in the package menu.
- 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.
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