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 isearch or 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 theme and themes keywords by just searching for
theme,themes.
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
have 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 arc:ARCHIVE and status:STATUS respectively
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
see how?
Check in again next Monday for the last post on this series, where we talk about
prioritizing your package archives.
New in Emacs 25.1: Filtering by status and archive
01 Jun 2015, by Artur Malabarba.New in Package.el post series
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
isearch
oroccur
. 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
theme
andthemes
keywords by just searching fortheme,themes
.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 have
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 writingarc:ARCHIVE
andstatus:STATUS
respectively 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 see how?Check in again next Monday for the last post on this series, where we talk about prioritizing your package archives.
Tags: emacs-25, package, emacs,
New in Emacs 25.1: Archive priorities and downgrading packages »
« New in Emacs 25.1: Asynchronous Package Menu
Related Posts
It’s Magit! And you’re the magician! in package
Emacs 25 is out! What are the new features and what were my predictions in emacs-25
validate.el: Schema validation for Emacs-Lisp in package
Content © 2019, All rights reserved. Icons under CC3.0.