From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#33567: Syntactic fontification of diff hunks Date: Tue, 11 Dec 2018 02:38:18 +0200 Organization: LINKOV.NET Message-ID: <87a7lcj2f8.fsf@mail.linkov.net> References: <878t18j4is.fsf@mail.linkov.net> <83a7lobemr.fsf@gnu.org> <87a7lnv6ex.fsf@mail.linkov.net> <83pnuj9kb8.fsf@gnu.org> <87bm62npwr.fsf@mail.linkov.net> <83a7llai7v.fsf@gnu.org> <87va4826tz.fsf@mail.linkov.net> <83sgzc8mp0.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1544490496 31065 195.159.176.226 (11 Dec 2018 01:08:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 11 Dec 2018 01:08:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 33567@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 11 02:08:12 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 1gWWWu-0007uE-GM for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Dec 2018 02:08:10 +0100 Original-Received: from localhost ([::1]:35369 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gWWZ0-00045N-UY for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Dec 2018 20:10:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gWWYo-00042U-Rs for bug-gnu-emacs@gnu.org; Mon, 10 Dec 2018 20:10:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gWWYk-0006Db-Sl for bug-gnu-emacs@gnu.org; Mon, 10 Dec 2018 20:10:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38101) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gWWYk-0006DV-OW for bug-gnu-emacs@gnu.org; Mon, 10 Dec 2018 20:10:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gWWYk-0001BS-Hy for bug-gnu-emacs@gnu.org; Mon, 10 Dec 2018 20:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Dec 2018 01:10: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.15444905914521 (code B ref 33567); Tue, 11 Dec 2018 01:10:02 +0000 Original-Received: (at 33567) by debbugs.gnu.org; 11 Dec 2018 01:09:51 +0000 Original-Received: from localhost ([127.0.0.1]:42358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gWWYX-0001Am-Eg for submit@debbugs.gnu.org; Mon, 10 Dec 2018 20:09:50 -0500 Original-Received: from indri.birch.relay.mailchannels.net ([23.83.209.92]:58175) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gWWYV-0001Ad-An for 33567@debbugs.gnu.org; Mon, 10 Dec 2018 20:09:47 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 28A425C3183; Tue, 11 Dec 2018 01:09:46 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a60.g.dreamhost.com (unknown [100.96.35.77]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id CD7535C2D99; Tue, 11 Dec 2018 01:09:45 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a60.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Tue, 11 Dec 2018 01:09:46 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Cooperative-Abaft: 592a51bb099d09ec_1544490585954_2915713004 X-MC-Loop-Signature: 1544490585954:2072673052 X-MC-Ingress-Time: 1544490585953 Original-Received: from pdx1-sub0-mail-a60.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a60.g.dreamhost.com (Postfix) with ESMTP id 795758053D; Mon, 10 Dec 2018 17:09:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=LMHJGYGsUbMgmOpoIVLrK764ftY=; b= 3cPXpcT94kDhBheNOHRTuEloletjF8YskEuidDpCMgVsBuL36LFvIg8eHRM6qUHp 2aoQu8TzsLA0qguF3cOHiGbi/qmcaWwaJyZhBfiBBOn+k7HOr8mKapdlgrxr6zZG P7aRFPPkOJZaVjNTrx/1kdhW2nh/IdbwVdZno+Ezc4U= Original-Received: from mail.jurta.org (m91-129-96-177.cust.tele2.ee [91.129.96.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a60.g.dreamhost.com (Postfix) with ESMTPSA id 43393805F8; Mon, 10 Dec 2018 17:09:43 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a60 In-Reply-To: <83sgzc8mp0.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 05 Dec 2018 09:19:55 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudegiedgfeduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdeliedrudejjeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdeliedrudejjedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegvlhhiiiesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt 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:153327 Archived-At: > If you still want to reuse the literal contents of the file, as > inserted by vc-git-find-revision etc., then you will have to duplicate > what insert-file-contents does internally. I suggest to look at how > this is done in archive-set-buffer-as-visiting-file. I looked at archive-set-buffer-as-visiting-file, and it seems it could be simplified based on the assumption that the backend inserts output in the binary coding. I tried and this fixes the problem: diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 5ff9f4d5be..c980369fa9 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2042,6 +2042,7 @@ vc-find-revision-no-save (if backend (vc-call-backend backend 'find-revision file revision outbuf) (vc-call find-revision file revision outbuf)))) + (recode-region (point-min) (point-max) buffer-file-coding-system 'binary) (goto-char (point-min)) (if buffer (let ((buffer-file-name file)) (normal-mode)) (normal-mode)) (set-buffer-modified-p nil)