all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 42552@debbugs.gnu.org
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	[thread overview]
Message-ID: <831rknbwb9.fsf@gnu.org> (raw)
In-Reply-To: <cc3b0688-410c-7eb2-209b-4c3f9dce7281@yandex.ru> (message from Dmitry Gutov on Mon, 3 Aug 2020 02:37:37 +0300)

> Cc: 42552@debbugs.gnu.org
> From: Dmitry Gutov <dgutov@yandex.ru>
> 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.





  reply	other threads:[~2020-08-03 15:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-26 18:23 bug#42552: 28.0.50; Overlay 'face' property doesn't set the "underlying face" for 'after-string' Dmitry Gutov
2020-07-26 19:02 ` Eli Zaretskii
2020-07-26 20:00   ` Dmitry Gutov
2020-07-30 14:04     ` Eli Zaretskii
2020-08-02 23:37       ` Dmitry Gutov
2020-08-03 15:09         ` Eli Zaretskii [this message]
2020-08-04 23:55           ` Dmitry Gutov
2020-08-05 14:58             ` Eli Zaretskii
2020-08-06 23:16               ` Dmitry Gutov
2020-08-07  5:42                 ` Eli Zaretskii
2020-08-10 22:27                   ` Dmitry Gutov
2020-08-11 15:10                     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=831rknbwb9.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=42552@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.