Mercurial > emacs
comparison lisp/vc/vc.el @ 109445:051595eb9b58
Merge changes from emacs-23 branch.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Fri, 16 Jul 2010 11:42:15 -0400 |
parents | 60516122d066 |
children | d92d0e17a7ce 2bd8f25ebb95 3226ac2da7f7 d90a3bc6b730 |
comparison
equal
deleted
inserted
replaced
109443:9e514d1076b4 | 109445:051595eb9b58 |
---|---|
1435 ;; `(let ((coding-system-for-read (vc-coding-system-for-diff ',f))) | 1435 ;; `(let ((coding-system-for-read (vc-coding-system-for-diff ',f))) |
1436 ;; (message "Looking at %s" ',f) | 1436 ;; (message "Looking at %s" ',f) |
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 | |
1443 Used in `vc-coding-system-for-diff' to determine the EOL format to use | |
1444 for reading Diff output for a file. If non-nil, the EOL format is | |
1445 inherited from the file itself. | |
1446 Set this variable to nil if your Diff tool might use a different | |
1447 EOL. Then Emacs will auto-detect the EOL format in Diff output, which | |
1448 gives 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 |
1443 ;; if we already have this file open, | 1453 ;; if we already have this file open, |
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 |
1451 'undecided)) | 1466 'undecided)) |
1452 | 1467 |