diff --git a/src/ChangeLog b/src/ChangeLog index faa2a104337305fb481beb7c46e98db35380fce0..906d17535c6ef8aef115e169fa6f326bf6c6d6e5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2012-04-23 Eli Zaretskii + + * xdisp.c (pos_visible_p): If the window start position is beyond + ZV, start the display from buffer beginning. Prevents assertion + violation in init_iterator when the minibuffer window is scrolled + via the scroll bar. + + * window.c (window_scroll_pixel_based): Likewise. + 2012-04-23 Chong Yidong * keymap.c (where_is_internal): Doc fix (Bug#10872). diff --git a/src/window.c b/src/window.c index af7968f9edf519545f447b8b583fbc03c4a1fb60..f93f58f9b72dd99fe6415ed667a217a491de0c41 100644 --- a/src/window.c +++ b/src/window.c @@ -4221,6 +4221,11 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) void *itdata = NULL; SET_TEXT_POS_FROM_MARKER (start, w->start); + /* Scrolling a minibuffer window via scroll bar when the echo area + shows long text sometimes resets the minibuffer contents behind + our backs. */ + if (CHARPOS (start) > ZV) + SET_TEXT_POS (start, BEGV, BEGV_BYTE); /* If PT is not visible in WINDOW, move back one half of the screen. Allow PT to be partially visible, otherwise diff --git a/src/xdisp.c b/src/xdisp.c index 9881adfa34d33ff221cb07e52f59653ea01b9eea..e53d3a57cd6cd2af6bc5b6b522c8dc068c7a8fbb 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1265,6 +1265,11 @@ pos_visible_p (struct window *w, EMACS_INT charpos, int *x, int *y, } SET_TEXT_POS_FROM_MARKER (top, w->start); + /* Scrolling a minibuffer window via scroll bar when the echo area + shows long text sometimes resets the minibuffer contents behind + our backs. */ + if (CHARPOS (top) > ZV) + SET_TEXT_POS (top, BEGV, BEGV_BYTE); /* Compute exact mode line heights. */ if (WINDOW_WANTS_MODELINE_P (w))