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: set-window-vscroll causes infinite loop in redisplay Date: 24 Feb 2003 02:31:54 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <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 1046047100 6290 80.91.224.249 (24 Feb 2003 00:38:20 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 24 Feb 2003 00:38:20 +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 18n6dO-0001dI-00 for ; Mon, 24 Feb 2003 01:38:18 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18n6sb-0006AS-00 for ; Mon, 24 Feb 2003 01:54:01 +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 18n6bF-00080R-02 for emacs-devel@quimby.gnus.org; Sun, 23 Feb 2003 19:36:05 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18n6Ze-0007R5-00 for emacs-devel@gnu.org; Sun, 23 Feb 2003 19:34:26 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18n6Yk-00071l-00 for emacs-devel@gnu.org; Sun, 23 Feb 2003 19:33:32 -0500 Original-Received: from mail.filanet.dk ([195.215.206.179]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18n6YE-0006nQ-00 for emacs-devel@gnu.org; Sun, 23 Feb 2003 19:32:58 -0500 Original-Received: from kfs2.cua.dk.cua.dk (unknown [10.1.82.3]) by mail.filanet.dk (Postfix) with SMTP id 2C7507C017 for ; Mon, 24 Feb 2003 01:32:51 +0100 (CET) Original-To: emacs-devel@gnu.org Original-Lines: 50 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:11888 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:11888 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. */