From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#14342: 24.3; On windows: presence of carriage returns in diff output buffers depends on the presence of non-ascii characters in that output Date: Fri, 03 May 2013 15:17:26 +0300 Message-ID: <83zjwcmf55.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1367583521 23575 80.91.229.3 (3 May 2013 12:18:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 May 2013 12:18:41 +0000 (UTC) Cc: 14342-done@debbugs.gnu.org To: Albert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 03 14:18:39 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UYEwe-0002Vy-KO for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 May 2013 14:18:36 +0200 Original-Received: from localhost ([::1]:51376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYEwe-0000qY-77 for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 May 2013 08:18:36 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYEwV-0000pC-64 for bug-gnu-emacs@gnu.org; Fri, 03 May 2013 08:18:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UYEwR-0001K2-6S for bug-gnu-emacs@gnu.org; Fri, 03 May 2013 08:18:27 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYEwR-0001Jv-1Q for bug-gnu-emacs@gnu.org; Fri, 03 May 2013 08:18:23 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UYEx4-0005DY-Lp for bug-gnu-emacs@gnu.org; Fri, 03 May 2013 08:19:02 -0400 Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 May 2013 12:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 14342 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 14342@debbugs.gnu.org, eliz@gnu.org, ab.for.lists@gmail.com Original-Received: via spool by 14342-done@debbugs.gnu.org id=D14342.136758350819887 (code D ref 14342); Fri, 03 May 2013 12:19:02 +0000 Original-Received: (at 14342-done) by debbugs.gnu.org; 3 May 2013 12:18:28 +0000 Original-Received: from localhost ([127.0.0.1]:56618 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UYEwW-0005Ag-7A for submit@debbugs.gnu.org; Fri, 03 May 2013 08:18:28 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:60078) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UYEwT-0005AN-Vg for 14342-done@debbugs.gnu.org; Fri, 03 May 2013 08:18:27 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MM800H001WGMR00@a-mtaout23.012.net.il> for 14342-done@debbugs.gnu.org; Fri, 03 May 2013 15:17:44 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MM800HA925IMD20@a-mtaout23.012.net.il>; Fri, 03 May 2013 15:17:44 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:73915 Archived-At: > Date: Fri, 3 May 2013 12:08:58 +0200 > From: Albert >=20 > - start emacs 24.3 with -Q (note: emacs 24.1 also shows the same be= haviour) > - make the following file and call it "file-abbbb" (insert the brok= en bar > with C-x 8 RET a6 RET): > line with =A6 (broken bar character) > bla > bla > bla > bla > - remove the last "bla" and write that as "file-abbb" > - again and write as "file-abb" > - set diff executable to msysgit 1.8.1.2 in customize Diff Command > "C:/Program Files/Git/bin/diff.exe" That's your problem, right there: you are using an MSYS port of Diff with the native Windows build of Emacs. MSYS ports are incompatible with native Windows programs wrt text/binary I/O issues, and the result is that some lines of Diff's output have DOS CRLF end of line, while others have the Unix-style LF-only there. Emacs cannot make heads or tails out of the resulting mess, so it does its best, which isn't much. Solution: use a native Windows port of Diff instead of the one that comes with msysgit. One such port is available here: http://gnuwin32.sourceforge.net/packages/diffutils.htm Alternatively, set up your Emacs to always use Unix-style EOLs in files it creates, either in certain volumes/directories or everywhere= . One way of doing this is using by the "untranslated filesystem" feature, described in the "Text and Binary" node of the Emacs user manual. Another way is to customize default-buffer-file-coding-syste= m to SOMETHING-unix, where SOMETHING is what it is set by default in your locale. The former lets you be selective regarding the directories where this will take place, the latter is global. > (By the way: these different behaviours cause problems with magit: > without the ^M's it is not possible to stage a region of a hunk, > with the ^M's it does work. Normally I would prefer the ^M's to be > absent.) If you need this for magit, I guess you must use the Diff program which came with msysgit, so the 2nd alternative described above is what you should explore. > Why is this behaviour dependent on the presence of a non-ascii char= acter? Because the decoding of the end-of-line (EOL) format is part of decoding non-ASCII characters. I'm closing this bug, since it's not an Emacs bug.