emacs-devel
[Top][All Lists]
Advanced

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

set-window-vscroll causes infinite loop in redisplay


From: Kim F. Storm
Subject: set-window-vscroll causes infinite loop in redisplay
Date: 24 Feb 2003 02:31:54 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

This is with CVS head on GNU/Linux under X.

1) start emacs

emacs -q

2) get rid of splash screen

RET

3) In scratch buffer, enter:

(set-window-vscroll nil 0.5) C-j

4) (try to) move cursor to the first (partially visible) line.

C-p C-p C-p C-p C-p C-p C-p C-p

5) emacs loops.



The following patch fixes this.  I'll install it tomorrow unless
someone finds a better fix.

Index: xdisp.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xdisp.c,v
retrieving revision 1.806
diff -c -r1.806 xdisp.c
*** xdisp.c     18 Feb 2003 00:17:17 -0000      1.806
--- xdisp.c     24 Feb 2003 00:31:05 -0000
***************
*** 10821,10826 ****
--- 10821,10834 ----
  
    if (!make_cursor_line_fully_visible (w))
      {
+       /* If vscroll is non-zero, and the cursor is on the top line,
+        disable vscroll, and retry. */
+       if (w->vscroll < 0 && w->cursor.y < 0)
+       {
+         w->vscroll = 0;
+         clear_glyph_matrix (w->desired_matrix);
+       }
+ 
        /* If centering point failed to make the whole line visible,
         put point at the top instead.  That has to make the whole line
         visible, if it can be done.  */





reply via email to

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