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#20892: 25.0.50; Applying vc-diff hunks on CRLF tracked files Date: Sat, 02 Apr 2016 12:31:40 +0300 Message-ID: <83oa9ss6f7.fsf@gnu.org> References: <83y4j9duh6.fsf@gnu.org> <83bng3etpy.fsf@gnu.org> <83wpohrrsm.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1459589601 13525 80.91.229.3 (2 Apr 2016 09:33:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 Apr 2016 09:33:21 +0000 (UTC) Cc: 20892@debbugs.gnu.org, monnier@iro.umontreal.ca To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 02 11:33:11 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 1amHva-0002MV-Nm for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Apr 2016 11:33:10 +0200 Original-Received: from localhost ([::1]:48696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amHvZ-00043K-Ua for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Apr 2016 05:33:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amHvW-000430-6f for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2016 05:33:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1amHvS-0006LB-5Z for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2016 05:33:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amHvS-0006L7-1d for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2016 05:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1amHvR-0006PY-Ti for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2016 05:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Apr 2016 09:33:01 +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.145958954324599 (code B ref 20892); Sat, 02 Apr 2016 09:33:01 +0000 Original-Received: (at 20892) by debbugs.gnu.org; 2 Apr 2016 09:32:23 +0000 Original-Received: from localhost ([127.0.0.1]:47784 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1amHup-0006Oh-Hn for submit@debbugs.gnu.org; Sat, 02 Apr 2016 05:32:23 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49185) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1amHun-0006OV-Q4 for 20892@debbugs.gnu.org; Sat, 02 Apr 2016 05:32:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1amHue-0005qu-PH for 20892@debbugs.gnu.org; Sat, 02 Apr 2016 05:32:16 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36638) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amHue-0005qh-Lj; Sat, 02 Apr 2016 05:32:12 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4536 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1amHud-0001pZ-UG; Sat, 02 Apr 2016 05:32:12 -0400 In-reply-to: (message from =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= on Fri, 1 Apr 2016 23:51:47 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:115861 Archived-At: > From: João Távora > Date: Fri, 1 Apr 2016 23:51:47 +0100 > Cc: Stefan Monnier , 20892@debbugs.gnu.org > > On Apr 1, 2016 21:36, "Eli Zaretskii" wrote: > > > > > From: joaotavora@gmail.com (João Távora) > > > Cc: monnier@iro.umontreal.ca, 20892@debbugs.gnu.org > > > Date: Fri, 01 Apr 2016 11:22:50 +0100 > > > > > > In lisp/vc/vc.el, in vc-diff-internal, dynamically binding > > > `coding-system-for-read' seems to be defeated by a call to > > > `vc-setup-buffer', which in turn kills all local variables. > > > > > > I don't fully understand the interaction between buffer-local and > > > lexically/dinamically bound variables but this seems wrong, right? > > > > How come kill-all-local-variables can have any effect on the binding > > of coding-system-for-read. > > I don't know. I said I don't fully understand that part. > > > Can you explain, or show the evidence that > > vc-setup-buffer is the culprit here? > > I edebugged and evalled coding-system-for-read before and after the > call to vc-setup-buffer. It lost its non-nil value before and after > the call to that vc-setup-buffer. > > What may possibly have happened is that when testing I set it globally > and hence violated some important assumption. I am away from the w32 > machine where this happened, but I will try again monday. I cannot reproduce your result: when I edebug the relevant code, coding-system-for-read gets bound to undecided-dos before the call to vc-setup-buffer, and stays at that value after the call returns. > emacs -Q bla.txt > M-x vc-diff > > The pesky ^M *and* escape sequences appear in the output. I just tried > this on mac and the same happens. Two things fix this: > > 1) The second part of my patch, to `vc-git-command'. It seems to > respect the (apparent) fact that coding-system-for-{read,write} are > supposed to be dynamically bindable overrides. > 2) file-locally or dir-locally seting vc-git-commits-coding-system in > my configuration. > > >From reading the code and your messages I was under the impression > that you agreed this was a bug. It is in my opinion (and I also think > it is a regression). > > Anyway I think 1) is a sound fix but 2) will also do the job perfectly > well apparently. On monday I will investigate the kill-local-variables > thing again. Refraining from overriding coding-system-for-read/write if they are already bound is a Good Thing, so I installed that change in the emacs-25 branch. However, re-reading the original bug report, I'm now confused. Originally, you said that the ^M characters in the vc-diff output were correct, and your problem was with applying the hunks. If you now say that the problem is with those ^M characters, and applying the hunks after that is no longer a problem, then we can now close this bug. Please clarify.