# HG changeset patch # User YAMAMOTO Mitsuharu # Date 1192525165 0 # Node ID f79e08d5ee4e932eb48bc01b4dd9d1bffbadc4b1 # Parent 679f39df83057808f05b67d17a025add1d5cc514 (handle_display_prop): Ignore display specs after replacing one when string text is being replaced. (handle_single_display_spec): Pretend as if characters with display property haven't been consumed only when buffer text is being replaced. diff -r 679f39df8305 -r f79e08d5ee4e src/xdisp.c --- a/src/xdisp.c Tue Oct 16 02:34:58 2007 +0000 +++ b/src/xdisp.c Tue Oct 16 08:59:25 2007 +0000 @@ -3839,7 +3839,13 @@ { if (handle_single_display_spec (it, XCAR (prop), object, position, display_replaced_p)) - display_replaced_p = 1; + { + display_replaced_p = 1; + /* If some text in a string is replaced, `position' no + longer points to the position of `object'. */ + if (STRINGP (object)) + break; + } } } else if (VECTORP (prop)) @@ -3848,7 +3854,13 @@ for (i = 0; i < ASIZE (prop); ++i) if (handle_single_display_spec (it, AREF (prop, i), object, position, display_replaced_p)) - display_replaced_p = 1; + { + display_replaced_p = 1; + /* If some text in a string is replaced, `position' no + longer points to the position of `object'. */ + if (STRINGP (object)) + break; + } } else { @@ -4237,13 +4249,16 @@ /* Say that we haven't consumed the characters with `display' property yet. The call to pop_it in set_iterator_to_next will clean this up. */ - *position = start_pos; + if (BUFFERP (object)) + it->current.pos = start_pos; } else if (CONSP (value) && EQ (XCAR (value), Qspace)) { it->method = GET_FROM_STRETCH; it->object = value; - *position = it->position = start_pos; + it->position = start_pos; + if (BUFFERP (object)) + it->current.pos = start_pos; } #ifdef HAVE_WINDOW_SYSTEM else @@ -4257,7 +4272,8 @@ /* Say that we haven't consumed the characters with `display' property yet. The call to pop_it in set_iterator_to_next will clean this up. */ - *position = start_pos; + if (BUFFERP (object)) + it->current.pos = start_pos; } #endif /* HAVE_WINDOW_SYSTEM */