0

Via M-x list-packages I can view a list of installable and installed packages. Great! But how can I filter this list by a portion of the package name?


PS: I know about package-menu-filter, but for me this command filters only on the package description, not the package name. E.g. when I filter on lsp-mode I get packages like lsp-scala, etc, but not what I was looking for, namely lsp-mode...

2 Answers 2

1

/ n (M-x package-menu-filter-by-name) does exactly what you want, it filters only the package name, e.g., / n lsp-mode gets only the lsp-mode package.

/ n runs the command package-menu-filter-by-name (found in package-menu-mode-map), which is an interactive compiled Lisp function in `package.el'.

It is bound to / n, .

(package-menu-filter-by-name NAME)

Filter the "Packages" buffer by NAME.
Show only those items whose name matches the regular expression NAME. If NAME is nil or the empty string, show all packages.

You can clear the filter via / /.

I'm testing with Emacs 27.1. Not sure which version of Emacs added the feature.

2
  • 1
    `C-h N' will tell you (it's new in emacs-27)
    – rpluim
    Oct 20, 2020 at 11:48
  • Cool. - Gives me a reason to upgrade all my Emacses! :-)
    – halloleo
    Oct 21, 2020 at 5:26
1

Try C-h P (M-x describe-package), it allows you filter by package names through the minibuffer. If you use helm-mode, it looks like

search lsp

And in the *Packages* buffer, use Isearch and/or Occur, for example, to search packages start with lsp, use

M-s o ^ +lsp

M-s o is M-x occur.

occur lsp

1
  • Not the answer I was hoping for, but it might be all there is... (The isearch method is what I use day-to-day, but feels a bit cumbersome - that's why I asked the question in the first place.)
    – halloleo
    Oct 20, 2020 at 2:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.