GNU bug report logs - #13705
24.2.93; "^M" characters in diff buffers

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Wed, 13 Feb 2013 09:42:01 UTC

Severity: normal

Found in version 24.2.93

Done: Dani Moncayo <dmoncayo <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 13705 <at> debbugs.gnu.org
Subject: bug#13705: 24.2.93; "^M" characters in diff buffers
Date: Wed, 13 Feb 2013 18:25:31 +0200
> Date: Wed, 13 Feb 2013 10:40:22 +0100
> From: Dani Moncayo <dmoncayo <at> gmail.com>
> 
> Recipe from "emacs -Q":
> 1. Download the two attached files `fa' and `fb'.
> 2. M-x diff RET fb RET fa RET
> 
> In the *Diff* buffer, I see annoying/inappropriate "^M" characters at
> the end of the compared lines. (see attached screenshot)

It's most probably your Diff, not Emacs.  I cannot reproduce the
problem with the version of Diff I have here (which is a GnuWin32
port).  My crystal says that yours is from MSYS or maybe Cygwin, and
writes its output with Unix-style LF-only EOL format.  That presents
to Emacs text that has inconsistent EOLs (because the files you diff
have DOS CR-LF EOLs), so Emacs punts and doesn't decode the EOL
format.

To see if my crystal ball is as clear as it gets, try this:

  (let ((coding-system-for-read 'no-conversion))
    (call-process shell-file-name nil t nil
		  shell-command-switch "diff -c fa fb"))

and look at the lines generated by Diff, like these:

 *** fa	2013-02-12 18:41:03.201375000 +0200
 --- fb	2013-02-08 16:25:03.161000000 +0200

If they don't have the ^M character at their end, your problem is as I
described.

With my Diff, the above snippet gives me _all_ the lines with ^M,
which is consistent.




This bug report was last modified 12 years and 193 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.