aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1996-11-12 07:12:24 +0000
committerRichard M. Stallman1996-11-12 07:12:24 +0000
commitf9c8af064c274b870c2d7346dfa8367c19cea9e3 (patch)
tree29807f91078b0bc8166bae9eff7ed962b9fb60df /src
parent9f18e6194481b95efc8bb0b4349a24d3c3704268 (diff)
downloademacs-f9c8af064c274b870c2d7346dfa8367c19cea9e3.tar.gz
emacs-f9c8af064c274b870c2d7346dfa8367c19cea9e3.zip
(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.c13
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)
1822 if (scroll_conservatively && !current_buffer->clip_changed 1822 if (scroll_conservatively && !current_buffer->clip_changed
1823 && startp >= BEGV && startp <= ZV) 1823 && startp >= BEGV && startp <= ZV)
1824 { 1824 {
1825 int this_scroll_margin = scroll_margin;
1826
1827 /* Don't use a scroll margin that is negative or too large. */
1828 if (this_scroll_margin < 0)
1829 this_scroll_margin = 0;
1830
1831 if (XINT (w->height) < 4 * scroll_margin)
1832 this_scroll_margin = XINT (w->height) / 4;
1833
1825 if (PT >= Z - XFASTINT (w->window_end_pos)) 1834 if (PT >= Z - XFASTINT (w->window_end_pos))
1826 { 1835 {
1827 struct position pos; 1836 struct position pos;
@@ -1832,7 +1841,7 @@ redisplay_window (window, just_this_one, preserve_echo_area)
1832 if (pos.vpos > scroll_conservatively) 1841 if (pos.vpos > scroll_conservatively)
1833 goto scroll_fail_1; 1842 goto scroll_fail_1;
1834 1843
1835 pos = *vmotion (startp, pos.vpos + 1, w); 1844 pos = *vmotion (startp, pos.vpos + 1 + this_scroll_margin, w);
1836 1845
1837 if (! NILP (Vwindow_scroll_functions)) 1846 if (! NILP (Vwindow_scroll_functions))
1838 { 1847 {
@@ -1863,7 +1872,7 @@ redisplay_window (window, just_this_one, preserve_echo_area)
1863 if (pos.vpos >= scroll_conservatively) 1872 if (pos.vpos >= scroll_conservatively)
1864 goto scroll_fail_1; 1873 goto scroll_fail_1;
1865 1874
1866 pos = *vmotion (startp, - pos.vpos, w); 1875 pos = *vmotion (startp, - pos.vpos - this_scroll_margin, w);
1867 1876
1868 if (! NILP (Vwindow_scroll_functions)) 1877 if (! NILP (Vwindow_scroll_functions))
1869 { 1878 {