# HG changeset patch # User Richard M. Stallman # Date 847782744 0 # Node ID f1f1c509a8f2739548c49704aa78e5fb4ecadb63 # Parent a3c07728832a620bc23ba7bd5c73a6cac9a99658 (redisplay_window): When handling scroll_conservatively, scroll a little farther for the sake of scroll_margin. diff -r a3c07728832a -r f1f1c509a8f2 src/xdisp.c --- a/src/xdisp.c Tue Nov 12 06:04:05 1996 +0000 +++ b/src/xdisp.c Tue Nov 12 07:12:24 1996 +0000 @@ -1822,6 +1822,15 @@ 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 @@ 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 @@ 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)) {