diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-11-12 07:12:24 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-11-12 07:12:24 +0000 |
commit | fa823a56cc5a0550fde044f9b60571e2db200e62 (patch) | |
tree | ff8c6f187f9a6cb5914f6e4dd9c3f8f8ae9d5ae0 /src | |
parent | 7f02e1c319ea01d735f333d18ece4d63337670ef (diff) | |
download | emacs-fa823a56cc5a0550fde044f9b60571e2db200e62.tar.gz |
(redisplay_window): When handling scroll_conservatively,
scroll a little farther for the sake of scroll_margin.
Diffstat (limited to 'src')
-rw-r--r-- | src/xdisp.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index b74fe724300..d947a5dd40a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1822,6 +1822,15 @@ redisplay_window (window, just_this_one, preserve_echo_area) if (scroll_conservatively && !current_buffer->clip_changed && startp >= BEGV && startp <= ZV) { + int this_scroll_margin = scroll_margin; + + /* Don't use a scroll margin that is negative or too large. */ + if (this_scroll_margin < 0) + this_scroll_margin = 0; + + if (XINT (w->height) < 4 * scroll_margin) + this_scroll_margin = XINT (w->height) / 4; + if (PT >= Z - XFASTINT (w->window_end_pos)) { struct position pos; @@ -1832,7 +1841,7 @@ redisplay_window (window, just_this_one, preserve_echo_area) if (pos.vpos > scroll_conservatively) goto scroll_fail_1; - pos = *vmotion (startp, pos.vpos + 1, w); + pos = *vmotion (startp, pos.vpos + 1 + this_scroll_margin, w); if (! NILP (Vwindow_scroll_functions)) { @@ -1863,7 +1872,7 @@ redisplay_window (window, just_this_one, preserve_echo_area) if (pos.vpos >= scroll_conservatively) goto scroll_fail_1; - pos = *vmotion (startp, - pos.vpos, w); + pos = *vmotion (startp, - pos.vpos - this_scroll_margin, w); if (! NILP (Vwindow_scroll_functions)) { |