# HG changeset patch # User Mike Sperber # Date 1258885896 -3600 # Node ID b604d235f0280df7e4fa51d906eabbdbc9069a4a # Parent 217abcf015c44f8bdc53700122b3f52a684043f7 Synchronize window point with current point of old buffer. 2009-10-16 Michael Sperber * buffer.c (set_buffer_internal): Synchronize the window point with the current point when switching to another buffer. diff -r 217abcf015c4 -r b604d235f028 src/ChangeLog --- a/src/ChangeLog Thu Nov 19 18:21:06 2009 -0500 +++ b/src/ChangeLog Sun Nov 22 11:31:36 2009 +0100 @@ -476,6 +476,11 @@ On Darwin, use realpath(3)'s case correction to get the canonical case for a file; thank you Robert Delius Royar! +2009-10-16 Michael Sperber + + * buffer.c (set_buffer_internal): Synchronize the window point + with the current point when switching to another buffer. + 2009-10-11 Michael Sperber * event-stream.c (post_command_hook): Run `post-command-hook' diff -r 217abcf015c4 -r b604d235f028 src/buffer.c --- a/src/buffer.c Thu Nov 19 18:21:06 2009 -0500 +++ b/src/buffer.c Sun Nov 22 11:31:36 2009 +0100 @@ -1512,6 +1512,12 @@ if (old_buf) { + /* synchronize window point */ + Lisp_Object current_window = Fselected_window (Qnil); + if (!NILP (current_window) + && EQ(Fwindow_buffer (current_window), wrap_buffer (old_buf))) + Fset_window_point (current_window, make_int (BUF_PT (old_buf))); + /* Put the undo list back in the base buffer, so that it appears that an indirect buffer shares the undo list of its base. */ if (old_buf->base_buffer)