emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Infinite loop in xdisp.c (try_scrolling)


From: Ralf Angeli
Subject: Re: Infinite loop in xdisp.c (try_scrolling)
Date: Mon, 08 Dec 2003 12:11:12 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

* Ralf Angeli (2003-12-06) writes:

> The problem is an inifite loop in the function `try_scrolling' in
> `xdisp.c'.  You can find my bug report and the following discussion in
> the archive¹ of this mailing list.
>
> There was some private mail exchange as well and I got a patch for the
> version of `xdisp.c' back then from Gerd Moellmann which prevents the
> infinite loop from happening but makes scrolling quite erratic.  If
> somebody is interested, I can post it here.  After I received the
> patch the discussion stopped unfortunately.

So here is the patch from Gerd Moellmann in case somebody likes to
have a look at the problem:

--8<---------------cut here---------------start------------->8---
--- xdisp.c.~1.848.~    Sat Sep 13 22:03:07 2003
+++ xdisp.c     Sat Sep 27 17:09:30 2003
@@ -10770,7 +10770,7 @@
   int amount_to_scroll = 0;
   Lisp_Object aggressive;
   int height;
-  int end_scroll_margin;
+  int extra_scroll_margin_lines = last_line_misfit ? 1 : 0;
 
 #if GLYPH_DEBUG
   debug_method_add (w, "try_scrolling");
@@ -10813,11 +10813,13 @@
   CHARPOS (scroll_margin_pos) = XINT (window_end);
   BYTEPOS (scroll_margin_pos) = CHAR_TO_BYTE (CHARPOS (scroll_margin_pos));
 
-  end_scroll_margin = this_scroll_margin + !!last_line_misfit;
-  if (end_scroll_margin)
+  if (this_scroll_margin || extra_scroll_margin_lines)
     {
       start_display (&it, w, scroll_margin_pos);
-      move_it_vertically (&it, - end_scroll_margin);
+      if (this_scroll_margin)
+       move_it_vertically (&it, - this_scroll_margin);
+      if (extra_scroll_margin_lines)
+       move_it_by_lines (&it, - extra_scroll_margin_lines, 0);
       scroll_margin_pos = it.current.pos;
     }
 
@@ -10955,7 +10957,7 @@
       if (! make_cursor_line_fully_visible (w))
        {
          clear_glyph_matrix (w->desired_matrix);
-         last_line_misfit = 1;
+         ++extra_scroll_margin_lines;
          goto too_near_end;
        }
       rc = SCROLLING_SUCCESS;
--8<---------------cut here---------------end--------------->8---

Regards,
Ralf





reply via email to

[Prev in Thread] Current Thread [Next in Thread]