[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: set-window-vscroll causes infinite loop in redisplay
From: |
Kim F. Storm |
Subject: |
Re: set-window-vscroll causes infinite loop in redisplay |
Date: |
24 Feb 2003 16:47:34 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
address@hidden (Kim F. Storm) writes:
> 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.
I think the following fix is slightly better -- it retries the
recenter if vscroll was enabled. But it probably doesn't make much
visible difference...
Index: xdisp.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xdisp.c,v
retrieving revision 1.807
diff -c -r1.807 xdisp.c
*** xdisp.c 24 Feb 2003 07:57:55 -0000 1.807
--- xdisp.c 24 Feb 2003 14:46:05 -0000
***************
*** 10822,10827 ****
--- 10822,10835 ----
if (!make_cursor_line_fully_visible (w))
{
+ /* If vscroll is enabled, disable it and try again. */
+ if (w->vscroll)
+ {
+ w->vscroll = 0;
+ clear_glyph_matrix (w->desired_matrix);
+ goto recenter;
+ }
+
/* 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. */
--
Kim F. Storm <address@hidden> http://www.cua.dk