aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorStefan Monnier2008-01-28 19:05:13 +0000
committerStefan Monnier2008-01-28 19:05:13 +0000
commitef264c42097f5317044f6a85f895588184c2dbdd (patch)
tree1932e85110df019104b66f5139e9cd0cc637d1ec /src/window.c
parent10ef2ef78a0f1a25c7bf4176771fda524619446e (diff)
downloademacs-ef264c42097f5317044f6a85f895588184c2dbdd.tar.gz
emacs-ef264c42097f5317044f6a85f895588184c2dbdd.zip
* 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.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/window.c b/src/window.c
index bf36cbc032f..5b0d8f4375a 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3307,6 +3307,25 @@ Fset_window_buffer_unwind (obuf)
3307EXFUN (Fset_window_fringes, 4); 3307EXFUN (Fset_window_fringes, 4);
3308EXFUN (Fset_window_scroll_bars, 4); 3308EXFUN (Fset_window_scroll_bars, 4);
3309 3309
3310void
3311run_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
@@ -3408,10 +3427,7 @@ set_window_buffer (window, buffer, run_hooks_p, keep_margins_p)
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);