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: Fri, 1 Apr 2016 23:51:47 +0100 Message-ID: References: <83y4j9duh6.fsf@gnu.org> <83bng3etpy.fsf@gnu.org> <83wpohrrsm.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 1459551202 17439 80.91.229.3 (1 Apr 2016 22:53:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Apr 2016 22:53:22 +0000 (UTC) Cc: 20892@debbugs.gnu.org, Stefan Monnier To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 02 00:53:14 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 1am7wG-00088V-Qb for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Apr 2016 00:53:13 +0200 Original-Received: from localhost ([::1]:46856 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1am7wD-0000iT-4K for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Apr 2016 18:53:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1am7w9-0000iK-DJ for bug-gnu-emacs@gnu.org; Fri, 01 Apr 2016 18:53:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1am7w6-0004Kg-4v for bug-gnu-emacs@gnu.org; Fri, 01 Apr 2016 18:53:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1am7w6-0004Kb-1J for bug-gnu-emacs@gnu.org; Fri, 01 Apr 2016 18:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1am7w5-0006eG-QG for bug-gnu-emacs@gnu.org; Fri, 01 Apr 2016 18:53:01 -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: Fri, 01 Apr 2016 22:53: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.145955113325497 (code B ref 20892); Fri, 01 Apr 2016 22:53:01 +0000 Original-Received: (at 20892) by debbugs.gnu.org; 1 Apr 2016 22:52:13 +0000 Original-Received: from localhost ([127.0.0.1]:47660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1am7vJ-0006d8-1i for submit@debbugs.gnu.org; Fri, 01 Apr 2016 18:52:13 -0400 Original-Received: from mail-ig0-f180.google.com ([209.85.213.180]:35632) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1am7vI-0006cs-Ag for 20892@debbugs.gnu.org; Fri, 01 Apr 2016 18:52:12 -0400 Original-Received: by mail-ig0-f180.google.com with SMTP id cl4so5328326igb.0 for <20892@debbugs.gnu.org>; Fri, 01 Apr 2016 15:52:12 -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-transfer-encoding; bh=xHF8TcGViNl+Cs9nUnNvDiZOpSpm7t165HP0WlnP+80=; b=t+IAL6gfuRLyNqipjF/cIVqvUBOLMrlYyo+4lC7q4JvkHuJ7IIT+a0Czlz34y+m3KH mD7So0MrCUY+o562Yu3BFnalZSleNNYwb4ofmNuHQAcuwhoqt3ofR09T8/IA6C89uZzH wB2P+9iOTKZie7ogdm1l2FRixDgb/UqJ+hIv13k7X4LTZc/fYcbM+jdjDxoQLeefrCh2 8aRE39x5N+ASt2I6fKTNe7+gseU15xnx/ZJdjfAfCgDAgQjchZ1zD8LwzzapeVK0l+yv nFzjuHbqyWYGjWl6OyD6qTuS/R7QW++ttyE5zDmVw6Zh194BTgffHaN65rt/PhFF/k5j Tkeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=xHF8TcGViNl+Cs9nUnNvDiZOpSpm7t165HP0WlnP+80=; b=R3+EsZ7pYgyaYXQAtM6rkCsnoLuUEvVsw8nIvt9L33HbK0Ea6leDQyjTNG7FKobL8N JGmNZcdv7e9jx1RzE8hBIAbABiXTDKegrUmdFeJ7phZWthDYvFLlHD914XurzqywKnZ7 x8NZDs4Ag0kvGKKg45hm7yR1PYct8eAzHLg+MNypxOn1rfGXQFPneGOPVDCgJyf+qw49 c6Ws/MTGxeiExk3qFWVifQPKeSnsvDfhoEynwOwTiHM6SNYnHUu2SIRtxgwMe6kPdxQZ YhvKr0zQYlTCt/o7RgTpx/O7VbbCMCz1S4FvUx3G+0B4OxCIQ0YdzQ8UZwSFdfzYRbcg A1EQ== X-Gm-Message-State: AD7BkJJdavnHNdFXQ8LeI+RymQ4BVf6O1XD/oeU2R9OkBskvCLXZkPvdtCkesoVHYkFIBK7AVw2lj1mTMI7j4g== X-Received: by 10.50.61.209 with SMTP id s17mr1233338igr.7.1459551126454; Fri, 01 Apr 2016 15:52:06 -0700 (PDT) Original-Received: by 10.107.22.69 with HTTP; Fri, 1 Apr 2016 15:51:47 -0700 (PDT) In-Reply-To: <83wpohrrsm.fsf@gnu.org> 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:115853 Archived-At: On Apr 1, 2016 21:36, "Eli Zaretskii" wrote: > > > From: joaotavora@gmail.com (Jo=C3=A3o T=C3=A1vora) > > 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 think that fixing EOL decoding shouldn't touch the value of > coding-system-for-read, only its EOL decoding part, if at all. Although this bug was issued for the eolness. I've additionally noticed I get misdecoded diacritics in the vc-diff buffer. This is why I think coding-system-for-read The test case is easy I think. Version a file with git, using crlf and lati= n-1. $ mkdir something && cd something $ git init $ echo Jo=C3=A3o T=C3=A1vora > bla.txt $ emacs --batch -q bla.txt --eval "(setq buffer-file-coding-system 'iso-latin-1-dos)" --eval "(write-file \"bla.txt\")" $ git add bla.txt && git commit -m "test" $ emacs --batch -q bla.txt --eval "(insert \"blibli\\n\")" --eval "(write-file \"bla.txt\")" 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. Thanks, Jo=C3=A3o