1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-15 03:11:54 -07:00

Make `/ a' in *Package* filter by name

* lisp/emacs-lisp/package.el (package-menu-filter-by-archive):
Filter by package name instead of by regexp, so that if the user
types "gnu", they won't get "nongnu", too (bug#55919).
This commit is contained in:
Lars Ingebrigtsen 2022-06-13 14:20:22 +02:00
parent f8ac290945
commit 0fdd37c7fb
2 changed files with 11 additions and 10 deletions

View file

@ -151,6 +151,9 @@ of 'user-emacs-directory'.
* Incompatible changes in Emacs 29.1
---
** '/ a' in *Packages* now limits by package name(s) instead of regexp.
+++
** Setting the goal columns now also affects '<prior>' and '<next>'.
Previously, 'C-x C-n' only affected 'next-line' and 'previous-line',

View file

@ -3963,16 +3963,14 @@ packages."
(mapcar #'car package-archives)))
package-menu-mode)
(package--ensure-package-menu-mode)
(let ((re (if (listp archive)
(regexp-opt archive)
archive)))
(package-menu--filter-by (lambda (pkg-desc)
(let ((pkg-archive (package-desc-archive pkg-desc)))
(and pkg-archive
(string-match-p re pkg-archive))))
(concat "archive:" (if (listp archive)
(string-join archive ",")
archive)))))
(let ((archives (ensure-list archive)))
(package-menu--filter-by
(lambda (pkg-desc)
(let ((pkg-archive (package-desc-archive pkg-desc)))
(or (null archives)
(and pkg-archive
(member pkg-archive archives)))))
(concat "archive:" (string-join archives ",")))))
(defun package-menu-filter-by-description (description)
"Filter the \"*Packages*\" buffer by DESCRIPTION regexp.