Mercurial > emacs
changeset 33490:b714a06b99ec
(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.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 14 Nov 2000 18:38:07 +0000 |
parents | 6e67bfbf2fac |
children | 23166da66d5f |
files | src/xdisp.c |
diffstat | 1 files changed, 10 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xdisp.c Tue Nov 14 18:23:05 2000 +0000 +++ b/src/xdisp.c Tue Nov 14 18:38:07 2000 +0000 @@ -8775,12 +8775,9 @@ /* 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 @@ 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 @@ 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 @@ 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\