/* Indentation functions.
Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1998, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of GNU Emacs.
}
else
{
- int it_start, oselective, first_x, it_overshoot_expected;
+ int it_start, first_x, it_overshoot_expected;
SET_TEXT_POS (pt, PT, PT_BYTE);
start_display (&it, w, pt);
really at some x > 0. */
reseat_at_previous_visible_line_start (&it);
it.current_x = it.hpos = 0;
- /* Temporarily disable selective display so we don't move too far */
- oselective = it.selective;
- it.selective = 0;
- move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
- it.selective = oselective;
+ if (IT_CHARPOS (it) != PT)
+ /* We used to temporarily disable selective display here; the
+ comment said this is "so we don't move too far" (2005-01-19
+ checkin by kfs). But this does nothing useful that I can
+ tell, and it causes Bug#2694 . -- cyd */
+ move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
if (XINT (lines) <= 0)
{
}
else
{
- if (IT_CHARPOS (it) > PT)
+ if (IT_CHARPOS (it) > it_start)
{
/* IT may move too far if truncate-lines is on and PT
lies beyond the right margin. In that case,
which might span multiple screen lines (e.g., if it's
on a multi-line display string). We want to start
from the last line that it occupies. */
- if (PT < ZV)
+ if (it_start < ZV)
{
- while (IT_CHARPOS (it) <= PT)
+ while (IT_CHARPOS (it) <= it_start)
{
it.vpos = 0;
move_it_by_lines (&it, 1, 0);