diff options
| author | Richard M. Stallman | 1996-12-10 23:26:48 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-12-10 23:26:48 +0000 |
| commit | 345d45b2c0101cf06735b544e2f1806521f5dea9 (patch) | |
| tree | 9821384e80a8b84116acace242eb8b1ee5daf6bd /src | |
| parent | 38b294ca299f5af0abe1a90c3910b08e8971f9cb (diff) | |
| download | emacs-345d45b2c0101cf06735b544e2f1806521f5dea9.tar.gz emacs-345d45b2c0101cf06735b544e2f1806521f5dea9.zip | |
(window_scroll): Don't set w->start or w->force_start if signaling an error.
Diffstat (limited to 'src')
| -rw-r--r-- | src/window.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/window.c b/src/window.c index 0883f0ccb34..a6015ddfae9 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -2652,10 +2652,7 @@ window_scroll (window, n, noerror) | |||
| 2652 | register Lisp_Object tem; | 2652 | register Lisp_Object tem; |
| 2653 | int lose; | 2653 | int lose; |
| 2654 | Lisp_Object bolp, nmoved; | 2654 | Lisp_Object bolp, nmoved; |
| 2655 | 2655 | int startpos; | |
| 2656 | /* Always set force_start so that redisplay_window will run | ||
| 2657 | the window-scroll-functions. */ | ||
| 2658 | w->force_start = Qt; | ||
| 2659 | 2656 | ||
| 2660 | XSETFASTINT (tem, PT); | 2657 | XSETFASTINT (tem, PT); |
| 2661 | tem = Fpos_visible_in_window_p (tem, window); | 2658 | tem = Fpos_visible_in_window_p (tem, window); |
| @@ -2663,11 +2660,12 @@ window_scroll (window, n, noerror) | |||
| 2663 | if (NILP (tem)) | 2660 | if (NILP (tem)) |
| 2664 | { | 2661 | { |
| 2665 | Fvertical_motion (make_number (- (ht / 2)), window); | 2662 | Fvertical_motion (make_number (- (ht / 2)), window); |
| 2666 | XSETFASTINT (tem, PT); | 2663 | startpos = PT; |
| 2667 | Fset_marker (w->start, tem, w->buffer); | ||
| 2668 | } | 2664 | } |
| 2665 | else | ||
| 2666 | startpos = marker_position (w->start); | ||
| 2669 | 2667 | ||
| 2670 | SET_PT (marker_position (w->start)); | 2668 | SET_PT (startpos); |
| 2671 | lose = n < 0 && PT == BEGV; | 2669 | lose = n < 0 && PT == BEGV; |
| 2672 | Fvertical_motion (make_number (n), window); | 2670 | Fvertical_motion (make_number (n), window); |
| 2673 | pos = PT; | 2671 | pos = PT; |
| @@ -2700,6 +2698,9 @@ window_scroll (window, n, noerror) | |||
| 2700 | w->update_mode_line = Qt; | 2698 | w->update_mode_line = Qt; |
| 2701 | XSETFASTINT (w->last_modified, 0); | 2699 | XSETFASTINT (w->last_modified, 0); |
| 2702 | XSETFASTINT (w->last_overlay_modified, 0); | 2700 | XSETFASTINT (w->last_overlay_modified, 0); |
| 2701 | /* Set force_start so that redisplay_window will run | ||
| 2702 | the window-scroll-functions. */ | ||
| 2703 | w->force_start = Qt; | ||
| 2703 | 2704 | ||
| 2704 | /* If we scrolled forward, put point enough lines down | 2705 | /* If we scrolled forward, put point enough lines down |
| 2705 | that it is outside the scroll margin. */ | 2706 | that it is outside the scroll margin. */ |