]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid infloop when scrolling conservatively (Bug#7537).
authorChong Yidong <cyd@stupidchicken.com>
Sun, 5 Dec 2010 00:32:32 +0000 (19:32 -0500)
committerChong Yidong <cyd@stupidchicken.com>
Sun, 5 Dec 2010 00:32:32 +0000 (19:32 -0500)
* src/xdisp.c (try_scrolling): Avoid infloop if the first line is obscured
due to a vscroll (Bug#7537).

src/ChangeLog
src/xdisp.c

index 025161cc3959325ff0b1c47cd0ef22a3a69fbbc4..95f7039eaf765fd9ca5b9d5cbb86fa8b78532e54 100644 (file)
@@ -1,3 +1,8 @@
+2010-12-05  Chong Yidong  <cyd@stupidchicken.com>
+
+       * xdisp.c (try_scrolling): Avoid infloop if the first line is
+       obscured due to a vscroll (Bug#7537).
+
 2010-12-02  Jan Djärv  <jhd@zeplinf.localdomain>
 
        * nsterm.h (FRAME_NS_TOOLBAR_HEIGHT): Rename to FRAME_TOOLBAR_HEIGHT.
index a416c8ff43504441b7930812b0fbb9f11d4830f6..dbe3e443c67d01518280f52d6117dbfef96c6458 100644 (file)
@@ -12759,7 +12759,11 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
 
       /* If cursor ends up on a partially visible line,
         treat that as being off the bottom of the screen.  */
-      if (! cursor_row_fully_visible_p (w, extra_scroll_margin_lines <= 1, 0))
+      if (! cursor_row_fully_visible_p (w, extra_scroll_margin_lines <= 1, 0)
+         /* It's possible that the cursor is on the first line of the
+            buffer, which is partially obscured due to a vscroll
+            (Bug#7537).  In that case, avoid looping forever . */
+         && extra_scroll_margin_lines < w->desired_matrix->nrows - 1)
        {
          clear_glyph_matrix (w->desired_matrix);
          ++extra_scroll_margin_lines;