From: Eli Zaretskii Date: Tue, 26 Nov 2013 19:17:55 +0000 (+0200) Subject: Fix ugly ^M characters in Diff output shown by "C-x v u". X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~686 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0e2c793ffefa72c40c7731847d8210c2d7d0e515;p=emacs.git 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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9554f8f45bb..1e7fc7c9184 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-11-26 Eli Zaretskii + + * vc/vc.el (vc-diff-internal): Use *-dos coding-system when + reading output from Diff on MS-Windows and MS-DOS. + 2013-11-26 Bozhidar Batsov * 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." ;; be to call the back end separately for each file. (coding-system-for-read (if files (vc-coding-system-for-diff (car files)) 'undecided))) + ;; On MS-Windows and MS-DOS, Diff is likely to produce DOS-style + ;; EOLs, which will look ugly if (car files) happens to have Unix + ;; EOLs. + (if (memq system-type '(windows-nt ms-dos)) + (setq coding-system-for-read + (coding-system-change-eol-conversion coding-system-for-read + 'dos))) (vc-setup-buffer buffer) (message "%s" (car messages)) ;; Many backends don't handle well the case of a file that has been