aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2021-07-10 18:53:28 +0200
committerLars Ingebrigtsen2021-07-10 18:53:28 +0200
commitda7dbfdf6858c4644a8d082639edd8a532e47c42 (patch)
treee0628a4705d8e0b7cef023544c6e4410fa48a9c5
parent3fa711c11d1497418fdf8a866b7ba52dd3b00e0e (diff)
downloademacs-da7dbfdf6858c4644a8d082639edd8a532e47c42.tar.gz
emacs-da7dbfdf6858c4644a8d082639edd8a532e47c42.zip
Make package-menu-filter-by-status work as documented
* lisp/emacs-lisp/package.el (package-menu-filter-by-status): Work as documented (bug#49474).
-rw-r--r--etc/NEWS8
-rw-r--r--lisp/emacs-lisp/package.el11
2 files changed, 16 insertions, 3 deletions
diff --git a/etc/NEWS b/etc/NEWS
index da5524a5553..923cfcc4722 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1493,6 +1493,14 @@ This is a slightly deeper copy than the previous 'copy-sequence'.
1493 1493
1494** Package 1494** Package
1495 1495
1496---
1497*** '/ s' ('package-menu-filter-by-status') changes parameter handling.
1498The command was documented to take a comma-separated list of statuses
1499to filter by, but instead it used the parameter as a regexp. The
1500command has been changed so that it now works as documented, and
1501checks statuses not as a regexp, but instead an exact match from the
1502comma-separated list.
1503
1496+++ 1504+++
1497*** New command 'package-browse-url' and keystroke 'w'. 1505*** New command 'package-browse-url' and keystroke 'w'.
1498 1506
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index a0f1ab0ed67..6bbd4c99763 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -3954,9 +3954,14 @@ packages."
3954 (package--ensure-package-menu-mode) 3954 (package--ensure-package-menu-mode)
3955 (if (or (not status) (string-empty-p status)) 3955 (if (or (not status) (string-empty-p status))
3956 (package-menu--generate t t) 3956 (package-menu--generate t t)
3957 (package-menu--filter-by (lambda (pkg-desc) 3957 (let ((status-list
3958 (string-match-p status (package-desc-status pkg-desc))) 3958 (if (listp status)
3959 (format "status:%s" status)))) 3959 status
3960 (split-string status ","))))
3961 (package-menu--filter-by
3962 (lambda (pkg-desc)
3963 (member (package-desc-status pkg-desc) status-list))
3964 (format "status:%s" (string-join status-list ","))))))
3960 3965
3961(defun package-menu-filter-by-version (version predicate) 3966(defun package-menu-filter-by-version (version predicate)
3962 "Filter the \"*Packages*\" buffer by VERSION and PREDICATE. 3967 "Filter the \"*Packages*\" buffer by VERSION and PREDICATE.