changeset 112081:e829321a29ff

* src/window.c (Fmove_to_window_line): Avoid abort when called in a buffer different from selected-window's.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 25 Dec 2010 23:04:58 -0500
parents f1e03f250c47
children 5a77e1764c9e 47eeace758ba
files src/ChangeLog src/window.c
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Dec 25 21:20:45 2010 +0200
+++ b/src/ChangeLog	Sat Dec 25 23:04:58 2010 -0500
@@ -1,3 +1,8 @@
+2010-12-26  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* window.c (Fmove_to_window_line): Avoid abort when called in a buffer
+	different from selected-window's.
+
 2010-12-25  Eli Zaretskii  <eliz@gnu.org>
 
 	* keyboard.c (parse_menu_item): Prepend "  " to the key sequence
--- a/src/window.c	Sat Dec 25 21:20:45 2010 +0200
+++ b/src/window.c	Sat Dec 25 23:04:58 2010 -0500
@@ -5856,6 +5856,12 @@
   int this_scroll_margin;
 #endif
 
+  if (!(BUFFERP (w->buffer)
+	&& XBUFFER (w->buffer) == current_buffer))
+    /* This test is needed to make sure PT/PT_BYTE make sense in w->buffer
+       when passed below to set_marker_both.  */
+    error ("move-to-window-line called from unrelated buffer");
+  
   window = selected_window;
   start = marker_position (w->start);
   if (start < BEGV || start > ZV)