From 0894e696763f4faef3023e7445480b35a2a11860 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 14 Nov 2000 18:38:07 +0000 Subject: [PATCH] (try_scrolling): Set scroll_max to max of scroll_* args so setting scroll-step to 1 doesn't defeat scroll-conservatively. Set amount_to_scroll to max of dx and scroll_step so that scroll-conservatively doesn't defeat scroll-step>1. (syms_of_xdisp): Add a hint in scroll-step's docstring to use scroll-conservatively for line-at-a-time scrolling. --- src/xdisp.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 1b31b682102..60f06b6e0c2 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -8775,12 +8775,9 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, /* Compute how much we should try to scroll maximally to bring point into view. */ - if (scroll_step) - scroll_max = scroll_step; - else if (scroll_conservatively) - scroll_max = scroll_conservatively; - else if (temp_scroll_step) - scroll_max = temp_scroll_step; + if (scroll_step || scroll_conservatively || temp_scroll_step) + scroll_max = max (scroll_step, + max (scroll_conservatively, temp_scroll_step)); else if (NUMBERP (current_buffer->scroll_down_aggressively) || NUMBERP (current_buffer->scroll_up_aggressively)) /* We're trying to scroll because of aggressive scrolling @@ -8843,7 +8840,8 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, start_display (&it, w, startp); if (scroll_conservatively) - amount_to_scroll = dy; + amount_to_scroll = + max (dy, CANON_Y_UNIT (f) * max (scroll_step, temp_scroll_step)); else if (scroll_step || temp_scroll_step) amount_to_scroll = scroll_max; else @@ -8896,7 +8894,8 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, start_display (&it, w, startp); if (scroll_conservatively) - amount_to_scroll = dy; + amount_to_scroll = + max (dy, CANON_Y_UNIT (f) * max (scroll_step, temp_scroll_step)); else if (scroll_step || temp_scroll_step) amount_to_scroll = scroll_max; else @@ -13766,7 +13765,9 @@ See also `overlay-arrow-string'."); DEFVAR_INT ("scroll-step", &scroll_step, "*The number of lines to try scrolling a window by when point moves out.\n\ If that fails to bring point back on frame, point is centered instead.\n\ -If this is zero, point is always centered after it moves off frame."); +If this is zero, point is always centered after it moves off frame.\n\ +If you want scrolling to always be a line at a time, you should set\n\ + `scroll-conservatively' to a large value rather than set this to 1."); DEFVAR_INT ("scroll-conservatively", &scroll_conservatively, "*Scroll up to this many lines, to bring point back on screen.\n\ -- 2.11.4.GIT