# HG changeset patch # User Kim F. Storm # Date 1079728359 0 # Node ID f4debae4b1d1bbd2b04435d4b8a09f26d481c89a # Parent 5755a6bed7a0d848650080ee9ca94644b787c1c3 (move_it_in_display_line_to): Fix MOVE_TO_POS case when to_charpos corresponds to newline in right fringe. Use local BUFFER_POS_REACHED_P macro. diff -r 5755a6bed7a0 -r f4debae4b1d1 src/xdisp.c --- a/src/xdisp.c Fri Mar 19 13:57:08 2004 +0000 +++ b/src/xdisp.c Fri Mar 19 20:32:39 2004 +0000 @@ -5594,15 +5594,18 @@ saved_glyph_row = it->glyph_row; it->glyph_row = NULL; +#define BUFFER_POS_REACHED_P() \ + ((op & MOVE_TO_POS) != 0 \ + && BUFFERP (it->object) \ + && IT_CHARPOS (*it) >= to_charpos) + while (1) { int x, i, ascent = 0, descent = 0; /* Stop when ZV or TO_CHARPOS reached. */ if (!get_next_display_element (it) - || ((op & MOVE_TO_POS) != 0 - && BUFFERP (it->object) - && IT_CHARPOS (*it) >= to_charpos)) + || BUFFER_POS_REACHED_P ()) { result = MOVE_POS_MATCH_OR_ZV; break; @@ -5689,7 +5692,8 @@ #ifdef HAVE_WINDOW_SYSTEM if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) { - if (!get_next_display_element (it)) + if (!get_next_display_element (it) + || BUFFER_POS_REACHED_P ()) { result = MOVE_POS_MATCH_OR_ZV; break; @@ -5761,7 +5765,8 @@ #ifdef HAVE_WINDOW_SYSTEM if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) { - if (!get_next_display_element (it)) + if (!get_next_display_element (it) + || BUFFER_POS_REACHED_P ()) { result = MOVE_POS_MATCH_OR_ZV; break; @@ -5778,6 +5783,8 @@ } } +#undef BUFFER_POS_REACHED_P + /* Restore the iterator settings altered at the beginning of this function. */ it->glyph_row = saved_glyph_row;