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
      (let* ((next (pop remaining))
             (file (if (consp next) (car next) next)))
        (if (file-directory-p file)
            (setq remaining
                  (nconc (vc-dir-status-files file nil backend)
                         remaining))
          (push file
                (alist-get (if (consp next)
                               (cadr next)
                             (vc-state next backend))
                           ret-val)))))
    ret-val))