From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: set-window-vscroll causes infinite loop in redisplay Date: 24 Feb 2003 16:47:34 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <5xsmudr889.fsf@kfs2.cua.dk> References: <5xheauqx9x.fsf@kfs2.cua.dk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1046098299 26308 80.91.224.249 (24 Feb 2003 14:51:39 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 24 Feb 2003 14:51:39 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18nJxA-0006pv-00 for ; Mon, 24 Feb 2003 15:51:36 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18nKCf-0005r2-00 for ; Mon, 24 Feb 2003 16:07:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18nJvs-0003Oc-02 for emacs-devel@quimby.gnus.org; Mon, 24 Feb 2003 09:50:16 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18nJuX-00031S-00 for emacs-devel@gnu.org; Mon, 24 Feb 2003 09:48:53 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18nJuD-0002Zs-00 for emacs-devel@gnu.org; Mon, 24 Feb 2003 09:48:38 -0500 Original-Received: from mail.filanet.dk ([195.215.206.179]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18nJuB-0002V2-00 for emacs-devel@gnu.org; Mon, 24 Feb 2003 09:48:31 -0500 Original-Received: from kfs2.cua.dk.cua.dk (kfs2.local.filanet.dk [192.168.1.182]) by mail.filanet.dk (Postfix) with SMTP id 7228A7C017 for ; Mon, 24 Feb 2003 15:48:30 +0100 (CET) Original-To: emacs-devel@gnu.org In-Reply-To: <5xheauqx9x.fsf@kfs2.cua.dk> Original-Lines: 59 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:11912 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:11912 storm@cua.dk (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 http://www.cua.dk