Function: vc-switches

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

Signature

(vc-switches BACKEND OP)

Documentation

Return a list of vc-BACKEND switches for operation OP.

BACKEND is a symbol such as CVS, which will be downcased. OP is a symbol such as diff.

In decreasing order of preference, return the value of: vc-BACKEND-OP-switches (e.g. vc-cvs-diff-switches); vc-OP-switches (e.g. vc-diff-switches); or, in the case of diff only, diff-switches(var)/diff-switches(fun).

If the chosen value is not a string or a list, return nil. This is so that you may set, e.g. vc-svn-diff-switches to t in order to override the value of vc-diff-switches and diff-switches(var)/diff-switches(fun).

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
(defun vc-switches (backend op)
  "Return a list of vc-BACKEND switches for operation OP.
BACKEND is a symbol such as `CVS', which will be downcased.
OP is a symbol such as `diff'.

In decreasing order of preference, return the value of:
vc-BACKEND-OP-switches (e.g. `vc-cvs-diff-switches');
vc-OP-switches (e.g. `vc-diff-switches'); or, in the case of
diff only, `diff-switches'.

If the chosen value is not a string or a list, return nil.
This is so that you may set, e.g. `vc-svn-diff-switches' to t in order
to override the value of `vc-diff-switches' and `diff-switches'."
  (let ((switches
	 (or (when backend
	       (let ((sym (vc-make-backend-sym
			   backend (intern (concat (symbol-name op)
						   "-switches")))))
		   (when (boundp sym) (symbol-value sym))))
	     (let ((sym (intern (format "vc-%s-switches" (symbol-name op)))))
	       (when (boundp sym) (symbol-value sym)))
	     (cond
	      ((eq op 'diff) diff-switches)))))
    (if (stringp switches) (list switches)
      ;; If not a list, return nil.
      ;; This is so we can set vc-diff-switches to t to override
      ;; any switches in diff-switches.
      (when (listp switches) switches))))