aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorMartin Rudalics2008-11-02 10:40:51 +0000
committerMartin Rudalics2008-11-02 10:40:51 +0000
commitc6932ecd58fdae1f72558b857ce2a2f2b788daf2 (patch)
tree8432584584a272bf9eb33dd4276f23ee1d39be2d /src/window.c
parent9e61f0d769d48955b0bc0f7042d16d48dece3c8b (diff)
downloademacs-c6932ecd58fdae1f72558b857ce2a2f2b788daf2.tar.gz
emacs-c6932ecd58fdae1f72558b857ce2a2f2b788daf2.zip
(select_frame_norecord): New function.
(run_window_configuration_change_hook): Use it and call Fselect_frame with NORECORD set. (Fselect_window): Pass NORECORD to Fselect_frame. (Fset_window_configuration): Handle NORECORD argument in call of do_switch_frame.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/window.c b/src/window.c
index 87f166fd7b4..9f71a17c696 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3353,6 +3353,7 @@ run_funs (Lisp_Object funs)
3353} 3353}
3354 3354
3355static Lisp_Object select_window_norecord (Lisp_Object window); 3355static Lisp_Object select_window_norecord (Lisp_Object window);
3356static Lisp_Object select_frame_norecord (Lisp_Object frame);
3356 3357
3357void 3358void
3358run_window_configuration_change_hook (struct frame *f) 3359run_window_configuration_change_hook (struct frame *f)
@@ -3367,8 +3368,8 @@ run_window_configuration_change_hook (struct frame *f)
3367 3368
3368 if (SELECTED_FRAME () != f) 3369 if (SELECTED_FRAME () != f)
3369 { 3370 {
3370 record_unwind_protect (Fselect_frame, Fselected_frame ()); 3371 record_unwind_protect (select_frame_norecord, Fselected_frame ());
3371 Fselect_frame (frame); 3372 Fselect_frame (frame, Qt);
3372 } 3373 }
3373 3374
3374 /* Use the right buffer. Matters when running the local hooks. */ 3375 /* Use the right buffer. Matters when running the local hooks. */
@@ -3561,7 +3562,8 @@ DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0,
3561If WINDOW is not already selected, make WINDOW's buffer current 3562If WINDOW is not already selected, make WINDOW's buffer current
3562and make WINDOW the frame's selected window. Return WINDOW. 3563and make WINDOW the frame's selected window. Return WINDOW.
3563Optional second arg NORECORD non-nil means do not put this buffer 3564Optional second arg NORECORD non-nil means do not put this buffer
3564at the front of the list of recently selected ones. 3565at the front of the list of recently selected ones and do not
3566make this window the most recently selected one.
3565 3567
3566Note that the main editor command loop selects the buffer of the 3568Note that the main editor command loop selects the buffer of the
3567selected window before each command. */) 3569selected window before each command. */)
@@ -3594,7 +3596,7 @@ selected window before each command. */)
3594 so that FRAME_FOCUS_FRAME is moved appropriately as we 3596 so that FRAME_FOCUS_FRAME is moved appropriately as we
3595 move around in the state where a minibuffer in a separate 3597 move around in the state where a minibuffer in a separate
3596 frame is active. */ 3598 frame is active. */
3597 Fselect_frame (WINDOW_FRAME (w)); 3599 Fselect_frame (WINDOW_FRAME (w), norecord);
3598 /* Fselect_frame called us back so we've done all the work already. */ 3600 /* Fselect_frame called us back so we've done all the work already. */
3599 eassert (EQ (window, selected_window)); 3601 eassert (EQ (window, selected_window));
3600 return window; 3602 return window;
@@ -3648,6 +3650,14 @@ select_window_norecord (window)
3648 return WINDOW_LIVE_P (window) 3650 return WINDOW_LIVE_P (window)
3649 ? Fselect_window (window, Qt) : selected_window; 3651 ? Fselect_window (window, Qt) : selected_window;
3650} 3652}
3653
3654static Lisp_Object
3655select_frame_norecord (frame)
3656 Lisp_Object frame;
3657{
3658 return FRAME_LIVE_P (XFRAME (frame))
3659 ? Fselect_frame (frame, Qt) : selected_frame;
3660}
3651 3661
3652Lisp_Object 3662Lisp_Object
3653display_buffer (buffer, not_this_window_p, override_frame) 3663display_buffer (buffer, not_this_window_p, override_frame)
@@ -6207,7 +6217,7 @@ the return value is nil. Otherwise the value is t. */)
6207 when the frame's old selected window has been deleted. */ 6217 when the frame's old selected window has been deleted. */
6208 if (f != selected_frame && FRAME_WINDOW_P (f)) 6218 if (f != selected_frame && FRAME_WINDOW_P (f))
6209 do_switch_frame (WINDOW_FRAME (XWINDOW (data->root_window)), 6219 do_switch_frame (WINDOW_FRAME (XWINDOW (data->root_window)),
6210 0, 0); 6220 0, 0, Qnil);
6211#endif 6221#endif
6212 6222
6213 /* Set the screen height to the value it had before this function. */ 6223 /* Set the screen height to the value it had before this function. */
@@ -6250,7 +6260,7 @@ the return value is nil. Otherwise the value is t. */)
6250 Fselect_window above totally superfluous; it still sets f's 6260 Fselect_window above totally superfluous; it still sets f's
6251 selected window. */ 6261 selected window. */
6252 if (FRAME_LIVE_P (XFRAME (data->selected_frame))) 6262 if (FRAME_LIVE_P (XFRAME (data->selected_frame)))
6253 do_switch_frame (data->selected_frame, 0, 0); 6263 do_switch_frame (data->selected_frame, 0, 0, Qnil);
6254 6264
6255 run_window_configuration_change_hook (f); 6265 run_window_configuration_change_hook (f);
6256 } 6266 }