From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.bugs Subject: bug#18236: diff-apply-hunk interacts poorly with line endings Date: Wed, 17 Feb 2016 16:35:04 +0100 Message-ID: <87oabfz6xj.fsf@mbork.pl> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1455723676 20202 80.91.229.3 (17 Feb 2016 15:41:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Feb 2016 15:41:16 +0000 (UTC) Cc: 18236@debbugs.gnu.org To: Reuben Thomas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 17 16:41:08 2016 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 1aW4Dy-0002JX-OJ for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Feb 2016 16:41:06 +0100 Original-Received: from localhost ([::1]:58788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW4Dv-0000Bt-1f for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Feb 2016 10:41:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW497-0000ES-OP for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2016 10:36:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aW494-0001am-Ip for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2016 10:36:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW494-0001af-Fu for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2016 10:36:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aW494-0001E5-8K for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2016 10:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Feb 2016 15:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18236 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18236-submit@debbugs.gnu.org id=B18236.14557233174658 (code B ref 18236); Wed, 17 Feb 2016 15:36:02 +0000 Original-Received: (at 18236) by debbugs.gnu.org; 17 Feb 2016 15:35:17 +0000 Original-Received: from localhost ([127.0.0.1]:39773 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aW48L-0001D4-JS for submit@debbugs.gnu.org; Wed, 17 Feb 2016 10:35:17 -0500 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:41036) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aW48J-0001Cv-NJ for 18236@debbugs.gnu.org; Wed, 17 Feb 2016 10:35:16 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 5AC1A9D2004; Wed, 17 Feb 2016 16:35:13 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W2lA16NnoJPP; Wed, 17 Feb 2016 16:35:05 +0100 (CET) Original-Received: from localhost (unknown [IPv6:2001:808:114:6:a288:b4ff:fe90:5e24]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 3870A9D2003; Wed, 17 Feb 2016 16:35:05 +0100 (CET) In-Reply-To: (Reuben Thomas's message of "Sun, 10 Aug 2014 16:34:23 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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:113186 Archived-At: On 2014-08-10, at 17:34, Reuben Thomas wrote: > I'm using Emacs 24.3. Consider the following two files: > > foo: > ----cut here---- > This is a small test file. > It has DOS line endings. > ----cut here---- > > bar: > ----cut here---- > This is a small test file. > It too has DOS line endings. > ----cut here---- > > Save them with DOS line endings, and > > diff foo bar > foo.patch > cp foo bar > > Visit foo.patch. When I do that, each line ends in ^M. > > Now, in the patch buffer, M-x diff-apply-hunk. Note that the ^Ms have been added to the lines. Writing the buffer and examination with "hd" reveals that each line now ends > \r\r\n. > > It seems what's happened here is that diff-mode doesn't try to diagnose the character encoding of the patch file. Hi all, confirmed on GNU Emacs 25.1.50.2 (commit 4ccd268). Best, -- Marcin Borkowski