comparison 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
comparison
equal deleted inserted replaced
4760:217abcf015c4 4761:b604d235f028
1510 current_buffer = b; 1510 current_buffer = b;
1511 invalidate_current_column (); /* invalidate indentation cache */ 1511 invalidate_current_column (); /* invalidate indentation cache */
1512 1512
1513 if (old_buf) 1513 if (old_buf)
1514 { 1514 {
1515 /* synchronize window point */
1516 Lisp_Object current_window = Fselected_window (Qnil);
1517 if (!NILP (current_window)
1518 && EQ(Fwindow_buffer (current_window), wrap_buffer (old_buf)))
1519 Fset_window_point (current_window, make_int (BUF_PT (old_buf)));
1520
1515 /* Put the undo list back in the base buffer, so that it appears 1521 /* Put the undo list back in the base buffer, so that it appears
1516 that an indirect buffer shares the undo list of its base. */ 1522 that an indirect buffer shares the undo list of its base. */
1517 if (old_buf->base_buffer) 1523 if (old_buf->base_buffer)
1518 old_buf->base_buffer->undo_list = old_buf->undo_list; 1524 old_buf->base_buffer->undo_list = old_buf->undo_list;
1519 } 1525 }