From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#33567: Syntactic fontification of diff hunks Date: Thu, 20 Dec 2018 00:50:15 +0200 Message-ID: <75267609-e167-c26e-82e8-d6c2609dbf30@yandex.ru> 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> <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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1545259746 16093 195.159.176.226 (19 Dec 2018 22:49:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 19 Dec 2018 22:49:06 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Thunderbird/64.0 Cc: 33567@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 19 23:49:02 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 1gZkeD-00041z-I2 for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Dec 2018 23:49:01 +0100 Original-Received: from localhost ([::1]:34516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZkgK-0004oT-DU for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Dec 2018 17:51:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZkgD-0004oB-J4 for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2018 17:51:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZkgA-0008Df-CE for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2018 17:51:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51004) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZkgA-0008DZ-7K for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2018 17:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gZkgA-0006WW-1e for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2018 17:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Dec 2018 22:51: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.154525982725023 (code B ref 33567); Wed, 19 Dec 2018 22:51:01 +0000 Original-Received: (at 33567) by debbugs.gnu.org; 19 Dec 2018 22:50:27 +0000 Original-Received: from localhost ([127.0.0.1]:55262 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZkfb-0006VX-56 for submit@debbugs.gnu.org; Wed, 19 Dec 2018 17:50:27 -0500 Original-Received: from mail-wm1-f42.google.com ([209.85.128.42]:55603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZkfZ-0006VI-Ns for 33567@debbugs.gnu.org; Wed, 19 Dec 2018 17:50:26 -0500 Original-Received: by mail-wm1-f42.google.com with SMTP id y139so91345wmc.5 for <33567@debbugs.gnu.org>; Wed, 19 Dec 2018 14:50:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=AzR0pGluThGW4f68uqBHNpr7lqU+1j012+/qwjLYDvw=; b=fWPPOv3uppaz0ZGip1Lmcke72+vK82IiRcWWZtt9Jla8qNv5JTmp2RXMZ7Z6aGsQNz dJ8NSbUgqbfnSEmyK0KnZ3AbknklPd5O1wctpOdZ/5uSQW/KCctDZAg90Rl8zTjIC1ZF k1DCzit7G+oDRaUrH6UCN3nKfkIH/neNKfGMN19b7hzfJd3DY5M7E3Z3vNBQwLWeZ2n7 7pxY8T0OSbBLVfvJ6UJDuEdYx9a3o1Z7M6du3FBsDC9k++H+zyBe1+LN9XUkuEB0L4LO t51CKHH0h36z6fIkMkn1mvJ/HyieXye3KbVv+Tvm4RU8s8BEAAuyPx6qFE8UZLm4u1+C ktww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=AzR0pGluThGW4f68uqBHNpr7lqU+1j012+/qwjLYDvw=; b=mSp92Fy/LM5avEAzobUTxLUH8TYipmIzII/w4DYxLeggO2Mdcx/UEp/A+u0Nf5VBom faRu/N5bYDVOAZWMxv7Ox4dUemqXK4nGKCLIkE4Ed0td7D+SIC/EOQtngx2n4oOGbzFI hxnVajVpnv82/GjpnUqj8FV2PMCGkI3cU95PC/k9F9+9hJ0YhUhxM5nR3og4+uH99WVH m2EETuWG1exFRxBb0l/HICerG6Jr8i0Tt54P1wRYgJLjHr4PCUO7Ee70AlxdFNRr7S+/ mVqRbV9SgFBBVdhACDcsANoOB0xyGvjXOZSjEFxBNQTcla/2kz9BYbRtUEVhFfIuXDnn XS9Q== X-Gm-Message-State: AA+aEWZe9Xp96jd5HaqWQ/HRO8Sh1AluyIOb2XAanEM1G02pwX+j1ZU6 kwc5nGAugajXXZnlC2Pu+YS6GPJb X-Google-Smtp-Source: AFSGD/UdU7dPbdsO1dL/CWyg7JznmYH1wbtGVo7kU6El/dhDREHBEKL+XxiKSKJ4X9vUvKR3hpRICA== X-Received: by 2002:a1c:e58c:: with SMTP id c134mr8628287wmh.124.1545259819359; Wed, 19 Dec 2018 14:50:19 -0800 (PST) Original-Received: from [192.168.1.3] ([185.105.174.23]) by smtp.googlemail.com with ESMTPSA id l202sm12147036wma.33.2018.12.19.14.50.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 14:50:17 -0800 (PST) In-Reply-To: <87zht1jjdf.fsf@mail.linkov.net> Content-Language: en-US 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:153628 Archived-At: On 19.12.2018 23:49, Juri Linkov wrote: >> Anyway, to be clear, and other considerations aside, this works: >> [...] >> (defface diff-added >> @@ -315,9 +313,7 @@ diff-added >> (((class color) (min-colors 88) (background light)) >> :background "#ddffdd") >> (((class color) (min-colors 88) (background dark)) >> - :background "#335533") >> - (((class color)) >> - :foreground "green")) >> + :background "#335533")) >> "`diff-mode' face used to highlight added lines.") >> [...] >> (defface diff-indicator-added >> '((default :inherit diff-added) >> (((class color) (min-colors 88)) >> - :foreground "#22aa22")) >> + :foreground "#22aa22") >> + (((class color)) >> + :foreground "green")) >> "`diff-mode' face used to highlight indicator of added lines (+, >)." >> :version "22.1") >> (defvar diff-indicator-added-face 'diff-indicator-added) > > This looks good. Should I install it? Nobody has commented on my earlier stated concerns, but maybe we should just push it and see how it plays out. > For the same reason we have the face font-lock-comment-delimiter-face > separate from font-lock-comment-face to use colors only on the former, > but not on the latter on tty with 8 colors to make easier to read comments. Yeah, it's totally fine to use separate faces. And I was happy to see diff-indicator-* were already defined and in use. My concerns were different, though: 1. Is it okay to use the black foreground inside diff hunks even when diff-font-lock-syntax is nil? It's an incompatible change. 2. Even if we change the default in diff-added and diff-removed, some themes might have their foregrounds customized, so those users won't notice the change. It will trickle down to the themes eventually, I think, but it's unclear how the theme authors will choose to deal with this change while keeping compatibility with previous Emacs releases.