aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/vc
diff options
context:
space:
mode:
authorChong Yidong2010-07-16 11:42:15 -0400
committerChong Yidong2010-07-16 11:42:15 -0400
commitfea9cabd275c3d5809b824a6e4a1446441a6793e (patch)
treea5eb69edf85fe28f6b4d5bbc8e3c2c3cfc3d0d37 /lisp/vc
parent7e4289ad2bbd9f8ed18902f652d3f07380b227bf (diff)
parentf253ef6a8e0dd71cf9fd58e3d9407549d30e091d (diff)
downloademacs-fea9cabd275c3d5809b824a6e4a1446441a6793e.tar.gz
emacs-fea9cabd275c3d5809b824a6e4a1446441a6793e.zip
Merge changes from emacs-23 branch.
Diffstat (limited to 'lisp/vc')
-rw-r--r--lisp/vc/vc.el17
1 files changed, 16 insertions, 1 deletions
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 434c2a10e14..20e56bbd42f 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1437,6 +1437,16 @@ Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'."
1437;; (vc-call-backend ',(vc-backend f) 1437;; (vc-call-backend ',(vc-backend f)
1438;; 'diff (list ',f) ',rev1 ',rev2)))))) 1438;; 'diff (list ',f) ',rev1 ',rev2))))))
1439 1439
1440(defvar vc-coding-system-inherit-eol t
1441 "When non-nil, inherit the EOL format for reading Diff output from the file.
1442
1443Used in `vc-coding-system-for-diff' to determine the EOL format to use
1444for reading Diff output for a file. If non-nil, the EOL format is
1445inherited from the file itself.
1446Set this variable to nil if your Diff tool might use a different
1447EOL. Then Emacs will auto-detect the EOL format in Diff output, which
1448gives better results.") ;; Cf. bug#4451.
1449
1440(defun vc-coding-system-for-diff (file) 1450(defun vc-coding-system-for-diff (file)
1441 "Return the coding system for reading diff output for FILE." 1451 "Return the coding system for reading diff output for FILE."
1442 (or coding-system-for-read 1452 (or coding-system-for-read
@@ -1444,7 +1454,12 @@ Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'."
1444 ;; use the buffer's coding system 1454 ;; use the buffer's coding system
1445 (let ((buf (find-buffer-visiting file))) 1455 (let ((buf (find-buffer-visiting file)))
1446 (when buf (with-current-buffer buf 1456 (when buf (with-current-buffer buf
1447 buffer-file-coding-system))) 1457 (if vc-coding-system-inherit-eol
1458 buffer-file-coding-system
1459 ;; Don't inherit the EOL part of the coding-system,
1460 ;; because some Diff tools may choose to use
1461 ;; a different one. bug#4451.
1462 (coding-system-base buffer-file-coding-system)))))
1448 ;; otherwise, try to find one based on the file name 1463 ;; otherwise, try to find one based on the file name
1449 (car (find-operation-coding-system 'insert-file-contents file)) 1464 (car (find-operation-coding-system 'insert-file-contents file))
1450 ;; and a final fallback 1465 ;; and a final fallback