[Top][All Lists]

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

Re: Display problems with 'before-string in overlay

From: Lennart Borgman (gmail)
Subject: Re: Display problems with 'before-string in overlay
Date: Wed, 11 Apr 2007 22:48:34 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20070221 Thunderbird/ Mnenhy/

Eli Zaretskii wrote:
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 ()
  (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 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.

FWIW, I wouldn't touch this so close to the release: if no one noticed
this since July 2005, it's hardly a grave bug.

How do you know? This just looks so strange so it could well be a grave bug.

reply via email to

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