aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2010-06-19 12:40:15 +0300
committerEli Zaretskii2010-06-19 12:40:15 +0300
commitad5a12b51bc0a1bb4acf219d860a6cbbadb61b8a (patch)
treed64f8722b9df51c443d871392b23b4d2b6f8c590 /src
parentd148e8f9bb50a8e8998e9abe05f9e847263e2dbe (diff)
downloademacs-ad5a12b51bc0a1bb4acf219d860a6cbbadb61b8a.tar.gz
emacs-ad5a12b51bc0a1bb4acf219d860a6cbbadb61b8a.zip
Fix occasional recentering under scroll-conservatively.
xdisp.c (try_scrolling): Compute the limit for searching point in forward scroll from scroll_max, instead of an arbitrary limit of 10 screen lines. See http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00766.html and http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00773.html for details.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/xdisp.c19
2 files changed, 22 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9e115942d39..7d875bf5bda 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12010-06-19 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (try_scrolling): Compute the limit for searching point
4 in forward scroll from scroll_max, instead of an arbitrary limit
5 of 10 screen lines. See
6 http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00766.html
7 and
8 http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00773.html
9 for details.
10
12010-06-16 Glenn Morris <rgm@gnu.org> 112010-06-16 Glenn Morris <rgm@gnu.org>
2 12
3 * editfns.c (Fbyte_to_string): Pacify compiler. 13 * editfns.c (Fbyte_to_string): Pacify compiler.
diff --git a/src/xdisp.c b/src/xdisp.c
index c8043308ec8..c111ca2ffa3 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13431,14 +13431,19 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
13431 if (PT > CHARPOS (it.current.pos)) 13431 if (PT > CHARPOS (it.current.pos))
13432 { 13432 {
13433 int y0 = line_bottom_y (&it); 13433 int y0 = line_bottom_y (&it);
13434 13434 /* Compute how many pixels below window bottom to stop searching
13435 /* Compute the distance from the scroll margin to PT 13435 for PT. This avoids costly search for PT that is far away if
13436 (including the height of the cursor line). Moving the 13436 the user limited scrolling by a small number of lines, but
13437 iterator unconditionally to PT can be slow if PT is far 13437 always finds PT if scroll_conservatively is set to a large
13438 away, so stop 10 lines past the window bottom (is there a 13438 number, such as most-positive-fixnum. */
13439 way to do the right thing quickly?). */ 13439 int slack = min (scroll_max, 10 * FRAME_LINE_HEIGHT (f));
13440
13441 /* Compute the distance from the scroll margin to PT or to
13442 the scroll limit, whichever comes first. This should
13443 include the height of the cursor line, to make that line
13444 fully visible. */
13440 move_it_to (&it, PT, -1, 13445 move_it_to (&it, PT, -1,
13441 it.last_visible_y + 10 * FRAME_LINE_HEIGHT (f), 13446 it.last_visible_y + slack,
13442 -1, MOVE_TO_POS | MOVE_TO_Y); 13447 -1, MOVE_TO_POS | MOVE_TO_Y);
13443 dy = line_bottom_y (&it) - y0; 13448 dy = line_bottom_y (&it) - y0;
13444 13449