diff options
| author | Eli Zaretskii | 2013-11-26 21:17:55 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2013-11-26 21:17:55 +0200 |
| commit | 0e2c793ffefa72c40c7731847d8210c2d7d0e515 (patch) | |
| tree | 009159dff9b08300bcb05a4325eafa9baabc9411 | |
| parent | 447bdcb8d26da5664ff2b127489f9b2209de227e (diff) | |
| download | emacs-0e2c793ffefa72c40c7731847d8210c2d7d0e515.tar.gz emacs-0e2c793ffefa72c40c7731847d8210c2d7d0e515.zip | |
Fix ugly ^M characters in Diff output shown by "C-x v u".
lisp/vc/vc.el (vc-diff-internal): Use *-dos coding-system when
reading output from Diff on MS-Windows and MS-DOS.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/vc/vc.el | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9554f8f45bb..1e7fc7c9184 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-11-26 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * vc/vc.el (vc-diff-internal): Use *-dos coding-system when | ||
| 4 | reading output from Diff on MS-Windows and MS-DOS. | ||
| 5 | |||
| 1 | 2013-11-26 Bozhidar Batsov <bozhidar@batsov.com> | 6 | 2013-11-26 Bozhidar Batsov <bozhidar@batsov.com> |
| 2 | 7 | ||
| 3 | * emacs-lisp/helpers.el (string-reverse): New function. | 8 | * emacs-lisp/helpers.el (string-reverse): New function. |
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index bf69a1ccecc..0ef13bfc61d 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -1641,6 +1641,13 @@ Return t if the buffer had changes, nil otherwise." | |||
| 1641 | ;; be to call the back end separately for each file. | 1641 | ;; be to call the back end separately for each file. |
| 1642 | (coding-system-for-read | 1642 | (coding-system-for-read |
| 1643 | (if files (vc-coding-system-for-diff (car files)) 'undecided))) | 1643 | (if files (vc-coding-system-for-diff (car files)) 'undecided))) |
| 1644 | ;; On MS-Windows and MS-DOS, Diff is likely to produce DOS-style | ||
| 1645 | ;; EOLs, which will look ugly if (car files) happens to have Unix | ||
| 1646 | ;; EOLs. | ||
| 1647 | (if (memq system-type '(windows-nt ms-dos)) | ||
| 1648 | (setq coding-system-for-read | ||
| 1649 | (coding-system-change-eol-conversion coding-system-for-read | ||
| 1650 | 'dos))) | ||
| 1644 | (vc-setup-buffer buffer) | 1651 | (vc-setup-buffer buffer) |
| 1645 | (message "%s" (car messages)) | 1652 | (message "%s" (car messages)) |
| 1646 | ;; Many backends don't handle well the case of a file that has been | 1653 | ;; Many backends don't handle well the case of a file that has been |