Function: project--vc-ignores

project--vc-ignores is a byte-compiled function defined in project.el.gz.

Signature

(project--vc-ignores DIR BACKEND EXTRA-IGNORES)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/project.el.gz
(defun project--vc-ignores (dir backend extra-ignores)
  (require 'vc)             ; Can be removed when we require Emacs 31.1.
  (append
   (when backend
     (delq
      nil
      (mapcar
       (lambda (entry)
         (cond
          ((eq ?! (aref entry 0))
           ;; No support for whitelisting (yet).
           nil)
          ((string-match "\\(/\\)[^/]" entry)
           ;; FIXME: This seems to be Git-specific.
           ;; And / in the entry (start or even the middle) means
           ;; the pattern is "rooted".  Or actually it is then
           ;; relative to its respective .gitignore (of which there
           ;; could be several), but we only support .gitignore at
           ;; the root.
           (if (= (match-beginning 0) 0)
               (replace-match "./" t t entry 1)
             (concat "./" entry)))
          (t entry)))
       (vc-call-backend backend 'ignore-completion-table dir))))
   extra-ignores
   (mapcar
    (lambda (dir)
      (concat dir "/"))
    vc-directory-exclusion-list)))