*** c:/window.c 2011-01-07 08:25:53.406250000 +0100 --- c:/window.c 2011-01-12 18:25:01.859375000 +0100 *************** *** 158,163 **** --- 158,167 ---- static int window_initialized; + /* ... */ + + static int inhibit_point_swap; + /* Hook to run when window config changes. */ static Lisp_Object Qwindow_configuration_change_hook; *************** *** 3594,3600 **** /* 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. */ ! if (!NILP (selected_window)) { ow = XWINDOW (selected_window); if (! NILP (ow->buffer)) --- 3598,3606 ---- /* 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. */ ! if (inhibit_point_swap) ! inhibit_point_swap = 0; ! else { ow = XWINDOW (selected_window); if (! NILP (ow->buffer)) *************** *** 3602,3607 **** --- 3608,3615 ---- BUF_PT (XBUFFER (ow->buffer)), BUF_PT_BYTE (XBUFFER (ow->buffer))); } + else + inhibit_point_swap = 0; selected_window = window; *************** *** 5767,5773 **** /* This test is needed to make sure PT/PT_BYTE make sense in w->buffer when passed below to set_marker_both. */ error ("move-to-window-line called from unrelated buffer"); ! window = selected_window; start = marker_position (w->start); if (start < BEGV || start > ZV) --- 5775,5781 ---- /* This test is needed to make sure PT/PT_BYTE make sense in w->buffer when passed below to set_marker_both. */ error ("move-to-window-line called from unrelated buffer"); ! window = selected_window; start = marker_position (w->start); if (start < BEGV || start > ZV) *************** *** 6147,6153 **** /* Prevent "swapping out point" in the old selected window using the buffer that has been restored into it. We already swapped out point that from that window's old buffer. */ ! selected_window = Qnil; /* Arrange *not* to restore point in the buffer that was current when the window configuration was saved. */ --- 6155,6161 ---- /* Prevent "swapping out point" in the old selected window using the buffer that has been restored into it. We already swapped out point that from that window's old buffer. */ ! inhibit_point_swap = 1; /* Arrange *not* to restore point in the buffer that was current when the window configuration was saved. */