changeset 34165:3b3a64fbcb05

(save_excursion_restore): Don't move point in another window if it is showing the wrong buffer. Avoid the call to Fwindow_live_p, for speed.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 04 Dec 2000 12:25:36 +0000
parents cfbe6873d494
children c073ad4159fd
files src/editfns.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/editfns.c	Mon Dec 04 12:22:46 2000 +0000
+++ b/src/editfns.c	Mon Dec 04 12:25:36 2000 +0000
@@ -841,12 +841,13 @@
     }
 
   /* If buffer was visible in a window, and a different window was
-     selected, and the old selected window is still live, restore
-     point in that window.  */
+     selected, and the old selected window is still showing this
+     buffer, restore point in that window.  */
   tem = XCDR (info);
   if (visible_p
       && !EQ (tem, selected_window)
-      && !NILP (Fwindow_live_p (tem)))
+      /* This also verifies that the window is still live.  */
+      && XBUFFER (XWINDOW (tem)->buffer) == current_buffer)
     Fset_window_point (tem, make_number (PT));
 
   UNGCPRO;