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: Redisplay bug Date: 26 Aug 2002 01:10:51 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <5xy9auwn44.fsf@kfs2.cua.dk> References: <200208182145.QAA02935@eel.dms.auburn.edu> <5xit27g2hm.fsf@kfs2.cua.dk> <200208191839.g7JIdO409401@wijiji.santafe.edu> <5xu1lq2y04.fsf@kfs2.cua.dk> <5xlm6yzp3b.fsf@kfs2.cua.dk> <200208241211.g7OCBeh11786@wijiji.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1030313507 11678 127.0.0.1 (25 Aug 2002 22:11:47 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 25 Aug 2002 22:11:47 +0000 (UTC) Cc: schwab@suse.de, teirllm@dms.auburn.edu, deego@glue.umd.edu, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17j5bm-00032F-00 for ; Mon, 26 Aug 2002 00:11:46 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17j66J-0007tE-00 for ; Mon, 26 Aug 2002 00:43:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17j5d4-0005YM-00; Sun, 25 Aug 2002 18:13:06 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17j5aX-0005QY-00 for emacs-devel@gnu.org; Sun, 25 Aug 2002 18:10:29 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17j5aV-0005QM-00 for emacs-devel@gnu.org; Sun, 25 Aug 2002 18:10:29 -0400 Original-Received: from mail.filanet.dk ([195.215.206.179]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17j5aV-0005QG-00; Sun, 25 Aug 2002 18:10:27 -0400 Original-Received: from kfs2.cua.dk.cua.dk (unknown [10.1.82.3]) by mail.filanet.dk (Postfix) with SMTP id AD7947C017; Sun, 25 Aug 2002 22:10:25 +0000 (GMT) Original-To: rms@gnu.org In-Reply-To: <200208241211.g7OCBeh11786@wijiji.santafe.edu> Original-Lines: 82 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6877 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6877 Richard Stallman writes: > I found a specific part of Richard's change to xdisp.c which seems > to cause the redisplay problem, so I have reverted that change. > > But now the redisplay again has a habit of leaving the cursor on > partially visible lines at the top or bottom of the window (which > I believe is what Richard tried to fix). > > Of course. Reverting that part of the change shows you found the > right place, but it is not the right fix. > > Can you show me which change it was? Here is the change I made. Only one line of code with a large comment on why I changed this. Hope it is enough for you to work on. Index: xdisp.c =================================================================== RCS file: /cvs/emacs/src/xdisp.c,v retrieving revision 1.776 retrieving revision 1.777 diff -c -r1.776 -r1.777 *** xdisp.c 9 Aug 2002 17:29:11 -0000 1.776 --- xdisp.c 22 Aug 2002 16:52:56 -0000 1.777 *************** *** 10365,10371 **** } if (!make_cursor_line_fully_visible (w)) ! goto try_to_scroll; #if GLYPH_DEBUG debug_method_add (w, "forced window start"); #endif --- 10365,10408 ---- } if (!make_cursor_line_fully_visible (w)) ! { ! /* CVS rev. 1.761 had changed this to ``goto try_to_scroll''. ! ! The intention of the fix -- AFAIU -- was to ensure that ! the cursor didn't end up on a partially visible last (or ! first?) line when scrolling. ! ! ! But that change causes havoc when scrolling backwards and ! a partially visible first (or last?) line is present when ! we reach the top of the buffer. In effect, the text ! already in the window is repeated (each line is appended ! to the same or another lines in the window)... ! ! I changed it back to ``goto need_larger_matrices'' which ! in effect mean that we don't go through `try_scrolling' ! when the cursor is already at the first line of the buffer, ! and there is really only a few pixels [rather than lines] ! to scroll backwards. I guess move_it_by_lines etc. really ! isn't the right device for doing that, ref. the code in ! make_cursor_line_fully_visible which was also disabled by ! CVS rev. 1.761. ! ! But how do we know that we are already on the top line of ! the window showing the first line in the buffer, so that ! scrolling really wont help here? ! ! I cannot find a simple fix for this (I tried various ! approaches), but I prefer to an occasional partial line ! rather than the visual messup, so I reverted this part of ! the fix. ! ! Someone will need to look into this when time allows. ! ! -- 2002-08-22, Kim F. Storm */ ! ! goto need_larger_matrices; ! } #if GLYPH_DEBUG debug_method_add (w, "forced window start"); #endif -- Kim F. Storm http://www.cua.dk