bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#65896: 30.0.50; folding text with text properties prevents backgroun


From: Eli Zaretskii
Subject: bug#65896: 30.0.50; folding text with text properties prevents background from extending past the newline
Date: Thu, 21 Sep 2023 14:07:39 +0300

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: LemonBreezes <look@strawberrytea.xyz>, 65896@debbugs.gnu.org,
>  kevin.legouguec@gmail.com
> Date: Wed, 20 Sep 2023 12:50:08 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> This might not sound too clever, but why don't we just make the extend
> >> property be determined by the first character in the line rather than
> >> the last character / newline character? 
> >
> > How can Emacs know, when it processes the first character on a line,
> > whether the last character on that line will have the same face?
> >
> > You seem to assume that the Emacs display engine has "global" view of
> > the line it is processing for display.  But that's not what happens:
> > the Emacs display is basically a one-pass layout engine whose view of
> > the text is a peephole whose size is a single character.  The display
> > engine processes a character, makes all the decisions regarding its
> > display and layout, then proceeds to the next one, and so on.  When it
> > gets to the newline that ends a line, it makes the decision whether
> > the last face it saw needs to be extended, and if so, extends it.
> 
> Are you sure? I am looking at `extend_face_to_end_of_line' and it looks
> like there is nothing preventing it from accessing it->glyph_row->glyphs
> array to look backwards into preceding glyphs.

First, glyphs have only partial information about the original face
properties.  IOW, the produced glyph row doesn't have all the info
that the original text had.

And second, I don't see how the accessibility to the glyphs is
relevant to the issue at hand.  Suppose the visible text of a line is:

   aaabbbbxxx

where each letter represents some character with different face -- you
want Emacs to extend face 'a' after the end of the line, not the face
'x', just because the line started with characters whose face was
'a'?? that's what the OP said, AFAIU.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]