From 794b75c7690370d5a4fcc09a6121972f3886cd25 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 25 Dec 2010 23:04:58 -0500 Subject: [PATCH] * src/window.c (Fmove_to_window_line): Avoid abort when called in a buffer different from selected-window's. --- src/ChangeLog | 5 +++++ src/window.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index f61b2786461..3478a0cb653 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-12-26 Stefan Monnier + + * window.c (Fmove_to_window_line): Avoid abort when called in a buffer + different from selected-window's. + 2010-12-25 Eli Zaretskii * keyboard.c (parse_menu_item): Prepend " " to the key sequence diff --git a/src/window.c b/src/window.c index f9a2d31b4fe..1c50e997684 100644 --- a/src/window.c +++ b/src/window.c @@ -5856,6 +5856,12 @@ zero means top of window, negative means relative to bottom of window. */) 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) -- 2.39.2