Subject: bug#11068: 24.0.94; Face-remapped background does not extend to end of window

From: martin rudalics <[email-masked]>
Date: Tue, 27 Mar 2012 11:23:28 +0200

> The point I'm stubbornly trying to make is that what matters for the
 > face extension is the last face loaded by the display iterator, _not_
 > the face of the newline or any other character.  The display iterator
 > changes faces at so-called "stop positions", where buffer contents of
 > text properties or overlays specify a different face.  Once a face is
 > resolved and loaded, it stays recorded in the iterator and affects
 > every glyph we deliver until another "stop position" is encountered.

Earlier you said

   "No, the return character has no face, and in fact it has no glyphs."

and I stubbornly believe that it has a face I can specify, that face has
an effect on what I see on the screen and apparently even produces a
stretch glyph I can see.  But obviously the display engine has its own
mechanism for translating face specifications and our different POVs get
lost in that translation.

 > Your code simply forces the display iterator to switch faces after the
 > last character of a line.  That's it.  The newline doesn't enter this
 > game at any point, because it is never drawn.  IOW, what's important
 > is the _position_ where the new face gets in effect, not what
 > character it is on.

Fully agreed.  But since I switch faces back immediately _after_ the
newline character it does not affect visible characters but only what
appears between them.

 > This _is_ described, but not in the section about overlays, because
 > `cursor' is a text property you should put on `display' property
 > strings or on overlay strings.  So this is described in "Special
 > Properties", and the description does mention overlay strings.

I read that already but apparently missed it on previous readings.

 > Maybe
 > an index entry should be added that starts with "overlay"; perhaps you
 > could suggest such an entry.

I'm afraid that wouldn't help much.  Maybe a separate special properties
table based on an alphabetic listing of property names, a reference to
where the property is described in detail, and whether it affects text,
overlays or both would help.

But some part of the text is IMO confusing: In

      "Normally, the cursor is displayed at the end of any overlay and
      text property strings present at the current buffer position."

I understand that an "overlay string" is a before- or after-string or a
display property string.  But what is a "text property string"?  A
display property of the text?  Also

      "it specifies the number of buffer's
      character positions associated with the overlay string"

clashes with my understanding that this number is already specified by
the start and end position of the overlay.  And

      "this way,
      Emacs will display the cursor on the character with that property
      regardless of whether the current buffer position is actually
      covered by the overlay."

doesn't make it clearer for me because what is "the character with that
property" and what is "the current buffer position" here?  I tried to
play around with it but don't see what this means for an overlay with a
display, before- or after-string property.  So the fact that overlays
with such a property are affected by the `cursor' property remains
obscure to me after reading this text.

martin