Function: vc-deduce-fileset

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

Signature

(vc-deduce-fileset &optional NOT-STATE-CHANGING ALLOW-UNREGISTERED STATE-MODEL-ONLY-FILES)

Documentation

Deduce a set of files and a backend to which to apply an operation.

Return a list of the form:

  (BACKEND FILESET FILESET-ONLY-FILES STATE CHECKOUT-MODEL)

where the last 3 members are optional, and must be present only if STATE-MODEL-ONLY-FILES is non-nil.

NOT-STATE-CHANGING, if non-nil, means that the operation requesting the fileset doesn't intend to change the VC state, such as when printing the log or showing the diffs.

If the current buffer is in vc-dir or Dired mode, FILESET is the list of marked files, or the file under point if no files are marked. Otherwise, if the current buffer is visiting a version-controlled file or is an indirect buffer whose base buffer visits a version-controlled file, FILESET is a single-file list containing that file's name. Otherwise, if ALLOW-UNREGISTERED is non-nil and the visited file is unregistered, FILESET is a single-file list containing the name of the visited file. Otherwise, throw an error.

STATE-MODEL-ONLY-FILES, if non-nil, means that the caller needs the FILESET-ONLY-FILES, STATE, and CHECKOUT-MODEL info, where FILESET-ONLY-FILES means only files in similar VC states, possible values of STATE are explained in vc-state, and MODEL in vc-checkout-model. Otherwise, these 3 members may be omitted from the returned list.

BEWARE: this function may change the current buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
(defun vc-deduce-fileset (&optional not-state-changing
				    allow-unregistered
				    state-model-only-files)
  "Deduce a set of files and a backend to which to apply an operation.
Return a list of the form:

  (BACKEND FILESET FILESET-ONLY-FILES STATE CHECKOUT-MODEL)

where the last 3 members are optional, and must be present only if
STATE-MODEL-ONLY-FILES is non-nil.

NOT-STATE-CHANGING, if non-nil, means that the operation
requesting the fileset doesn't intend to change the VC state,
such as when printing the log or showing the diffs.

If the current buffer is in `vc-dir' or Dired mode, FILESET is the
list of marked files, or the file under point if no files are
marked.
Otherwise, if the current buffer is visiting a version-controlled
file or is an indirect buffer whose base buffer visits a
version-controlled file, FILESET is a single-file list containing
that file's name.
Otherwise, if ALLOW-UNREGISTERED is non-nil and the visited file
is unregistered, FILESET is a single-file list containing the
name of the visited file.
Otherwise, throw an error.

STATE-MODEL-ONLY-FILES, if non-nil, means that the caller needs
the FILESET-ONLY-FILES, STATE, and CHECKOUT-MODEL info, where
FILESET-ONLY-FILES means only files in similar VC states,
possible values of STATE are explained in `vc-state', and MODEL in
`vc-checkout-model'.  Otherwise, these 3 members may be omitted from
the returned list.

BEWARE: this function may change the current buffer."
  (with-current-buffer (or (buffer-base-buffer) (current-buffer))
    (vc-deduce-fileset-1 not-state-changing
                         allow-unregistered
                         state-model-only-files)))