Subject: bug#59141: 28.1.90; Face :extend when all the line but trailing \n is invisible

From: Eli Zaretskii <[email-masked]>
Date: Wed, 09 Nov 2022 14:29:10 +0200

> From: Ihor Radchenko <[email-masked]>
> Date: Wed, 09 Nov 2022 02:24:24 +0000
> 
> I do not see anything wrong on the Org side.

Nothing wrong, no.  But there's also nothing wrong with the Emacs
behavior in this case: the last glyph on the "One" line has buffer
position inside the region that has the org-block-end-line face.

> Maybe Emacs should not apply :extent t attribute to the newline when the
> text in fontified line is hidden?

That'd be quite a complication.  The code which implements the :extend
attribute runs long after the invisible text was processed and
skipped, leaving no glyphs on display.  That code only knows what is
the face at the buffer position that is the last on the screen line.
So we'd need to go back and analyze the text which precedes the
newline, and see whether any characters there are nowhere on display,
which could be quite tricky, given the bidi reordering.

Also, your proposal would disallow having the :extend face on the
newline alone, I think.

So I'd rather we didn't.

I said many times that people shouldn't willy-nilly use the :extent
attribute, just because it looks cooler in some situation.  The intent
was and still is for faces not to have this attribute set, with very
few very special exceptions, like the 'region' face.  But people don't
listen...