Function: vc--fileset-by-state

vc--fileset-by-state is a byte-compiled function defined in vc.el.gz.

Signature

(vc--fileset-by-state FILESET)

Documentation

Return alist of VC states of all files in FILESET.

The keys into the alist are VC states, and the values are file names. For directories in FILESET, the alist includes values for all non-ignored, non-up-to-date files within those directories.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
(defun vc--fileset-by-state (fileset)
  "Return alist of VC states of all files in FILESET.
The keys into the alist are VC states, and the values are file names.
For directories in FILESET, the alist includes values for all
non-ignored, non-up-to-date files within those directories."
  (let ((backend (car fileset))
        (remaining (cadr fileset))
        ret-val)
    (while remaining
      (cond* ((bind* (next (pop remaining))))
             ((atom next)
              (push next (alist-get (vc-state next backend) ret-val)))
             ((bind* (file (car next))))
             ((file-directory-p file)
              (setq remaining
                    (nconc (vc-dir-status-files file nil backend)
                           remaining)))
             (t
              (push file (alist-get (cadr next) ret-val)))))
    ret-val))