changeset 99322:e03a3537f4a2

(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.
author Martin Rudalics <rudalics@gmx.at>
date Sun, 02 Nov 2008 10:40:51 +0000
parents 91206eb7321f
children 2b78c770209e
files src/window.c
diffstat 1 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/window.c	Sun Nov 02 10:39:39 2008 +0000
+++ b/src/window.c	Sun Nov 02 10:40:51 2008 +0000
@@ -3353,6 +3353,7 @@
 }
 
 static Lisp_Object select_window_norecord (Lisp_Object window);
+static Lisp_Object select_frame_norecord (Lisp_Object frame);
 
 void
 run_window_configuration_change_hook (struct frame *f)
@@ -3367,8 +3368,8 @@
 
   if (SELECTED_FRAME () != f)
     {
-      record_unwind_protect (Fselect_frame, Fselected_frame ());
-      Fselect_frame (frame);
+      record_unwind_protect (select_frame_norecord, Fselected_frame ());
+      Fselect_frame (frame, Qt);
     }
 
   /* Use the right buffer.  Matters when running the local hooks.  */
@@ -3561,7 +3562,8 @@
 If WINDOW is not already selected, make WINDOW's buffer current
 and make WINDOW the frame's selected window.  Return WINDOW.
 Optional second arg NORECORD non-nil means do not put this buffer
-at the front of the list of recently selected ones.
+at the front of the list of recently selected ones and do not
+make this window the most recently selected one.
 
 Note that the main editor command loop selects the buffer of the
 selected window before each command.  */)
@@ -3594,7 +3596,7 @@
 	 so that FRAME_FOCUS_FRAME is moved appropriately as we
 	 move around in the state where a minibuffer in a separate
 	 frame is active.  */
-      Fselect_frame (WINDOW_FRAME (w));
+      Fselect_frame (WINDOW_FRAME (w), norecord);
       /* Fselect_frame called us back so we've done all the work already.  */
       eassert (EQ (window, selected_window));
       return window;
@@ -3648,6 +3650,14 @@
   return WINDOW_LIVE_P (window)
     ? Fselect_window (window, Qt) : selected_window;
 }
+
+static Lisp_Object
+select_frame_norecord (frame)
+     Lisp_Object frame;
+{
+  return FRAME_LIVE_P (XFRAME (frame))
+    ? Fselect_frame (frame, Qt) : selected_frame;
+}
 
 Lisp_Object
 display_buffer (buffer, not_this_window_p, override_frame)
@@ -6207,7 +6217,7 @@
          when the frame's old selected window has been deleted.  */
       if (f != selected_frame && FRAME_WINDOW_P (f))
 	do_switch_frame (WINDOW_FRAME (XWINDOW (data->root_window)),
-			 0, 0);
+			 0, 0, Qnil);
 #endif
 
       /* Set the screen height to the value it had before this function.  */
@@ -6250,7 +6260,7 @@
 	 Fselect_window above totally superfluous; it still sets f's
 	 selected window.  */
       if (FRAME_LIVE_P (XFRAME (data->selected_frame)))
-	do_switch_frame (data->selected_frame, 0, 0);
+	do_switch_frame (data->selected_frame, 0, 0, Qnil);
 
       run_window_configuration_change_hook (f);
     }