aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1995-12-24 16:03:05 +0000
committerRichard M. Stallman1995-12-24 16:03:05 +0000
commite63574d79b36f4ada1c2e4f4c296a8fc939193b7 (patch)
tree012f87368df73f95bd925dc8b9d9f8cd69e2a5c6 /src
parent76d5492ba796849f6b2559ebdcdef58cef352dd8 (diff)
downloademacs-e63574d79b36f4ada1c2e4f4c296a8fc939193b7.tar.gz
emacs-e63574d79b36f4ada1c2e4f4c296a8fc939193b7.zip
(redisplay_window): Clear force_start field
before running the Qwindow_scroll_functions. In the recenter case, set w->start before running them.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index fbffc857128..4f236b7fa7f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1502,11 +1502,16 @@ redisplay_window (window, just_this_one)
1502 unless the specified location is outside the accessible range. */ 1502 unless the specified location is outside the accessible range. */
1503 if (!NILP (w->force_start)) 1503 if (!NILP (w->force_start))
1504 { 1504 {
1505 w->force_start = Qnil;
1505 /* Forget any recorded base line for line number display. */ 1506 /* Forget any recorded base line for line number display. */
1506 w->base_line_number = Qnil; 1507 w->base_line_number = Qnil;
1507 /* Redisplay the mode line. Select the buffer properly for that. 1508 /* Redisplay the mode line. Select the buffer properly for that.
1508 Also, run the hook window-scroll-functions 1509 Also, run the hook window-scroll-functions
1509 because we have scrolled. */ 1510 because we have scrolled. */
1511 /* Note, we do this after clearing force_start because
1512 if there's an error, it is better to forget about force_start
1513 than to get into an infinite loop calling the hook functions
1514 and having them get more errors. */
1510 if (!update_mode_line 1515 if (!update_mode_line
1511 || ! NILP (Vwindow_scroll_functions)) 1516 || ! NILP (Vwindow_scroll_functions))
1512 { 1517 {
@@ -1520,7 +1525,6 @@ redisplay_window (window, just_this_one)
1520 run_hook_with_args_2 (Qwindow_scroll_functions, window, 1525 run_hook_with_args_2 (Qwindow_scroll_functions, window,
1521 make_number (startp)); 1526 make_number (startp));
1522 } 1527 }
1523 w->force_start = Qnil;
1524 XSETFASTINT (w->last_modified, 0); 1528 XSETFASTINT (w->last_modified, 0);
1525 if (startp < BEGV) startp = BEGV; 1529 if (startp < BEGV) startp = BEGV;
1526 if (startp > ZV) startp = ZV; 1530 if (startp > ZV) startp = ZV;
@@ -1718,6 +1722,9 @@ recenter:
1718 w->base_line_number = Qnil; 1722 w->base_line_number = Qnil;
1719 1723
1720 pos = *vmotion (PT, - (height / 2), w); 1724 pos = *vmotion (PT, - (height / 2), w);
1725 /* Set startp here explicitly in case that helps avoid an infinite loop
1726 in case the window-scroll-functions functions get errors. */
1727 Fset_marker (w->start, make_number (pos), Qnil);
1721 if (! NILP (Vwindow_scroll_functions)) 1728 if (! NILP (Vwindow_scroll_functions))
1722 run_hook_with_args_2 (Qwindow_scroll_functions, window, 1729 run_hook_with_args_2 (Qwindow_scroll_functions, window,
1723 make_number (pos.bufpos)); 1730 make_number (pos.bufpos));