In select_window always make selected window's buffer current.
authorMartin Rudalics <rudalics@gmx.at>
Mon, 20 Aug 2012 09:28:39 +0000 (11:28 +0200)
committerMartin Rudalics <rudalics@gmx.at>
Mon, 20 Aug 2012 09:28:39 +0000 (11:28 +0200)
* window.c (select_window): Always make selected window's buffer
current.

src/ChangeLog
src/window.c

index 58fa0de..c6a4575 100644 (file)
@@ -1,3 +1,8 @@
+2012-08-20  Martin Rudalics  <rudalics@gmx.at>
+
+       * window.c (select_window): Always make selected window's buffer
+       current.
+
 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
 
        Use AREF and ASET for docstrings of category tables.
index b379eec..9045721 100644 (file)
@@ -477,6 +477,9 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
       record_buffer (w->buffer);
     }
 
+  /* Make the selected window's buffer current.  */
+  Fset_buffer (w->buffer);
+
   if (EQ (window, selected_window) && !inhibit_point_swap)
     return window;
 
@@ -496,9 +499,9 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
   else
     fset_selected_window (sf, window);
 
-  /* Store the current buffer's actual point into the
-     old selected window.  It belongs to that window,
-     and when the window is not selected, must be in the window.  */
+  /* Store the old selected window's buffer's point in pointm of the old
+     selected window.  It belongs to that window, and when the window is
+     not selected, must be in the window.  */
   if (!inhibit_point_swap)
     {
       ow = XWINDOW (selected_window);
@@ -509,9 +512,6 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
     }
 
   selected_window = window;
-
-  Fset_buffer (w->buffer);
-
   bset_last_selected_window (XBUFFER (w->buffer), window);
 
   /* Go to the point recorded in the window.