]> code.delx.au - gnu-emacs/blobdiff - src/window.c
Merge changes from emacs-24 branch
[gnu-emacs] / src / window.c
index 1f27cba444b0fad2e64f27aa85d943fd3e37a332..048779d683087a112fc595419108c3388b54f7e6 100644 (file)
@@ -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