diff options
| author | Chong Yidong | 2010-07-16 11:42:15 -0400 |
|---|---|---|
| committer | Chong Yidong | 2010-07-16 11:42:15 -0400 |
| commit | fea9cabd275c3d5809b824a6e4a1446441a6793e (patch) | |
| tree | a5eb69edf85fe28f6b4d5bbc8e3c2c3cfc3d0d37 /lisp/vc | |
| parent | 7e4289ad2bbd9f8ed18902f652d3f07380b227bf (diff) | |
| parent | f253ef6a8e0dd71cf9fd58e3d9407549d30e091d (diff) | |
| download | emacs-fea9cabd275c3d5809b824a6e4a1446441a6793e.tar.gz emacs-fea9cabd275c3d5809b824a6e4a1446441a6793e.zip | |
Merge changes from emacs-23 branch.
Diffstat (limited to 'lisp/vc')
| -rw-r--r-- | lisp/vc/vc.el | 17 |
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 | |||
| 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 |
| @@ -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 |