comparison src/xdisp.c @ 25643:385bf7dbf253

(run_window_scroll_functions): If hook functions switch buffers, switch back after.
author Richard M. Stallman <rms@gnu.org>
date Sun, 12 Sep 1999 02:49:25 +0000
parents 766b6a577f15
children 0072098f54df
comparison
equal deleted inserted replaced
25642:556711217681 25643:385bf7dbf253
7806 } 7806 }
7807 } 7807 }
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)
7815 Lisp_Object window; 7817 Lisp_Object window;
7816 struct text_pos startp; 7818 struct text_pos 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;
7829 } 7837 }
7830 7838