(redisplay_window): Even when falling back on "recentering",
position point in the window according to scroll-conservatively,
scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
+ (try_scrolling): When aggressive scrolling is in use, don't let
+ point enter the opposite scroll margin as result of the scroll.
+ (redisplay_window): Fix operator precedence in condition.
2011-03-26 Juanma Barranquero <lekktu@gmail.com>
amount_to_scroll = float_amount;
if (amount_to_scroll == 0 && float_amount > 0)
amount_to_scroll = 1;
+ /* Don't let point enter the scroll margin near top of
+ the window. */
+ if (amount_to_scroll > height - 2*this_scroll_margin + dy)
+ amount_to_scroll = height - 2*this_scroll_margin + dy;
}
}
amount_to_scroll = float_amount;
if (amount_to_scroll == 0 && float_amount > 0)
amount_to_scroll = 1;
+ amount_to_scroll -= this_scroll_margin - dy;
+ /* Don't let point enter the scroll margin near
+ bottom of the window. */
+ if (amount_to_scroll > height - 2*this_scroll_margin + dy)
+ amount_to_scroll = height - 2*this_scroll_margin + dy;
}
}
: BVAR (current_buffer, scroll_down_aggressively);
if (!MINI_WINDOW_P (w)
- && scroll_conservatively > SCROLL_LIMIT || NUMBERP (aggressive))
+ && (scroll_conservatively > SCROLL_LIMIT || NUMBERP (aggressive)))
{
int pt_offset = 0;