[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Display problems with `before-string' in overlay
From: |
Richard Stallman |
Subject: |
Display problems with `before-string' in overlay |
Date: |
Sun, 15 Apr 2007 09:59:22 -0400 |
Most of your proposed change in xdisp.c is the addition of the OVERLAY
argument to `string_buffer_position'. That is harmless.
It includes two substantial changes which could really alter Emacs's
behavior. I've included them below.
Could you explain them more clearly, in a way that demonstrates
they are correct?
***************
*** 11933,11952 ****
Lisp_Object string;
struct glyph *stop = glyph;
int pos;
limit = make_number (pt_old + 1);
glyph = string_start;
x = string_start_x;
string = glyph->object;
! pos = string_buffer_position (w, string, string_before_pos);
! /* If STRING is from overlay, LAST_POS == 0. We skip such glyphs
! because we always put cursor after overlay strings. */
! while (pos == 0 && glyph < stop)
{
string = glyph->object;
SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string));
if (glyph < stop)
! pos = string_buffer_position (w, glyph->object, string_before_pos);
}
while (glyph < stop)
--- 11934,11955 ----
Lisp_Object string;
struct glyph *stop = glyph;
int pos;
+ Lisp_Object overlay = Qnil;
limit = make_number (pt_old + 1);
glyph = string_start;
x = string_start_x;
string = glyph->object;
! pos = string_buffer_position (w, string, string_before_pos, &overlay);
! /* If STRING is from overlay, skip its glyphs because we always
! put cursor after overlay strings. */
! while ((pos == 0 || !NILP (overlay)) && glyph < stop)
{
string = glyph->object;
SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string));
if (glyph < stop)
! pos = string_buffer_position (w, glyph->object,
! string_before_pos, overlay);
}
while (glyph < stop)
***************
*** 15854,15865 ****
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));
else if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))
{
/* If the row ends in middle of a real character,
--- 15857,15866 ----
if (PT == MATRIX_ROW_END_CHARPOS (row))
{
/* If the row ends with a newline from a string, we don't want
! the cursor there.
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;
else if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))
{
/* If the row ends in middle of a real character,