From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#20892: 25.0.50; Applying vc-diff hunks on CRLF tracked files Date: Thu, 25 Jun 2015 14:54:26 +0100 Message-ID: References: <83y4j9duh6.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1435240527 5641 80.91.229.3 (25 Jun 2015 13:55:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Jun 2015 13:55:27 +0000 (UTC) Cc: 20892@debbugs.gnu.org To: Eli Zaretskii , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 25 15:55:20 2015 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 1Z87cc-0002nR-MF for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Jun 2015 15:55:18 +0200 Original-Received: from localhost ([::1]:55887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z87cb-0008CE-T0 for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Jun 2015 09:55:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z87cU-0008BJ-Es for bug-gnu-emacs@gnu.org; Thu, 25 Jun 2015 09:55:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z87cO-0004iF-6l for bug-gnu-emacs@gnu.org; Thu, 25 Jun 2015 09:55:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z87cO-0004i2-3H for bug-gnu-emacs@gnu.org; Thu, 25 Jun 2015 09:55:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z87cN-0002zd-GG for bug-gnu-emacs@gnu.org; Thu, 25 Jun 2015 09:55:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Jun 2015 13:55:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20892 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20892-submit@debbugs.gnu.org id=B20892.143524049411482 (code B ref 20892); Thu, 25 Jun 2015 13:55:03 +0000 Original-Received: (at 20892) by debbugs.gnu.org; 25 Jun 2015 13:54:54 +0000 Original-Received: from localhost ([127.0.0.1]:57016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z87cD-0002z7-Ef for submit@debbugs.gnu.org; Thu, 25 Jun 2015 09:54:53 -0400 Original-Received: from mail-ig0-f182.google.com ([209.85.213.182]:35898) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z87cB-0002yu-J9 for 20892@debbugs.gnu.org; Thu, 25 Jun 2015 09:54:52 -0400 Original-Received: by igbiq7 with SMTP id iq7so119244102igb.1 for <20892@debbugs.gnu.org>; Thu, 25 Jun 2015 06:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=cIF819pruhvDrTjX6njpa/gS5wFbx/sQUrUI0gZ2mg4=; b=aEld2Sy9ZGaz+zZQZcMtTT437WJNpQXBC/dHfKlUQf9WGO2lprASFyOpIK57uGR966 DI7uXExAtro+IAta9nxAF4OpCSJi9y+Tjr/YAj93oMMK4VgfBGcQcmFBo6PK+qwSCepo CcmwBbTfghDln9CdFkfre+bLzsSnEv4wQRBtFU/2nDgsW++3hd44UTFSF83I8mSIeLtc DG8Z/eg/k903nYqCrl6QonRPgNRP/nWsr05d9+xQD7O0MnMixQ5IfZbjJA1J1oRN1y/X 28kKGI3Oii3Qg9tptnRzgMe2M/5vBRQr0hetdqvPZp2DS914zE/Hyfv4zvj5v0ThYLZg uFxA== X-Received: by 10.50.141.164 with SMTP id rp4mr4300199igb.2.1435240485808; Thu, 25 Jun 2015 06:54:45 -0700 (PDT) Original-Received: by 10.107.15.32 with HTTP; Thu, 25 Jun 2015 06:54:26 -0700 (PDT) In-Reply-To: <83y4j9duh6.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.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:104333 Archived-At: On Wed, Jun 24, 2015 at 3:57 PM, Eli Zaretskii wrote: > > > From: joaotavora@gmail.com (Jo=C3=A3o T=C3=A1vora) > > Date: Wed, 24 Jun 2015 12:29:05 +0100 > > > > @@ -1799,7 +1799,8 @@ > > (with-current-buffer buf > > (goto-char (car pos)) > > (delete-region (car pos) (cdr pos)) > > - (insert (car new))) > > + (insert (decode-coding-string (car new) > > + buffer-file-coding-system))) > > That doesn't sound right: the string you are passing to > decode-coding-string is already a multibyte string in Emacs's internal > representation. So decoding it one more time is not what you want. > > I think we should simply remove the CR characters from the end of each > line, if buffer-file-coding-system states DOS EOL format. (You can > check the latter with coding-system-eol-type.) I see my mistake now, thanks. (also thanks Stefan). It worked so I assumed magically it's the right thing without thinking too hard. But I don't think simply removing the CR characters is the right thing, we should interpret them according to coding-system-eol-type, right? It's more complicated, but I can give it a try (maybe meanwhile commit a patch that does what you say to fix the current unusable state of diff-apply-hunk in this situation) So, say a diff hunk contains just a couple of lines with CRLF and a couple of lines just LF. If applied to a buffer that is all CRLF, I would say that applying this hunk should eventually provoke the normal Emacs behaviour of highlighting all CR's except for the two lines with LF. Is it worth it? What do you both think? Jo=C3=A3o