aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2011-03-28 21:30:35 +0200
committerEli Zaretskii2011-03-28 21:30:35 +0200
commit9f3842cef7423e3ce6f75721284e6351f3a200e5 (patch)
tree4efdb7a5ef2597fc87a1e9ac0a1a8bcb26e3943e /src
parentfd738ca513341c0949c11af1c9add77529aeb63e (diff)
downloademacs-9f3842cef7423e3ce6f75721284e6351f3a200e5.tar.gz
emacs-9f3842cef7423e3ce6f75721284e6351f3a200e5.zip
Fix failures in try_scrolling when scrolling back.
src/xdisp.c (try_scrolling): When point is above the window, allow searching as far as scroll_max, or one screenful, to compute vertical distance from PT to the scroll margin position. This prevents try_scrolling from unnecessarily failing when scroll-conservatively is set to a value slightly larger than the window height.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/xdisp.c11
2 files changed, 16 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e7a93ab7819..cb9096a5a5c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12011-03-28 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (try_scrolling): When point is above the window, allow
4 searching as far as scroll_max, or one screenful, to compute
5 vertical distance from PT to the scroll margin position. This
6 prevents try_scrolling from unnecessarily failing when
7 scroll-conservatively is set to a value slightly larger than the
8 window height.
9
12011-03-27 Eli Zaretskii <eliz@gnu.org> 102011-03-27 Eli Zaretskii <eliz@gnu.org>
2 11
3 * xdisp.c (try_scrolling): Clean up the case of PT below the 12 * xdisp.c (try_scrolling): Clean up the case of PT below the
diff --git a/src/xdisp.c b/src/xdisp.c
index 1b72f2e3081..871d070ed31 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13176,16 +13176,19 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
13176 { 13176 {
13177 /* Point is in the scroll margin at the top of the window or 13177 /* Point is in the scroll margin at the top of the window or
13178 above what is displayed in the window. */ 13178 above what is displayed in the window. */
13179 int y0; 13179 int y0, y_to_move;
13180 13180
13181 /* Compute the vertical distance from PT to the scroll 13181 /* Compute the vertical distance from PT to the scroll
13182 margin position. Give up if distance is greater than 13182 margin position. Move as far as scroll_max allows, or
13183 scroll_max. */ 13183 one screenful, or 10 screen lines, whichever is largest.
13184 Give up if distance is greater than scroll_max. */
13184 SET_TEXT_POS (pos, PT, PT_BYTE); 13185 SET_TEXT_POS (pos, PT, PT_BYTE);
13185 start_display (&it, w, pos); 13186 start_display (&it, w, pos);
13186 y0 = it.current_y; 13187 y0 = it.current_y;
13188 y_to_move = max (it.last_visible_y,
13189 max (scroll_max, 10 * FRAME_LINE_HEIGHT (f)));
13187 move_it_to (&it, CHARPOS (scroll_margin_pos), 0, 13190 move_it_to (&it, CHARPOS (scroll_margin_pos), 0,
13188 it.last_visible_y, -1, 13191 y_to_move, -1,
13189 MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y); 13192 MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
13190 dy = it.current_y - y0; 13193 dy = it.current_y - y0;
13191 if (dy > scroll_max) 13194 if (dy > scroll_max)