aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/dispnew.c4
-rw-r--r--src/window.c24
-rw-r--r--src/window.h1
4 files changed, 28 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3986b4f9284..0d1a18ef2ca 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,11 @@
12008-01-28 Stefan Monnier <monnier@iro.umontreal.ca> 12008-01-28 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * window.c (run_window_configuration_change_hook): New function.
4 Code extracted from set_window_buffer. Set the selected frame.
5 (set_window_buffer): Use it.
6 * window.h (run_window_configuration_change_hook): Declare.
7 * dispnew.c (change_frame_size_1): Use it instead of set-window-buffer.
8
3 * keyboard.c (read_char): Yet another int/Lisp_Object mixup (YAILOM). 9 * keyboard.c (read_char): Yet another int/Lisp_Object mixup (YAILOM).
4 10
52008-01-27 Dan Nicolaescu <dann@ics.uci.edu> 112008-01-27 Dan Nicolaescu <dann@ics.uci.edu>
diff --git a/src/dispnew.c b/src/dispnew.c
index ab0f581b53d..284e1fde4bd 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6386,9 +6386,7 @@ change_frame_size_1 (f, newheight, newwidth, pretend, delay, safe)
6386 6386
6387 record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); 6387 record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
6388 6388
6389 /* This isn't quite a no-op: it runs window-configuration-change-hook. */ 6389 run_window_configuration_change_hook (f);
6390 Fset_window_buffer (FRAME_SELECTED_WINDOW (f),
6391 XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer, Qt);
6392 6390
6393 unbind_to (count, Qnil); 6391 unbind_to (count, Qnil);
6394} 6392}
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);
diff --git a/src/window.h b/src/window.h
index fb56be8bfb7..b2c62fde01f 100644
--- a/src/window.h
+++ b/src/window.h
@@ -790,6 +790,7 @@ extern void foreach_window P_ ((struct frame *,
790extern void grow_mini_window P_ ((struct window *, int)); 790extern void grow_mini_window P_ ((struct window *, int));
791extern void shrink_mini_window P_ ((struct window *)); 791extern void shrink_mini_window P_ ((struct window *));
792 792
793void run_window_configuration_change_hook (struct frame *f);
793 794
794/* Make WINDOW display BUFFER as its contents. RUN_HOOKS_P non-zero 795/* Make WINDOW display BUFFER as its contents. RUN_HOOKS_P non-zero
795 means it's allowed to run hooks. See make_frame for a case where 796 means it's allowed to run hooks. See make_frame for a case where