Function: package-menu-filter-by-archive

package-menu-filter-by-archive is an interactive and byte-compiled function defined in package.el.gz.

Signature

(package-menu-filter-by-archive ARCHIVE)

Documentation

Filter the "*Packages*" buffer by ARCHIVE.

Display only packages from package archive ARCHIVE. ARCHIVE can be the name of a single archive (a string), or a list of archive names. If ARCHIVE is nil or an empty string, show all packages.

When called interactively, prompt for ARCHIVE. To specify several archives, type their names separated by commas.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/package.el.gz
(defun package-menu-filter-by-archive (archive)
  "Filter the \"*Packages*\" buffer by ARCHIVE.
Display only packages from package archive ARCHIVE.
ARCHIVE can be the name of a single archive (a string), or
a list of archive names.  If ARCHIVE is nil or an empty
string, show all packages.

When called interactively, prompt for ARCHIVE.  To specify
several archives, type their names separated by commas."
  (interactive (list (completing-read-multiple
                      "Filter by archive: "
                      (mapcar #'car package-archives)))
               package-menu-mode)
  (package--ensure-package-menu-mode)
  (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 ",")))))