Subject: bug#10395: 24.0.92; line-prefix text inherits face properties from the preceding line rather than following text

From: Eli Zaretskii <[email-masked]>
Date: Sat, 31 Dec 2011 16:09:41 +0200

> From: David Edmondson <[email-masked]>
> Date: Wed, 28 Dec 2011 12:47:18 +0000
> 
> If a line-prefix property is added to a region of a buffer, the
> displayed line-prefix region inherits the face properties from the
> preceding line rather than from the first character on the line, except
> if the region so propertised starts at the beginning of the
> buffer.

As I suspected, this happens simply because we don't change the face
used for display until we process the first character that has a
different face, in this case the first character on the line.

It is possible to change that, but we need to decide first whether the
current behavior is wrong or not.

IOW, why would the user expect that the line-prefix be rendered using
the face that begins _after_ the prefix?  This would be unlike
anything else in the Emacs display operation.  Is this case really
different?  What if the different face starts on some character that
is not the line's first character -- would you, David, expect the
line-prefix use that different face? if not, why do so when the
different face begins at the line's beginning?

Conceptually, a line-prefix and wrap-prefix are just display strings,
only specified differently.  They therefore behave just like display
strings, in that they inherit the face of the _preceding_ text.  If
you don't want that, you will have to specify face properties for the
line-prefix.  (This is, btw, the workaround for the problem you had.)

So my vote is to leave this as it works now, and maybe document this
to avoid surprises.

If the decision is nevertheless to change the behavior as David
expected, then we need to consider additional issues/complications:

 . what, if anything, should we do with wrap-prefix? should it also
   "inherit" the face of the first character of the continuation line?

 . would the result look as TRT when bidirectional text is involved?
   If the line with a prefix begins with right-to-left text, the first
   character of the line will not be the first (leftmost) character on
   display, while the leftmost character on display might then have a
   face that is different from that of line-prefix, which will look
   odd to say the least.

 . should this "inheritance" be limited to faces, or should other text
   properties behave like that as well? e.g., what about `mouse-face'
   or `pointer' properties?

Comments are welcome.