* lisp/emacs-lisp/cl-macs.el (cl-transform-lambda): Don't add spurious
[bpt/emacs.git] / src / window.c
index af7968f..048779d 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
@@ -5945,6 +5950,8 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
            }
          else
            p->pointm = Fcopy_marker (w->pointm, Qnil);
+         XMARKER (p->pointm)->insertion_type
+           = !NILP (Vwindow_point_insertion_type);
 
          p->start = Fcopy_marker (w->start, Qnil);
          p->start_at_line_beg = w->start_at_line_beg;