From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: The unwarranted scrolling assumption Date: Sat, 19 Jun 2010 17:03:46 +0300 Message-ID: <837hlvglvh.fsf@gnu.org> References: <87631jvpzg.fsf@gmail.com> <4C18211C.3070106@harpegolden.net> <87vd9j5neu.fsf@kfs-lx.rd.rdm> <83sk4misf2.fsf@gnu.org> <83iq5hiiin.fsf@gnu.org> <83fx0lihov.fsf@gnu.org> <838w6cixma.fsf@gnu.org> <83y6ech1oo.fsf@gnu.org> <83ocf8gx7e.fsf@gnu.org> <83fx0jgxk7.fsf@gnu.org> <83eig3gspa.fsf@gnu.org> <83bpb7gp2g.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: dough.gmane.org 1276956374 8889 80.91.229.12 (19 Jun 2010 14:06:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 19 Jun 2010 14:06:14 +0000 (UTC) Cc: cyd@stupidchicken.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Lennart Borgman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 19 16:06:12 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OPygV-0003Q9-8D for ged-emacs-devel@m.gmane.org; Sat, 19 Jun 2010 16:06:11 +0200 Original-Received: from localhost ([127.0.0.1]:59979 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPygU-0005BD-Pz for ged-emacs-devel@m.gmane.org; Sat, 19 Jun 2010 10:06:10 -0400 Original-Received: from [140.186.70.92] (port=45006 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPygO-0005B5-MI for emacs-devel@gnu.org; Sat, 19 Jun 2010 10:06:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OPygN-0000lc-4Y for emacs-devel@gnu.org; Sat, 19 Jun 2010 10:06:04 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:34753) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OPygM-0000lO-Rq for emacs-devel@gnu.org; Sat, 19 Jun 2010 10:06:03 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0L4900500LMOF500@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Sat, 19 Jun 2010 17:05:49 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.228.178.198]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L49005KKLTO8510@a-mtaout21.012.net.il>; Sat, 19 Jun 2010 17:05:49 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:126214 Archived-At: > From: Lennart Borgman > Date: Sat, 19 Jun 2010 15:00:37 +0200 > Cc: monnier@iro.umontreal.ca, cyd@stupidchicken.com, emacs-devel@gn= u.org >=20 > On Sat, Jun 19, 2010 at 2:54 PM, Eli Zaretskii wrote= : > > > > Update: with revno 100620, I can no longer get Emacs to recenter = by > > pressing and holding the arrow key, unless bidi-display-re= ordering > > is non-nil. =C2=A0The latter is probably due to some bug in curso= r positioning > > in set_cursor_from_row and display_line, under bidirectional disp= lay; I > > will look into that next. > > > > So please try the latest trunk and see if Emacs still recenters s= ometimes. >=20 > Can you please instead show your patch here? Here: =3D=3D=3D modified file 'src/ChangeLog' --- src/ChangeLog=092010-06-16 20:08:41 +0000 +++ src/ChangeLog=092010-06-19 09:39:37 +0000 @@ -1,3 +1,13 @@ +2010-06-19 Eli Zaretskii + +=09* xdisp.c (try_scrolling): Compute the limit for searching point +=09in forward scroll from scroll_max, instead of an arbitrary limit +=09of 10 screen lines. See +=09http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00766.ht= ml +=09and +=09http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00773.ht= ml +=09for details. + 2010-06-16 Glenn Morris =20 =09* editfns.c (Fbyte_to_string): Pacify compiler. =3D=3D=3D modified file 'src/xdisp.c' --- src/xdisp.c=092010-06-01 02:34:49 +0000 +++ src/xdisp.c=092010-06-19 11:55:00 +0000 @@ -13431,14 +13431,22 @@ try_scrolling (window, just_this_one_p,= =20 if (PT > CHARPOS (it.current.pos)) =09{ =09 int y0 =3D line_bottom_y (&it); - -=09 /* Compute the distance from the scroll margin to PT -=09 (including the height of the cursor line). Moving the -=09 iterator unconditionally to PT can be slow if PT is far -=09 away, so stop 10 lines past the window bottom (is there a -=09 way to do the right thing quickly?). */ -=09 move_it_to (&it, PT, -1, -=09 =09 it.last_visible_y + 10 * FRAME_LINE_HEIGHT (f), +=09 /* Compute how many pixels below window bottom to stop searchin= g +=09 for PT. This avoids costly search for PT that is far away i= f +=09 the user limited scrolling by a small number of lines, but +=09 always finds PT if scroll_conservatively is set to a large +=09 number, such as most-positive-fixnum. */ +=09 int slack =3D max (scroll_max, 10 * FRAME_LINE_HEIGHT (f)); +=09 int y_to_move =3D +=09 slack >=3D INT_MAX - it.last_visible_y +=09 ? INT_MAX +=09 : it.last_visible_y + slack; + +=09 /* Compute the distance from the scroll margin to PT or to +=09 the scroll limit, whichever comes first. This should +=09 include the height of the cursor line, to make that line +=09 fully visible. */ +=09 move_it_to (&it, PT, -1, y_to_move, =09 =09 -1, MOVE_TO_POS | MOVE_TO_Y); =09 dy =3D line_bottom_y (&it) - y0; =20