src/xdisp.c (redisplay_window): Don't try to determine the character
position of the scroll margin if the window start point w->startp
is outside the buffer's accessible region.
+2011-04-11 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (redisplay_window): Don't try to determine the character
+ position of the scroll margin if the window start point w->startp
+ is outside the buffer's accessible region.
+
2011-03-30 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (syms_of_xdisp) <scroll-conservatively>: Document the
/* If there is a scroll margin at the top of the window, find
its character position. */
- if (margin)
+ if (margin
+ /* Cannot call start_display if startp is not in the
+ accessible region of the buffer. This can happen when we
+ have just switched to a different buffer and/or changed
+ its restriction. In that case, startp is initialized to
+ the character position 1 (BEG) because we did not yet
+ have chance to display the buffer even once. */
+ && BEGV <= CHARPOS (startp) && CHARPOS (startp) <= ZV)
{
struct it it1;