diff options
| author | Stefan Monnier | 2000-11-14 18:38:07 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2000-11-14 18:38:07 +0000 |
| commit | 0894e696763f4faef3023e7445480b35a2a11860 (patch) | |
| tree | 8e32beb199c0f75474218e846b83528af0b775e4 /src | |
| parent | 9e445e292ee905691c5a21602b3c059ecb205dd2 (diff) | |
| download | emacs-0894e696763f4faef3023e7445480b35a2a11860.tar.gz emacs-0894e696763f4faef3023e7445480b35a2a11860.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 19 |
1 files 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, | |||
| 8775 | 8775 | ||
| 8776 | /* Compute how much we should try to scroll maximally to bring point | 8776 | /* Compute how much we should try to scroll maximally to bring point |
| 8777 | into view. */ | 8777 | into view. */ |
| 8778 | if (scroll_step) | 8778 | if (scroll_step || scroll_conservatively || temp_scroll_step) |
| 8779 | scroll_max = scroll_step; | 8779 | scroll_max = max (scroll_step, |
| 8780 | else if (scroll_conservatively) | 8780 | max (scroll_conservatively, temp_scroll_step)); |
| 8781 | scroll_max = scroll_conservatively; | ||
| 8782 | else if (temp_scroll_step) | ||
| 8783 | scroll_max = temp_scroll_step; | ||
| 8784 | else if (NUMBERP (current_buffer->scroll_down_aggressively) | 8781 | else if (NUMBERP (current_buffer->scroll_down_aggressively) |
| 8785 | || NUMBERP (current_buffer->scroll_up_aggressively)) | 8782 | || NUMBERP (current_buffer->scroll_up_aggressively)) |
| 8786 | /* We're trying to scroll because of aggressive scrolling | 8783 | /* We're trying to scroll because of aggressive scrolling |
| @@ -8843,7 +8840,8 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, | |||
| 8843 | start_display (&it, w, startp); | 8840 | start_display (&it, w, startp); |
| 8844 | 8841 | ||
| 8845 | if (scroll_conservatively) | 8842 | if (scroll_conservatively) |
| 8846 | amount_to_scroll = dy; | 8843 | amount_to_scroll = |
| 8844 | max (dy, CANON_Y_UNIT (f) * max (scroll_step, temp_scroll_step)); | ||
| 8847 | else if (scroll_step || temp_scroll_step) | 8845 | else if (scroll_step || temp_scroll_step) |
| 8848 | amount_to_scroll = scroll_max; | 8846 | amount_to_scroll = scroll_max; |
| 8849 | else | 8847 | else |
| @@ -8896,7 +8894,8 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, | |||
| 8896 | start_display (&it, w, startp); | 8894 | start_display (&it, w, startp); |
| 8897 | 8895 | ||
| 8898 | if (scroll_conservatively) | 8896 | if (scroll_conservatively) |
| 8899 | amount_to_scroll = dy; | 8897 | amount_to_scroll = |
| 8898 | max (dy, CANON_Y_UNIT (f) * max (scroll_step, temp_scroll_step)); | ||
| 8900 | else if (scroll_step || temp_scroll_step) | 8899 | else if (scroll_step || temp_scroll_step) |
| 8901 | amount_to_scroll = scroll_max; | 8900 | amount_to_scroll = scroll_max; |
| 8902 | else | 8901 | else |
| @@ -13766,7 +13765,9 @@ See also `overlay-arrow-string'."); | |||
| 13766 | DEFVAR_INT ("scroll-step", &scroll_step, | 13765 | DEFVAR_INT ("scroll-step", &scroll_step, |
| 13767 | "*The number of lines to try scrolling a window by when point moves out.\n\ | 13766 | "*The number of lines to try scrolling a window by when point moves out.\n\ |
| 13768 | If that fails to bring point back on frame, point is centered instead.\n\ | 13767 | If that fails to bring point back on frame, point is centered instead.\n\ |
| 13769 | If this is zero, point is always centered after it moves off frame."); | 13768 | If this is zero, point is always centered after it moves off frame.\n\ |
| 13769 | If you want scrolling to always be a line at a time, you should set\n\ | ||
| 13770 | `scroll-conservatively' to a large value rather than set this to 1."); | ||
| 13770 | 13771 | ||
| 13771 | DEFVAR_INT ("scroll-conservatively", &scroll_conservatively, | 13772 | DEFVAR_INT ("scroll-conservatively", &scroll_conservatively, |
| 13772 | "*Scroll up to this many lines, to bring point back on screen.\n\ | 13773 | "*Scroll up to this many lines, to bring point back on screen.\n\ |