Function: vc-backend

vc-backend is a byte-compiled function defined in vc-hooks.el.gz.

Signature

(vc-backend FILE-OR-LIST)

Documentation

Return the version control type of FILE-OR-LIST, nil if it's not registered.

If the argument is a list, the files must all have the same back end.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-hooks.el.gz
(defun vc-backend (file-or-list)
  "Return the version control type of FILE-OR-LIST, nil if it's not registered.
If the argument is a list, the files must all have the same back end."
  ;; `file' can be nil in several places (typically due to the use of
  ;; code like (vc-backend buffer-file-name)).
  (cond ((stringp file-or-list)
	 (let ((property (vc-file-getprop file-or-list 'vc-backend)))
	   ;; Note that internally, Emacs remembers unregistered
	   ;; files by setting the property to `none'.
	   (cond ((eq property 'none) nil)
		 (property)
		 ;; vc-registered sets the vc-backend property
		 (t (if (vc-registered file-or-list)
			(vc-file-getprop file-or-list 'vc-backend)
		      nil)))))
	((and file-or-list (listp file-or-list))
	 (vc-backend (car file-or-list)))
	(t
	 nil)))