]> git.eshelyaron.com Git - emacs.git/commitdiff
Only suggest packages with VC metadata
authorPhilip Kaludercic <philipk@posteo.net>
Wed, 3 Aug 2022 18:25:17 +0000 (20:25 +0200)
committerPhilip Kaludercic <philipk@posteo.net>
Wed, 3 Aug 2022 18:25:17 +0000 (20:25 +0200)
* package-vc.el (package-vc-fetch): Filter out packages without :vc
information in the interactive specification.

lisp/emacs-lisp/package-vc.el

index f2bd5072474f2c16d15c0101980b4940c98bce66..a6694edc9fc3dd544442f1ebfbac25dae1f3f02d 100644 (file)
@@ -41,6 +41,7 @@
 (require 'package)
 (require 'lisp-mnt)
 (require 'vc)
+(require 'seq)
 
 (defgroup package-vc nil
   "Manage packages from VC checkouts."
@@ -190,9 +191,12 @@ be requested using REV."
      ;; Initialize the package system to get the list of package
      ;; symbols for completion.
      (package--archives-initialize)
-     (let* ((input (completing-read
-                    "Fetch package source (name or URL): "
-                    package-archive-contents))
+     (let* ((packages (seq-filter
+                       (lambda (pkg)
+                         (alist-get :vc (package-desc-extras (cadr pkg))))
+                       package-archive-contents))
+            (input (completing-read
+                    "Fetch package source (name or URL): " packages))
             (name (file-name-base input)))
        (list input (intern (string-remove-prefix "emacs-" name))))))
   (package--archives-initialize)