summaryrefslogtreecommitdiff
path: root/lisp/vc/vc-annotate.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2016-03-31 23:01:13 +0300
committerEli Zaretskii <eliz@gnu.org>2016-03-31 23:01:13 +0300
commite30c3e9a9cca3ae84d4da132f334f1b8b6df45ac (patch)
tree2f07b17ae23a414daff6a0ee13116345f27b8f9c /lisp/vc/vc-annotate.el
parentdf441b362c25c4ad59ea3d83137328d0d4098eaf (diff)
downloademacs-e30c3e9a9cca3ae84d4da132f334f1b8b6df45ac.tar.gz
Fix EOL decoding in vc-annotate with SVN back-end on MS-Windows
* lisp/vc/vc-annotate.el (vc-annotate): Force DOS EOL decoding on MS-Windows and MS-DOS, when processing the output of "svn annotate".
Diffstat (limited to 'lisp/vc/vc-annotate.el')
-rw-r--r--lisp/vc/vc-annotate.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el
index ed038f1d4e5..379ac95517b 100644
--- a/lisp/vc/vc-annotate.el
+++ b/lisp/vc/vc-annotate.el
@@ -432,6 +432,14 @@ should be applied to the background or to the foreground."
(with-output-to-temp-buffer temp-buffer-name
(let ((backend (or vc-bk (vc-backend file)))
(coding-system-for-read buffer-file-coding-system))
+ ;; On DOS/Windows, "svn annotate" will produce CRLF EOLs even
+ ;; if the original file has Unix EOLs, which will show ^M
+ ;; characters in the Annotate buffer. Prevent that by forcing
+ ;; DOS EOL decoding.
+ (if (memq system-type '(windows-nt ms-dos))
+ (setq coding-system-for-read
+ (coding-system-change-eol-conversion coding-system-for-read
+ 'dos)))
(vc-call-backend backend 'annotate-command file
(get-buffer temp-buffer-name) rev)
;; we must setup the mode first, and then set our local