Function: tramp-vc-file-name-handler
tramp-vc-file-name-handler is a byte-compiled function defined in
tramp-sh.el.gz.
Signature
(tramp-vc-file-name-handler OPERATION &rest ARGS)
Documentation
Invoke special file name handler, which collects files to be handled.
Source Code
;; Defined in /usr/src/emacs/lisp/net/tramp-sh.el.gz
(defun tramp-vc-file-name-handler (operation &rest args)
"Invoke special file name handler, which collects files to be handled."
(save-match-data
(let ((filename
(tramp-replace-environment-variables
(apply #'tramp-file-name-for-operation operation args)))
(fn (assoc operation tramp-sh-file-name-handler-alist)))
(if (tramp-tramp-file-p filename)
(with-parsed-tramp-file-name filename nil
(cond
;; That's what we want: file names, for which checks are
;; applied. We assume that VC uses only `file-exists-p'
;; and `file-readable-p' checks; otherwise we must extend
;; the list. We do not perform any action, but return
;; nil, in order to keep `vc-registered' running.
((and fn (memq operation '(file-exists-p file-readable-p)))
(add-to-list 'tramp-vc-registered-file-names localname 'append)
nil)
;; `process-file' and `start-file-process' shall be ignored.
((and fn (eq operation 'process-file) 0))
((and fn (eq operation 'start-file-process) nil))
;; Tramp file name handlers like `expand-file-name'. They
;; must still work.
(fn (save-match-data (apply (cdr fn) args)))
;; Default file name handlers, we don't care.
(t (tramp-run-real-handler operation args))))
;; When `tramp-mode' is not enabled, or the file name is
;; quoted, we don't do anything.
(tramp-run-real-handler operation args)))))