diff options
| author | Richard M. Stallman | 1999-09-12 02:49:25 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-09-12 02:49:25 +0000 |
| commit | 756a3cb656af01ce2a3803426b69c9b37848830e (patch) | |
| tree | e81690703e2a32a23359dd1ed641665b61e8c2f6 /src | |
| parent | 19b014e465074c4c1cdb7081bf76cbed1680cfca (diff) | |
| download | emacs-756a3cb656af01ce2a3803426b69c9b37848830e.tar.gz emacs-756a3cb656af01ce2a3803426b69c9b37848830e.zip | |
(run_window_scroll_functions): If hook functions switch
buffers, switch back after.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 4694e4a635f..46c22299ecb 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -7808,7 +7808,9 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) | |||
| 7808 | 7808 | ||
| 7809 | 7809 | ||
| 7810 | /* Run window scroll functions, if any, for WINDOW with new window | 7810 | /* Run window scroll functions, if any, for WINDOW with new window |
| 7811 | start STARTP. Sets the window start of WINDOW to that position. */ | 7811 | start STARTP. Sets the window start of WINDOW to that position. |
| 7812 | |||
| 7813 | We assume that the window's buffer is really current. */ | ||
| 7812 | 7814 | ||
| 7813 | static INLINE struct text_pos | 7815 | static INLINE struct text_pos |
| 7814 | run_window_scroll_functions (window, startp) | 7816 | run_window_scroll_functions (window, startp) |
| @@ -7817,12 +7819,18 @@ run_window_scroll_functions (window, startp) | |||
| 7817 | { | 7819 | { |
| 7818 | struct window *w = XWINDOW (window); | 7820 | struct window *w = XWINDOW (window); |
| 7819 | SET_MARKER_FROM_TEXT_POS (w->start, startp); | 7821 | SET_MARKER_FROM_TEXT_POS (w->start, startp); |
| 7820 | 7822 | ||
| 7823 | if (current_buffer != XBUFFER (w->buffer)) | ||
| 7824 | abort (); | ||
| 7825 | |||
| 7821 | if (!NILP (Vwindow_scroll_functions)) | 7826 | if (!NILP (Vwindow_scroll_functions)) |
| 7822 | { | 7827 | { |
| 7823 | run_hook_with_args_2 (Qwindow_scroll_functions, window, | 7828 | run_hook_with_args_2 (Qwindow_scroll_functions, window, |
| 7824 | make_number (CHARPOS (startp))); | 7829 | make_number (CHARPOS (startp))); |
| 7825 | SET_TEXT_POS_FROM_MARKER (startp, w->start); | 7830 | SET_TEXT_POS_FROM_MARKER (startp, w->start); |
| 7831 | /* In case the hook functions switch buffers. */ | ||
| 7832 | if (current_buffer != XBUFFER (w->buffer)) | ||
| 7833 | set_buffer_internal_1 (XBUFFER (w->buffer)); | ||
| 7826 | } | 7834 | } |
| 7827 | 7835 | ||
| 7828 | return startp; | 7836 | return startp; |