Function: vc-coding-system-for-diff
vc-coding-system-for-diff is a byte-compiled function defined in
vc.el.gz.
Signature
(vc-coding-system-for-diff FILE)
Documentation
Return the coding system for reading diff output for FILE.
Source Code
;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
gives better results.") ;; Cf. bug#4451.
(defun vc-coding-system-for-diff (file)
"Return the coding system for reading diff output for FILE."
(or coding-system-for-read
;; if we already have this file open,
;; use the buffer's coding system
(let ((buf (find-buffer-visiting file)))
(when buf (with-current-buffer buf
(if vc-coding-system-inherit-eol
buffer-file-coding-system
;; Don't inherit the EOL part of the coding-system,
;; because some Diff tools may choose to use
;; a different one. bug#4451.
(coding-system-base buffer-file-coding-system)))))
;; otherwise, try to find one based on the file name
(car (find-operation-coding-system 'insert-file-contents file))
;; and a final fallback
'undecided))