From: Chong Yidong <address@hidden>
Date: Wed, 11 Apr 2007 13:46:37 -0400
Cc: address@hidden
"Lennart Borgman (gmail)" <address@hidden> writes:
I want to put an overlay at the top of a buffer and display several
lines of text there. I use an overlay of length 1 at point 1 with a
before-string property to do this... the cursor is displayed at the
end of the first line of the 'before-string.
[Modified test function]:
(defun foo ()
(interactive)
(let ((o (make-overlay 1 1))
(s (propertize "A string\nwith several rows\nat top\n"
'face 'highlight)))
(overlay-put o 'before-string s)))
This buglet appears to be due to the following change:
2005-07-13 Kim F. Storm <address@hidden>
* xdisp.c (cursor_row_p): Row is ok if cursor is at newline
from string, but string starts on this line (so we always
position cursor at start of string).
The relevant code is at xdisp.c:15861:
if (PT == MATRIX_ROW_END_CHARPOS (row))
{
/* If the row ends with a newline from a string, we don't want
the cursor there, but we still want it at the start of the
string if the string starts in this row.
If the row is continued it doesn't end in a newline. */
if (CHARPOS (row->end.string_pos) >= 0)
cursor_row_p = (row->continued_p
|| PT >= MATRIX_ROW_START_CHARPOS (row));
Changing this last line to `cursor_row_p = row->continued_p;', as it
was before, eliminates the bug. I haven't thought about how to fix
this, though.