Variable: package-vc-heuristic-alist

package-vc-heuristic-alist is a customizable variable defined in package-vc.el.gz.

Value

(("\\`https?://\\(?:\\(?:www\\.\\)?github\\.com/[._[:alnum:]-]+/[._[:alnum:]-]+\\|codeberg\\.org/[._[:alnum:]-]+/[._[:alnum:]-]+\\|\\(?:www\\.\\)?gitlab\\(?:\\.[[:alnum:]]+\\)+/[._[:alnum:]-]+/[._[:alnum:]-]+\\|git\\.sr\\.ht/~[._[:alnum:]-]+/[._[:alnum:]-]+\\|git\\.\\(?:s\\(?:avannah\\|v\\)\\)\\.\\(?:non\\)?gnu\\.org/\\(?:git\\|r\\)/[._[:alnum:]-]+/?\\)\\(?:/?\\|\\.git\\)\\'"
  . Git)
 ("\\`https?://\\(?:hg\\.sr\\.ht/~[._[:alnum:]-]+/[._[:alnum:]-]+\\|hg\\.\\(?:s\\(?:avannah\\|v\\)\\)\\.\\(?:non\\)?gnu\\.org/hgweb/[._[:alnum:]-]+/?\\)\\'"
  . Hg)
 ("\\`https?://bzr\\.\\(?:s\\(?:avannah\\|v\\)\\)\\.\\(?:non\\)?gnu\\.org/r/[._[:alnum:]-]+/?\\'"
  . Bzr))

Documentation

Alist mapping repository URLs to VC backends.

package-vc-install consults this alist to determine the VC backend from the repository URL when you call it without specifying a backend. Each element of the alist has the form
(URL-REGEXP . BACKEND). package-vc-install will use BACKEND of
the first association for which the URL of the repository matches the URL-REGEXP of the association. If no match is found, package-vc-install uses package-vc-default-backend instead.

This variable was added, or its default value changed, in Emacs 29.1.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/package-vc.el.gz
(defcustom package-vc-heuristic-alist
  `((,(rx bos "http" (? "s") "://"
          (or (: (? "www.") "github.com"
                 "/" (+ (or alnum "-" "." "_"))
                 "/" (+ (or alnum "-" "." "_")))
              (: "codeberg.org"
                 "/" (+ (or alnum "-" "." "_"))
                 "/" (+ (or alnum "-" "." "_")))
              (: (? "www.") "gitlab" (+ "." (+ alnum))
                 "/" (+ (or alnum "-" "." "_"))
                 "/" (+ (or alnum "-" "." "_")))
              (: "git.sr.ht"
                 "/~" (+ (or alnum "-" "." "_"))
                 "/" (+ (or alnum "-" "." "_")))
              (: "git." (or "savannah" "sv") "." (? "non") "gnu.org/"
                 (or "r" "git") "/"
                 (+ (or alnum "-" "." "_")) (? "/")))
          (or (? "/") ".git") eos)
     . Git)
    (,(rx bos "http" (? "s") "://"
          (or (: "hg.sr.ht"
                 "/~" (+ (or alnum "-" "." "_"))
                 "/" (+ (or alnum "-" "." "_")))
              (: "hg." (or "savannah" "sv") "." (? "non") "gnu.org/hgweb/"
                 (+ (or alnum "-" "." "_")) (? "/")))
          eos)
     . Hg)
    (,(rx bos "http" (? "s") "://"
          (or (: "bzr." (or "savannah" "sv") "." (? "non") "gnu.org/r/"
                 (+ (or alnum "-" "." "_")) (? "/")))
          eos)
     . Bzr))
  "Alist mapping repository URLs to VC backends.
`package-vc-install' consults this alist to determine the VC
backend from the repository URL when you call it without
specifying a backend.  Each element of the alist has the form
\(URL-REGEXP . BACKEND).  `package-vc-install' will use BACKEND of
the first association for which the URL of the repository matches
the URL-REGEXP of the association.  If no match is found,
`package-vc-install' uses `package-vc-default-backend' instead."
  :type `(alist :key-type (regexp :tag "Regular expression matching URLs")
                :value-type ,package-vc--backend-type)
  :version "29.1")