diff src/window.c @ 83288:2c2b97b30980

Merged from miles@gnu.org--gnu-2005 (patch 60-65, 246-265) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-246 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-247 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-248 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-249 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-250 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-251 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-252 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-253 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-254 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-255 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-256 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-257 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-258 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-259 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-260 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-261 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-262 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-263 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-264 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-265 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-60 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-61 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-62 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-63 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-64 (mm-string-to-multibyte): Use Gnus trunk definition. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-65 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-328
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 18 Apr 2005 13:40:23 +0000
parents 9deb6323655c db63a29e7669
children 042f282a2ed7
line wrap: on
line diff
--- a/src/window.c	Mon Apr 18 13:17:40 2005 +0000
+++ b/src/window.c	Mon Apr 18 13:40:23 2005 +0000
@@ -1,7 +1,7 @@
 /* Window creation, deletion and examination for GNU Emacs.
    Does not include redisplay.
-   Copyright (C) 1985,86,87, 1993,94,95,96,97,98, 2000,01,02,03,04
-   Free Software Foundation, Inc.
+   Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
+     2001, 2002, 2003, 2004, 2005  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -5596,7 +5596,20 @@
       if (XBUFFER (new_current_buffer) == current_buffer)
 	old_point = PT;
       else
-	old_point = BUF_PT (XBUFFER (new_current_buffer));
+	/* BUF_PT (XBUFFER (new_current_buffer)) gives us the position of
+	   point in new_current_buffer as of the last time this buffer was
+	   used.  This can be non-deterministic since it can be changed by
+	   things like jit-lock by mere temporary selection of some random
+	   window that happens to show this buffer.
+	   So if possible we want this arbitrary choice of "which point" to
+	   be the one from the to-be-selected-window so as to prevent this
+	   window's cursor from being copied from another window.  */
+	if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer)
+	    /* If current_window = selected_window, its point is in BUF_PT.  */
+	    && !EQ (selected_window, data->current_window))
+	  old_point = XMARKER (XWINDOW (data->current_window)->pointm)->charpos;
+	else
+	  old_point = BUF_PT (XBUFFER (new_current_buffer));
     }
 
   frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame;