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: Mon, 03 Aug 2020 18:09:30 +0300 Message-ID: <831rknbwb9.fsf@gnu.org> References: <46466541-6185-2bf3-87cc-b28c71fe69e7@yandex.ru> <838sf6gkvq.fsf@gnu.org> <83wo2ldrqb.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5247"; 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 Mon Aug 03 17:11:10 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 1k2c7K-0001HE-Pm for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 Aug 2020 17:11:10 +0200 Original-Received: from localhost ([::1]:54002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k2c7J-0008T8-R8 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 Aug 2020 11:11:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k2c7D-0008Sh-0L for bug-gnu-emacs@gnu.org; Mon, 03 Aug 2020 11:11:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34322) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k2c7C-0002VL-N7 for bug-gnu-emacs@gnu.org; Mon, 03 Aug 2020 11:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k2c7C-000224-Hl for bug-gnu-emacs@gnu.org; Mon, 03 Aug 2020 11:11: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: Mon, 03 Aug 2020 15:11: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.15964674077743 (code B ref 42552); Mon, 03 Aug 2020 15:11:02 +0000 Original-Received: (at 42552) by debbugs.gnu.org; 3 Aug 2020 15:10:07 +0000 Original-Received: from localhost ([127.0.0.1]:45868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k2c6H-00020j-Vi for submit@debbugs.gnu.org; Mon, 03 Aug 2020 11:10:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39354) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k2c62-0001zt-EE for 42552@debbugs.gnu.org; Mon, 03 Aug 2020 11:10:05 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43567) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k2c5w-00027I-Rb; Mon, 03 Aug 2020 11:09:44 -0400 Original-Received: from [176.228.60.248] (port=1387 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1k2c5w-0006gv-9f; Mon, 03 Aug 2020 11:09:44 -0400 In-Reply-To: (message from Dmitry Gutov on Mon, 3 Aug 2020 02:37:37 +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:183946 Archived-At: > Cc: 42552@debbugs.gnu.org > From: Dmitry Gutov > Date: Mon, 3 Aug 2020 02:37:37 +0300 > > But the installed fix doesn't solve the other scenario, depicted on the > second screenshot attached to this report: > https://debbugs.gnu.org/cgi/bugreport.cgi?msg=5;att=3;filename=Screenshot+from+2020-07-26+20-59-25.png;bug=42552 > > Do you need a step-by-step repro for that? > > The reason for that difference seems to be that it's a log-edit buffer, > and the delimiter line is fontified using an anonymous face '(:height > 0.1 :inverse-video t :extend t), see the end of log-edit-font-lock-keywords. When the underlying face has the :extend attribute set, we must obey it. So what you see in that case is the expected behavior. > Still, Emacs 26.3 doesn't exhibit this problem, and in that version the > contents of that anonymous face was the same (except without :extend t, > but back then, all faces did "extend"). (*) 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. > Would it be too hard to have the same behavior in 28+? You can have this in Emacs > 26 if you make the face of the last character have the :extend attribute set, so that its background color overrides that of the one of the underlying buffer text. E.g., you could define a face that inherits from 'default', and if that doesn't specify the background color, use the frame's background as fallback to set that face's background. I don't see how else to get the behavior you want when using overlay strings. The only alternative is to move the position where you place the overlay outside the problematic face, but that is probably undesirable for other reasons. > 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? > > Like face_at_buffer_position except for OVERLAY. Currently it > > simply disregards the `face' properties of all overlays. */ > > > > int > > face_for_overlay_string (struct window *w, ptrdiff_t pos, > > But it works! That's how we closed bug#38563, didn't we? It works with display strings, yes. You now want to switch to overlay strings, and the rules of collecting faces are subtly different there.