Function: package-menu-filter-marked

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

Signature

(package-menu-filter-marked)

Documentation

Filter "*Packages*" buffer by non-empty mark.

Show only the packages that have been marked for installation or deletion. Unlike other filters, this leaves the marks intact.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/package.el.gz
(defun package-menu-filter-marked ()
  "Filter \"*Packages*\" buffer by non-empty mark.
Show only the packages that have been marked for installation or deletion.
Unlike other filters, this leaves the marks intact."
  (interactive nil package-menu-mode)
  (package--ensure-package-menu-mode)
  (widen)
  (let (found-entries mark pkg-id entry marks)
    (save-excursion
      (goto-char (point-min))
      (while (not (eobp))
        (setq mark (char-after))
        (unless (eq mark ?\s)
          (setq pkg-id (tabulated-list-get-id))
          (setq entry (package-menu--print-info-simple pkg-id))
          (push entry found-entries)
          ;; remember the mark
          (push (cons pkg-id mark) marks))
        (forward-line))
      (if found-entries
          (progn
            (setq tabulated-list-entries found-entries)
            (package-menu--display t nil)
            ;; redo the marks, but we must remember the marks!!
            (goto-char (point-min))
            (while (not (eobp))
              (setq mark (cdr (assq (tabulated-list-get-id) marks)))
              (tabulated-list-put-tag (char-to-string mark) t)))
        (user-error "No packages found")))))