New in Emacs 25.1: Filtering by status and archive01 Jun 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
For several reasons, the Package Menu’s f key has always flown a bit under the
radar for me. Though the
package-menu-filter command is great in principle, in
practice its usefulness falls a little short for several reasons.
One reason, which is in no way its own fault, is that Emacs already has great
searching facilities such as
occur. It’s just easier and faster
to fall back on what you know rather than try out something new. This not
exactly something that needs fixing, but it can be improved by focusing the
filter command on doing things what other facilities can’t do.
Now you might be thinking, “doesn’t this command filter by package keywords? Isearch can’t do that.”
And that takes us to the second (probably most relevant) reason. The list of
keywords used by packages is an ugly mess. And that’s not something easy to fix.
Before investing too much resource on this never-ending struggle against entropy,
Emacs 25.1 will make a simple improvement that goes a long way. You can filter
multiple comma-separated keywords at once. So, for instance, you can mitigate
the redundancy between the
themes keywords by just searching for
Furthermore, sometimes there’s a good improvement available that is completely
orthogonal to the problem you have. Instead of fixing up keywords, we can also
package-menu-filter offer other features that alternate facilities
don’t —preferably one that doesn’t rely on the supernatural cooperation of a
thousand monkeys typing elisp. As of Emacs 25.1, you may now filter packages by
status or by archive, by writing
when you invoke the command.
Of lesser importance, there was also a third usability issue with the command. It took a couple of seconds to load every time you invoked it. That, fortunately, was much simpler to solve, and I’ll even leave it as an exercise to the reader!
In the following (very streamline) function, place point anywhere you want and
then invoke a single keybind (from
emacs -q, your custom keybinds don’t
count). If you do it right, you can improve its speed a hundred-fold. Can you
Check in again next Monday for the last post on this series, where we talk about prioritizing your package archives.