From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#33567: Syntactic fontification of diff hunks Date: Tue, 04 Dec 2018 09:01:24 +0200 Message-ID: <83a7llai7v.fsf@gnu.org> References: <878t18j4is.fsf@mail.linkov.net> <83a7lobemr.fsf@gnu.org> <87a7lnv6ex.fsf@mail.linkov.net> <83pnuj9kb8.fsf@gnu.org> <87bm62npwr.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1543907422 342 195.159.176.226 (4 Dec 2018 07:10:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 4 Dec 2018 07:10:22 +0000 (UTC) Cc: 33567@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 04 08:10:18 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gU4qY-0008Px-18 for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Dec 2018 08:10:18 +0100 Original-Received: from localhost ([::1]:54259 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gU4se-0005z2-EE for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Dec 2018 02:12:28 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gU4sV-0005wz-TT for bug-gnu-emacs@gnu.org; Tue, 04 Dec 2018 02:12:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gU4ia-0000Eq-38 for bug-gnu-emacs@gnu.org; Tue, 04 Dec 2018 02:02:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55474) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gU4iY-0000Dh-Fy for bug-gnu-emacs@gnu.org; Tue, 04 Dec 2018 02:02:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gU4iY-0001Tu-BU for bug-gnu-emacs@gnu.org; Tue, 04 Dec 2018 02:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Dec 2018 07:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33567 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 33567-submit@debbugs.gnu.org id=B33567.15439069035669 (code B ref 33567); Tue, 04 Dec 2018 07:02:02 +0000 Original-Received: (at 33567) by debbugs.gnu.org; 4 Dec 2018 07:01:43 +0000 Original-Received: from localhost ([127.0.0.1]:59732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gU4iF-0001TM-4I for submit@debbugs.gnu.org; Tue, 04 Dec 2018 02:01:43 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gU4iD-0001TA-6y for 33567@debbugs.gnu.org; Tue, 04 Dec 2018 02:01:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gU4i4-000823-Kv for 33567@debbugs.gnu.org; Tue, 04 Dec 2018 02:01:35 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gU4i4-00081R-Dj; Tue, 04 Dec 2018 02:01:32 -0500 Original-Received: from [176.228.60.248] (port=2105 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gU4i3-0007gM-Sn; Tue, 04 Dec 2018 02:01:32 -0500 In-reply-to: <87bm62npwr.fsf@mail.linkov.net> (message from Juri Linkov on Tue, 04 Dec 2018 01:36:52 +0200) 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" Xref: news.gmane.org gmane.emacs.bugs:153055 Archived-At: > From: Juri Linkov > Cc: 33567@debbugs.gnu.org > Date: Tue, 04 Dec 2018 01:36:52 +0200 > > > vc-find-revision disables encoding/decoding because it wants to > > create an identical copy of the checked-out file, and doesn't want to > > be tripped by encoding/decoding issues. But in your case you don't > > write the buffer to a file, so why do you need to bind > > coding-system-for-read at all? I say leave it unbound, and let Emacs > > do its job decoding the text as usual. Does that not work? > > I tried to remove coding-system-for-read binding from > vc-find-revision-no-save, but it still fails to get the buffer > in the right encoding. What is "the right encoding", and what did Emacs think the encoding was, when you didn't bind coding-system-for-read? These details are necessary to understand what exactly happens there and how to solve it. > Then I discovered that vc-git-find-revision and also some other VC > backend API implementations of find-revision bind > coding-system-for-read too. It seems that removing > coding-system-for-read from vc-git-find-revision will cause a lot of > breakage. How do you know vc-git-find-revision doesn't have a subtle bug as well, e.g. when file names in the repository are encoded in some non-trivial, non-UTF-8 encoding? And anyway, we are not talking about changing vc-git-find-revision or affecting it, we are talking about your vc-find-revision-no-save, which does a different job. For the latter, I'd prefer not to decode by hand, as that might have subtle issues and will require much more testing in all kinds of environments and OSes. I prefer to rely on the usual decoding machinery, which we know works well.