+2014-05-21 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (move_it_in_display_line_to): Avoid infinite recursion:
+ when closest_pos is identical to to_charpos, don't recurse, since
+ we already tried that, and failed. (Bug#17539)
+
2014-05-20 Eli Zaretskii <eliz@gnu.org>
* w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: If we are
if (closest_pos < ZV)
{
RESTORE_IT (it, &ppos_it, ppos_data);
- move_it_in_display_line_to (it, closest_pos, -1,
- MOVE_TO_POS);
+ /* Don't recurse if closest_pos is equal to
+ to_charpos, since we have just tried that. */
+ if (closest_pos != to_charpos)
+ move_it_in_display_line_to (it, closest_pos, -1,
+ MOVE_TO_POS);
result = MOVE_POS_MATCH_OR_ZV;
}
else
&& !at_eob_p && closest_pos < ZV)
{
RESTORE_IT (it, &ppos_it, ppos_data);
- move_it_in_display_line_to (it, closest_pos, -1,
- MOVE_TO_POS);
+ if (closest_pos != to_charpos)
+ move_it_in_display_line_to (it, closest_pos, -1,
+ MOVE_TO_POS);
}
result = MOVE_POS_MATCH_OR_ZV;
break;
if (closest_pos < ZV)
{
RESTORE_IT (it, &ppos_it, ppos_data);
- move_it_in_display_line_to (it, closest_pos, -1, MOVE_TO_POS);
+ if (closest_pos != to_charpos)
+ move_it_in_display_line_to (it, closest_pos, -1,
+ MOVE_TO_POS);
}
result = MOVE_POS_MATCH_OR_ZV;
break;