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: Fri, 01 Apr 2016 23:35:21 +0300 Message-ID: <83wpohrrsm.fsf@gnu.org> References: <83y4j9duh6.fsf@gnu.org> <83bng3etpy.fsf@gnu.org> 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: 8bit X-Trace: ger.gmane.org 1459543050 25782 80.91.229.3 (1 Apr 2016 20:37:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Apr 2016 20:37:30 +0000 (UTC) Cc: 20892@debbugs.gnu.org, monnier@iro.umontreal.ca To: joaotavora@gmail.com (=?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 Fri Apr 01 22:37:15 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 1am5og-0001f7-78 for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Apr 2016 22:37:14 +0200 Original-Received: from localhost ([::1]:46304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1am5of-0004Vn-OK for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Apr 2016 16:37:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1am5oZ-0004SX-41 for bug-gnu-emacs@gnu.org; Fri, 01 Apr 2016 16:37:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1am5oU-0000GS-Hx for bug-gnu-emacs@gnu.org; Fri, 01 Apr 2016 16:37:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1am5oU-0000GN-Du for bug-gnu-emacs@gnu.org; Fri, 01 Apr 2016 16:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1am5oU-0003Nj-9Y for bug-gnu-emacs@gnu.org; Fri, 01 Apr 2016 16:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Apr 2016 20:37:02 +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.145954296812937 (code B ref 20892); Fri, 01 Apr 2016 20:37:02 +0000 Original-Received: (at 20892) by debbugs.gnu.org; 1 Apr 2016 20:36:08 +0000 Original-Received: from localhost ([127.0.0.1]:47597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1am5nc-0003Mb-9o for submit@debbugs.gnu.org; Fri, 01 Apr 2016 16:36:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48237) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1am5nb-0003MD-3L for 20892@debbugs.gnu.org; Fri, 01 Apr 2016 16:36:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1am5nR-0008Cv-87 for 20892@debbugs.gnu.org; Fri, 01 Apr 2016 16:36:01 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1am5nR-0008Cr-57; Fri, 01 Apr 2016 16:35:57 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3371 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1am5nM-0007hJ-Re; Fri, 01 Apr 2016 16:35:56 -0400 In-reply-to: (joaotavora@gmail.com) 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:115851 Archived-At: > 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. Can you explain, or show the evidence that vc-setup-buffer is the culprit here? > If, to this, we add a fix in lisp/vc/vc-git.el and don't let it override > an existing `coding-system-for-read'... > > diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el > index 8498cc8..c60125c 100644 > --- a/lisp/vc/vc-git.el > +++ b/lisp/vc/vc-git.el > @@ -1387,8 +1387,10 @@ This command shares argument histories with \\[rgrep] and \\[grep]." > "A wrapper around `vc-do-command' for use in vc-git.el. > The difference to vc-do-command is that this function always invokes > `vc-git-program'." > - (let ((coding-system-for-read vc-git-commits-coding-system) > - (coding-system-for-write vc-git-commits-coding-system)) > + (let ((coding-system-for-read (or coding-system-for-read > + vc-git-commits-coding-system)) > + (coding-system-for-write (or coding-system-for-write > + vc-git-commits-coding-system))) > (apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program > ;; http://debbugs.gnu.org/16897 > (unless (and (not (cdr-safe file-or-list)) > > the system seems to do the right thing and honour the intention of > > commit 0e2c793ffefa72c40c7731847d8210c2d7d0e515 > Author: Eli Zaretskii > Date: Tue Nov 26 21:17:55 2013 +0200 > > Fix ugly ^M characters in Diff output shown by "C-x v u". > > What do you think? I think that fixing EOL decoding shouldn't touch the value of coding-system-for-read, only its EOL decoding part, if at all. And I also don't see how does binding in vc-git interfere with the EOL format of the diffs. Can you tell the details, i.e. how did you arrive at the conclusion that the above binding is the culprit? Thanks.