From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Martin Fredriksson Newsgroups: gmane.emacs.devel Subject: Re: window.c: suggested patch window_scroll_pixel_based Date: Tue, 31 Dec 2002 07:27:10 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v551) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1041316544 11794 80.91.224.249 (31 Dec 2002 06:35:44 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 31 Dec 2002 06:35:44 +0000 (UTC) Cc: 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 18TG06-000345-00 for ; Tue, 31 Dec 2002 07:35:42 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18TG18-0006a9-00 for ; Tue, 31 Dec 2002 07:36:46 +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 18TFwK-0008Ju-04 for emacs-devel@quimby.gnus.org; Tue, 31 Dec 2002 01:31:48 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18TFvq-000813-00 for emacs-devel@gnu.org; Tue, 31 Dec 2002 01:31:18 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18TFtm-0006Hw-00 for emacs-devel@gnu.org; Tue, 31 Dec 2002 01:29:12 -0500 Original-Received: from nic.crt.se ([193.12.107.10]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18TFrX-0004lF-00; Tue, 31 Dec 2002 01:26:51 -0500 Original-Received: from mail.crt.se (postiljon.crt.se [172.16.1.14]) by nic.crt.se (Postfix) with ESMTP id 519DC52BA; Tue, 31 Dec 2002 07:26:49 +0100 (MET) Original-Received: from crt.se (stargate.crt.se [172.16.0.11]) by mail.crt.se (Postfix) with ESMTP id CBB8F1DF6; Tue, 31 Dec 2002 07:26:48 +0100 (MET) Original-To: rms@gnu.org In-Reply-To: X-Mailer: Apple Mail (2.551) 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:10380 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10380 On m=E5ndag, dec 30, 2002, at 16:27 Europe/Stockholm, Richard Stallman=20= wrote: > I suggest following patch to window.c (window_scroll_pixel_based),=20= > to > make 'scroll-down' be able to reach the start of the buffer. This > patch partly backs out of 1.433 (rms, 2002/12/23). I apologize if=20= > I > have misunderstood the issue. I have verified the patch on=20 > OpenBSD/X11 > and OSX/Carbon. > > This problem does not happen for me, and your change reintroduces code > that seems to be entirely wrong as far as I can tell. Why do you > think it is right to test `start' here? It appears to me that BEGV > is correct. Line 4151--4152: if ((n > 0 && IT_CHARPOS (it) =3D=3D ZV) || (n < 0 && IT_CHARPOS (it) =3D=3D BEGV)) The comparison with ZV seems to be correct since the function 'move_it_to' (called on line 4144) never sets IT_CHARPOS(it) to ZV unless ZV is visible in the same window. For backwards movement, however, the function 'move_it_vertically_backword' (called on line 4142) sets IT_CHARPOS(it) to BEGV when BEGV is less than a screenfull from current position (as it should). The comparison "IT_CHARPOS(it) =3D=3D BEGV" now becomes true, and the move is aborted (with Fsignal(Qbeginning_of_buffer), even though IT_CHARPOS(it) is not visible. Since the window is not set until 'set_marker_restricted', etc, is called on line 4196--, the result is that the window is not scrolled as it should be. I believe that it is correct to test IT_CHARPOS(it) =3D=3D = CHARPOS(start) instead, since that is true when the scroll should not be done (when the new start position is the same as the current). =46rom what I can see = and understand, it is perfectly ok for IT_CHARPOS(it) =3D=3D BEGV, and = scrolling should still be done. Note that I've only tested with scroll_preserve_screen_position non-zero. I do not know if that complicates things. I must admit I have a hard time understanding all the issues involved here. /m