From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#42552: 28.0.50; Overlay 'face' property doesn't set the "underlying face" for 'after-string' Date: Wed, 05 Aug 2020 17:58:53 +0300 Message-ID: <831rkl9m1e.fsf@gnu.org> References: <46466541-6185-2bf3-87cc-b28c71fe69e7@yandex.ru> <838sf6gkvq.fsf@gnu.org> <83wo2ldrqb.fsf@gnu.org> <831rknbwb9.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18188"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 42552@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 05 17:00:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3Kto-0004dN-OX for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Aug 2020 17:00:12 +0200 Original-Received: from localhost ([::1]:59278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3Ktn-00064V-30 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Aug 2020 11:00:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3Kte-00064L-Kz for bug-gnu-emacs@gnu.org; Wed, 05 Aug 2020 11:00:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40402) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k3Kte-0004Rl-AH for bug-gnu-emacs@gnu.org; Wed, 05 Aug 2020 11:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k3Kte-0006IX-81 for bug-gnu-emacs@gnu.org; Wed, 05 Aug 2020 11:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Aug 2020 15:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42552 X-GNU-PR-Package: emacs Original-Received: via spool by 42552-submit@debbugs.gnu.org id=B42552.159663955324131 (code B ref 42552); Wed, 05 Aug 2020 15:00:02 +0000 Original-Received: (at 42552) by debbugs.gnu.org; 5 Aug 2020 14:59:13 +0000 Original-Received: from localhost ([127.0.0.1]:51948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k3Ksr-0006H9-BK for submit@debbugs.gnu.org; Wed, 05 Aug 2020 10:59:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k3Kso-0006Gr-SR for 42552@debbugs.gnu.org; Wed, 05 Aug 2020 10:59:11 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58122) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3Ksj-0004MA-9m; Wed, 05 Aug 2020 10:59:05 -0400 Original-Received: from [176.228.60.248] (port=2248 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1k3Ksg-00007Z-TX; Wed, 05 Aug 2020 10:59:04 -0400 In-Reply-To: (message from Dmitry Gutov on Wed, 5 Aug 2020 02:55:59 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:184107 Archived-At: > Cc: 42552@debbugs.gnu.org > From: Dmitry Gutov > Date: Wed, 5 Aug 2020 02:55:59 +0300 > > > When the underlying face has the :extend attribute set, we must obey > > it. So what you see in that case is the expected behavior. > > Should the "overlay string" obey the underlying face, though? It doesn't > obey the 'face' property, like you explained. Seems inconsistent. Emacs always worked this way, so changing it now is probably a big deal. AFAIU, the reason for this behavior is so that overlay strings which specify no faces use the same face as the surrounding text. Which sounds reasonable. > > Emacs 26 and before simply extended the face of the last character of > > the line. Emacs 27 doesn't do that, it examines the faces in effect > > anew, filtering out those which don't have the :extend attribute set, > > so the result is different. This is exactly the change in behavior > > that was intended, not a bug. > > But it should obey :extend set to nil, shouldn't it? It does, but :extend nil doesn't override :extend t, it just says that the face with a nil :extend attribute should not be considered when computing the face for the empty space past EOL. > Even if I replace 'default' in there with a custom face that sets > ':extend' to nil, the result is the same. Right, as expected. The nil value of :extend doesn't override the non-nil value. > I suppose you mean the custom face must have :extend set to t, and have > a :background value computed right before it is used (otherwise the user > might customize the faces mid-session, leading to bad visuals). Yes, that's what I meant. > That seems to work. It also has the significant benefit on working in > Emacs 27, so if that's the approach you recommend in the end, the fix > you already pushed to master might be unnecessary. The fix I pushed might not be necessary for company's sake, but it is necessary for other use cases, because without it we don't behave as documented when :extend attribute is not present: we extend using the wrong background color. > >> Furthermore, in Emacs 26.3 I can propertize the newlines in the overlay > >> string with '(face region) and see the "extend" effect. Or keep them > >> with 'default' face and see no "extend" effect on those lines. > > > > You are saying that this doesn't work in Emacs >= 27? > > One works, the other doesn't. Well, that's because you expected :extend nil to do something that it isn't supposed to do. > > It works with display strings, yes. You now want to switch to overlay > > strings, and the rules of collecting faces are subtly different there. > > Hmm, so 'after-string' and 'before-string' are overlay strings, but > 'display' set on an overlay is not an overlay string. Okay then. Yes, the latter is alluded to as "display string", since the string comes from the 'display' property.