comparison src/window.c @ 88050:449ffc76e463

* window.c (run_window_configuration_change_hook): New function. Code extracted from set_window_buffer. Set the selected frame. (set_window_buffer): Use it. * window.h (run_window_configuration_change_hook): Declare. * dispnew.c (change_frame_size_1): Use it instead of set-window-buffer.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 28 Jan 2008 19:05:13 +0000
parents 800f21c9f989
children c70e45a7acfd
comparison
equal deleted inserted replaced
88049:3f51de0dbaee 88050:449ffc76e463
3305 } 3305 }
3306 3306
3307 EXFUN (Fset_window_fringes, 4); 3307 EXFUN (Fset_window_fringes, 4);
3308 EXFUN (Fset_window_scroll_bars, 4); 3308 EXFUN (Fset_window_scroll_bars, 4);
3309 3309
3310 void
3311 run_window_configuration_change_hook (struct frame *f)
3312 {
3313 if (! NILP (Vwindow_configuration_change_hook)
3314 && ! NILP (Vrun_hooks))
3315 {
3316 int count = SPECPDL_INDEX ();
3317 if (SELECTED_FRAME () != f)
3318 {
3319 Lisp_Object frame;
3320 XSETFRAME (frame, f);
3321 record_unwind_protect (Fselect_frame, Fselected_frame ());
3322 Fselect_frame (frame);
3323 }
3324 call1 (Vrun_hooks, Qwindow_configuration_change_hook);
3325 unbind_to (count, Qnil);
3326 }
3327 }
3328
3310 /* Make WINDOW display BUFFER as its contents. RUN_HOOKS_P non-zero 3329 /* Make WINDOW display BUFFER as its contents. RUN_HOOKS_P non-zero
3311 means it's allowed to run hooks. See make_frame for a case where 3330 means it's allowed to run hooks. See make_frame for a case where
3312 it's not allowed. KEEP_MARGINS_P non-zero means that the current 3331 it's not allowed. KEEP_MARGINS_P non-zero means that the current
3313 margins, fringes, and scroll-bar settings of the window are not 3332 margins, fringes, and scroll-bar settings of the window are not
3314 reset from the buffer's local settings. */ 3333 reset from the buffer's local settings. */
3406 if (run_hooks_p) 3425 if (run_hooks_p)
3407 { 3426 {
3408 if (! NILP (Vwindow_scroll_functions)) 3427 if (! NILP (Vwindow_scroll_functions))
3409 run_hook_with_args_2 (Qwindow_scroll_functions, window, 3428 run_hook_with_args_2 (Qwindow_scroll_functions, window,
3410 Fmarker_position (w->start)); 3429 Fmarker_position (w->start));
3411 3430 run_window_configuration_change_hook (XFRAME (WINDOW_FRAME (w)));
3412 if (! NILP (Vwindow_configuration_change_hook)
3413 && ! NILP (Vrun_hooks))
3414 call1 (Vrun_hooks, Qwindow_configuration_change_hook);
3415 } 3431 }
3416 3432
3417 unbind_to (count, Qnil); 3433 unbind_to (count, Qnil);
3418 } 3434 }
3419 3435