Subject: bug#42552: 28.0.50; Overlay 'face' property doesn't set the "underlying face" for 'after-string'

From: Eli Zaretskii <[email-masked]>
Date: Tue, 11 Aug 2020 18:10:42 +0300

> Cc: [email-masked]
> From: Dmitry Gutov <[email-masked]>
> Date: Tue, 11 Aug 2020 01:27:59 +0300
> 
> On 07.08.2020 08:42, Eli Zaretskii wrote:
> 
> >> 1. Eval:
> >>
> >> (with-silent-modifications
> >>     (insert (propertize "abc"
> >>                         'font-lock-face
> >>                         '((:background "green" :extend t)
> >>                           default
> >>                           ( :inverse-video t
> >>                             :foreground "yellow"
> >>                             :extend t)))))
> >>
> >> 2. C-j
> >>
> >> The "extended" newline is yellow.
> > 
> > That's expected due to face-merging, no?
> 
> I would have expected it to be green, at least. But if you say it's 
> working correctly, it probably is.

No, you are right: there's a subtlety here and another bug.

The subtlety is that having 'default' there is not a no-op: it resets
the :inverse-video attribute, and then "yellow" no longer affects the
background of the merged face.  So to have the same happen during face
extension past EOL, you need to have all the components say ":extend t",
like this:

 (with-silent-modifications
     (insert (propertize "abc"
                         'font-lock-face
                         '((:background "green" :extend t)
                           ( :inherit default :extend t)
                           ( :inverse-video t
                             :foreground "yellow"
                             :extend t)))))

And the bug is that the above doesn't work in Emacs 27; I've just
installed a fix on master.

Thanks.