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, 27 Dec 2018 02:18:14 +0200 Organization: LINKOV.NET Message-ID: <878t0bhlfd.fsf@mail.linkov.net> References: <878t18j4is.fsf@mail.linkov.net> <87va475y1m.fsf@mail.linkov.net> <87mupafi73.fsf@mail.linkov.net> <834lbgh3n7.fsf@gnu.org> <87h8fduis0.fsf@mail.linkov.net> <83d0q0dtc0.fsf@gnu.org> <877eg7sq8a.fsf@mail.linkov.net> <47546098-59ef-ae43-878a-fd225b60ec99@yandex.ru> <874lba1n0n.fsf@mail.linkov.net> <87d0pyxtnc.fsf@mail.linkov.net> <532bc1dc-1b44-dc3a-23f0-f96e6d586123@yandex.ru> <09b2c002-1519-61dd-6e8b-2e87794077e2@yandex.ru> <87zht1jjdf.fsf@mail.linkov.net> <75267609-e167-c26e-82e8-d6c2609dbf30@yandex.ru> <8736qrkgel.fsf@mail.linkov.net> <87bm59tkuk.fsf@mail.linkov.net> <32b6a823-e855-7a47-86f4-d2d33fdb2c2b@yandex.ru> <874lazq5e7.fsf@mail.linkov.net> <87ab3c98-a6d0-f66d-9e20-bb002c1de2a4@yandex.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1545870014 8552 195.159.176.226 (27 Dec 2018 00:20:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 27 Dec 2018 00:20:14 +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: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 27 01:20:10 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 1gcJPD-00021A-MW for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Dec 2018 01:20:07 +0100 Original-Received: from localhost ([127.0.0.1]:48829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcJRJ-0002xT-L1 for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Dec 2018 19:22:17 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcJRA-0002xA-0K for bug-gnu-emacs@gnu.org; Wed, 26 Dec 2018 19:22:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gcJR6-0005OF-2D for bug-gnu-emacs@gnu.org; Wed, 26 Dec 2018 19:22:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51109) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gcJR4-0005NH-Jr for bug-gnu-emacs@gnu.org; Wed, 26 Dec 2018 19:22:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gcJR3-0007Ih-N9 for bug-gnu-emacs@gnu.org; Wed, 26 Dec 2018 19:22: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: Thu, 27 Dec 2018 00:22:01 +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.154587009628024 (code B ref 33567); Thu, 27 Dec 2018 00:22:01 +0000 Original-Received: (at 33567) by debbugs.gnu.org; 27 Dec 2018 00:21:36 +0000 Original-Received: from localhost ([127.0.0.1]:38067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcJQa-0007Hp-Ps for submit@debbugs.gnu.org; Wed, 26 Dec 2018 19:21:36 -0500 Original-Received: from golden.birch.relay.mailchannels.net ([23.83.209.73]:61039) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcJQV-0007He-Uu for 33567@debbugs.gnu.org; Wed, 26 Dec 2018 19:21:32 -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 8F1412836A7; Thu, 27 Dec 2018 00:21:26 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a49.g.dreamhost.com (unknown [100.96.19.78]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 44BFE28371C; Thu, 27 Dec 2018 00:21:26 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a49.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, 27 Dec 2018 00:21:26 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Grain-Harbor: 5ab38498456f3688_1545870086428_3178564996 X-MC-Loop-Signature: 1545870086428:1170965014 X-MC-Ingress-Time: 1545870086428 Original-Received: from pdx1-sub0-mail-a49.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a49.g.dreamhost.com (Postfix) with ESMTP id 095837FC83; Wed, 26 Dec 2018 16:21:26 -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=3E10w9mqh6jgVCMYOxVgty1X0RM=; b= OfC2qgG0jJnifzp+v/H7fIorZWH4vsIVaw05bKEPhZ9CQxQWeoNBdsvNgPdnKbr7 nSxCB5bcetp2bA/A3imoqfqYXARBypm6Dc+0FR5Q7401APDkHgyT/LNlvvCYhbNA FQ0cjdONJ4IiZibN5udGXTfBtLP0E7ADPlPqGme9vr0= Original-Received: from mail.jurta.org (m91-129-108-193.cust.tele2.ee [91.129.108.193]) (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-a49.g.dreamhost.com (Postfix) with ESMTPSA id 14EDB7FC80; Wed, 26 Dec 2018 16:21:24 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a49 In-Reply-To: <87ab3c98-a6d0-f66d-9e20-bb002c1de2a4@yandex.ru> (Dmitry Gutov's message of "Thu, 27 Dec 2018 01:16:09 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrtddugddvudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehmtderredtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtkedrudelfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdekrdduleefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepughguhhtohhvseihrghnuggvgidrrhhunecuvehluhhsthgvrhfuihiivgeptd 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:153885 Archived-At: --=-=-= Content-Type: text/plain >> There are some underlines on this screenshot, maybe use underlines for >> refined diffs on tty? > > You mean colored underlines for every line? Umm, not sure I'd like that. Actually I meant underlines instead of inverse-video. Underlined refinement looks much better than in inverse-video. Also I propose to not use this feature on tty because there is no good solution how to combine diff foreground colors with syntax foreground colors: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=diff-mode.tty.patch diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index a4c0618c67..7ab64fa4aa 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -104,7 +104,7 @@ diff-font-lock-prettify :version "27.1" :type 'boolean) -(defcustom diff-font-lock-syntax t +(defcustom diff-font-lock-syntax (>= (display-color-cells) 88) "If non-nil, diff hunk font-lock includes source language syntax highlighting. This highlighting is the same as added by `font-lock-mode' when corresponding source files are visited normally. @@ -2019,7 +2019,7 @@ diff-refine-changed :background "#ffff55") (((class color) (min-colors 88) (background dark)) :background "#aaaa22") - (t :inverse-video t)) + (t :underline t)) "Face used for char-based changes shown by `diff-refine-hunk'.") (defface diff-refine-removed --=-=-=--