diff options
| author | Lars Ingebrigtsen | 2022-06-13 14:20:22 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-06-13 14:20:22 +0200 |
| commit | 0fdd37c7fbbd0880e569d41bb5ecb9a40f099b00 (patch) | |
| tree | 2e963622bed69122932f93448b4dd2a477ff85a1 | |
| parent | f8ac290945102f2b59a4474bd4c53ba22db6a076 (diff) | |
| download | emacs-0fdd37c7fbbd0880e569d41bb5ecb9a40f099b00.tar.gz emacs-0fdd37c7fbbd0880e569d41bb5ecb9a40f099b00.zip | |
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).
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/emacs-lisp/package.el | 18 |
2 files changed, 11 insertions, 10 deletions
| @@ -151,6 +151,9 @@ of 'user-emacs-directory'. | |||
| 151 | 151 | ||
| 152 | * Incompatible changes in Emacs 29.1 | 152 | * Incompatible changes in Emacs 29.1 |
| 153 | 153 | ||
| 154 | --- | ||
| 155 | ** '/ a' in *Packages* now limits by package name(s) instead of regexp. | ||
| 156 | |||
| 154 | +++ | 157 | +++ |
| 155 | ** Setting the goal columns now also affects '<prior>' and '<next>'. | 158 | ** Setting the goal columns now also affects '<prior>' and '<next>'. |
| 156 | Previously, 'C-x C-n' only affected 'next-line' and 'previous-line', | 159 | Previously, 'C-x C-n' only affected 'next-line' and 'previous-line', |
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 48551f59b43..9aaeb052d0d 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -3963,16 +3963,14 @@ packages." | |||
| 3963 | (mapcar #'car package-archives))) | 3963 | (mapcar #'car package-archives))) |
| 3964 | package-menu-mode) | 3964 | package-menu-mode) |
| 3965 | (package--ensure-package-menu-mode) | 3965 | (package--ensure-package-menu-mode) |
| 3966 | (let ((re (if (listp archive) | 3966 | (let ((archives (ensure-list archive))) |
| 3967 | (regexp-opt archive) | 3967 | (package-menu--filter-by |
| 3968 | archive))) | 3968 | (lambda (pkg-desc) |
| 3969 | (package-menu--filter-by (lambda (pkg-desc) | 3969 | (let ((pkg-archive (package-desc-archive pkg-desc))) |
| 3970 | (let ((pkg-archive (package-desc-archive pkg-desc))) | 3970 | (or (null archives) |
| 3971 | (and pkg-archive | 3971 | (and pkg-archive |
| 3972 | (string-match-p re pkg-archive)))) | 3972 | (member pkg-archive archives))))) |
| 3973 | (concat "archive:" (if (listp archive) | 3973 | (concat "archive:" (string-join archives ","))))) |
| 3974 | (string-join archive ",") | ||
| 3975 | archive))))) | ||
| 3976 | 3974 | ||
| 3977 | (defun package-menu-filter-by-description (description) | 3975 | (defun package-menu-filter-by-description (description) |
| 3978 | "Filter the \"*Packages*\" buffer by DESCRIPTION regexp. | 3976 | "Filter the \"*Packages*\" buffer by DESCRIPTION regexp. |