 ;;;; Interactive helpers
 ;;;;; Package selection
 
-(defun straight--select-package (message &optional for-build installed)
+(defun straight--select-package (message &optional filter)
   "Use `completing-read' to select a package.
 MESSAGE is displayed as the prompt; it should not end in punctuation
-or whitespace. If FOR-BUILD is non-nil, then packages with an
-explicitly nil `:build' property are excluded. If INSTALLED is
-non-nil, then only packages that have an available repo are
-considered."
+or whitespace.
+
+FILTER is a function accepting one argument: a straight style recipe plist.
+If it returns nil, the package is not considered a selection candidate."
   (completing-read
    (concat message ": ")
    (let ((packages nil))
-     (maphash
-      (lambda (package recipe)
-        (let ((build (plist-member recipe :build)))
-          (unless (or (and for-build build (not (cadr build)))
-                      (and installed
-                           (or (null (plist-get recipe :local-repo))
-                               (not (straight--repository-is-available-p
-                                     recipe)))))
-            (push package packages))))
-      straight--recipe-cache)
+     (maphash (lambda (package recipe)
+                (when (or (null filter)
+                          (funcall filter (plist-put recipe :package package)))
+                  (push package packages)))
+              straight--recipe-cache)
      (nreverse packages))
    (lambda (_) t)
    'require-match))

all dependencies as well. See also `straight-check-package' and
`straight-rebuild-all'."
  (interactive
   (list
    (straight--select-package "Rebuild package" 'for-build 'installed)
    current-prefix-arg))
  (let ((straight--packages-to-rebuild
         (if recursive
             :all

using `completing-read'. With prefix argument FROM-UPSTREAM, pull
not just from primary remote but also from upstream (for forked
packages)."
  (interactive (list (straight--select-package "Pull package"
                                               #'straight--installed-p)
                     current-prefix-arg))
  (let ((recipe (gethash package straight--recipe-cache)))
    (and (straight-vc-fetch-from-remote recipe)
