=== modified file 'src/window.c'
--- src/window.c 2012-08-18 06:06:39 +0000
+++ src/window.c 2012-08-18 13:09:15 +0000
@@ -5889,7 +5889,13 @@
}
if (!NILP (new_current_buffer))
- Fset_buffer (new_current_buffer);
+ {
+ Fset_buffer (new_current_buffer);
+ /* If the new current buffer doesn't appear in the selected
+ window, go to its old point. */
+ if (!EQ (XWINDOW (data->current_window)->buffer,
new_current_buffer))
+ Fgoto_char (make_number (old_point));
+ }
Vminibuf_scroll_window = data->minibuf_scroll_window;
minibuf_selected_window = data->minibuf_selected_window;