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: Thu, 06 Dec 2018 01:35:17 +0200 Organization: LINKOV.NET Message-ID: <87va475y1m.fsf@mail.linkov.net> References: <878t18j4is.fsf@mail.linkov.net> <83a7lobemr.fsf@gnu.org> <87a7lnv6ex.fsf@mail.linkov.net> <83pnuj9kb8.fsf@gnu.org> <875zwajh6c.fsf@mail.linkov.net> <837egpagko.fsf@gnu.org> <87k1koygvm.fsf@mail.linkov.net> <83r2ew8mfx.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1544057773 5411 195.159.176.226 (6 Dec 2018 00:56:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 6 Dec 2018 00:56:13 +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 Thu Dec 06 01:56:09 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 1gUhxY-0001II-WE for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Dec 2018 01:56:09 +0100 Original-Received: from localhost ([::1]:38300 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUhzf-0004yO-MK for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Dec 2018 19:58:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUhzT-0004e1-2t for bug-gnu-emacs@gnu.org; Wed, 05 Dec 2018 19:58:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUhzP-0005bA-90 for bug-gnu-emacs@gnu.org; Wed, 05 Dec 2018 19:58:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58797) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gUhzP-0005av-2Z for bug-gnu-emacs@gnu.org; Wed, 05 Dec 2018 19:58:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gUhzP-0004ZE-0i for bug-gnu-emacs@gnu.org; Wed, 05 Dec 2018 19:58:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Dec 2018 00:58: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.154405782617469 (code B ref 33567); Thu, 06 Dec 2018 00:58:02 +0000 Original-Received: (at 33567) by debbugs.gnu.org; 6 Dec 2018 00:57:06 +0000 Original-Received: from localhost ([127.0.0.1]:34815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gUhyQ-0004Wy-9h for submit@debbugs.gnu.org; Wed, 05 Dec 2018 19:57:06 -0500 Original-Received: from bonobo.maple.relay.mailchannels.net ([23.83.214.22]:51427) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gUhyK-0004WY-GK for 33567@debbugs.gnu.org; Wed, 05 Dec 2018 19:57:00 -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 42B3A5C446B; Thu, 6 Dec 2018 00:56:55 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a54.g.dreamhost.com (unknown [100.96.35.77]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id EB4A95C3BA9; Thu, 6 Dec 2018 00:56:54 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a54.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); Thu, 06 Dec 2018 00:56:55 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Abortive-Language: 3605440c6e792371_1544057815091_2675886739 X-MC-Loop-Signature: 1544057815091:3240990396 X-MC-Ingress-Time: 1544057815090 Original-Received: from pdx1-sub0-mail-a54.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a54.g.dreamhost.com (Postfix) with ESMTP id 9543E80087; Wed, 5 Dec 2018 16:56:54 -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=gDPfHkuTjSdDzUxkq+cEaNmhegg=; b= Q2WMIFpYqT6LS+BlyuoIfbSBgUg44DQa+Ofsc+bHKIEgk2Hx2kzUE/RmuDj/MmYH NYxapxZ1QTfFPGo1ikWVxVg2LPpzu/XmleNm+lUcsfxCUEuKNEH0jfL8uARagqGh XvnGAmPsBZ4yRuipsc3HsAdGqCUTQIkITUId7Te6W+g= Original-Received: from mail.jurta.org (m91-129-103-7.cust.tele2.ee [91.129.103.7]) (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-a54.g.dreamhost.com (Postfix) with ESMTPSA id A61BB8007F; Wed, 5 Dec 2018 16:56:52 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a54 In-Reply-To: <83r2ew8mfx.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 05 Dec 2018 09:25:22 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudefiedgvdekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdefrdejnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtfedrjedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegvlhhiiiesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedu 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:153133 Archived-At: >> When this special variable is set by a diff command, it's safe to assume >> that the files referenced from the diff buffer really exist, so it's >> safe to try reading them. I don't want a patch in a mail attachment >> to try reading files mentioned in the patch attachment. > > I think you lean heavily towards the use case where the diffs were > produced by some Emacs command. Whereas what I have in mind is the > use case where the diffs came from some other source, like manual > invocation of shell commands. I'm saying that in the absence of > diff-default-directory, using default-directory and 'cd' will be much > easier for users. Users still can use all diff-mode commands to visit source files from them. Only language syntax fontification in diffs will fall back to hunk-only when a diff buffer is not created by a diff command. This is to avoid all possible dangers of automatically visiting files in arbitrary diff buffers. > The use case I have in mind is that some time passes between the > generation of the diffs and the time the diffs are visited and > fontified. During that time, the working revision could have been > changed. Isn't that what this issue is about? If so, we should > explain why in that case, rare as it could be, the fontification might > be wrong. Fontification can't be wrong because code verifies if hunks from diff still exist in the updated file, and doesn't highlight changed hunks.