diff src/buffer.c @ 4761:b604d235f028

Synchronize window point with current point of old buffer. 2009-10-16 Michael Sperber <mike@xemacs.org> * buffer.c (set_buffer_internal): Synchronize the window point with the current point when switching to another buffer.
author Mike Sperber <sperber@deinprogramm.de>
date Sun, 22 Nov 2009 11:31:36 +0100
parents d261888e5069
children 19a72041c5ed 8431b52e43b1 e0db3c197671
line wrap: on
line diff
--- 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)