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: Fri, 18 Jun 2010 18:46:45 +0300 Message-ID: <83ocf8gx7e.fsf@gnu.org> References: <87ocfcj7r4.fsf@mail.jurta.org> <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> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1276876080 2032 80.91.229.12 (18 Jun 2010 15:48:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 18 Jun 2010 15:48:00 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 18 17:47:56 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 1OPdnJ-00044i-9f for ged-emacs-devel@m.gmane.org; Fri, 18 Jun 2010 17:47:49 +0200 Original-Received: from localhost ([127.0.0.1]:42211 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPdnI-0000yG-K7 for ged-emacs-devel@m.gmane.org; Fri, 18 Jun 2010 11:47:48 -0400 Original-Received: from [140.186.70.92] (port=36390 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPdnB-0000rF-FK for emacs-devel@gnu.org; Fri, 18 Jun 2010 11:47:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OPdnA-0005t8-1H for emacs-devel@gnu.org; Fri, 18 Jun 2010 11:47:41 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:43459) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OPdn9-0005t0-Qz for emacs-devel@gnu.org; Fri, 18 Jun 2010 11:47:40 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0L4700800VTGMH00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Fri, 18 Jun 2010 18:47:15 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.127.88.125]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L47008FGVUOF210@a-mtaout20.012.net.il>; Fri, 18 Jun 2010 18:47:13 +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:126182 Archived-At: > From: Stefan Monnier > Cc: lennart.borgman@gmail.com, emacs-devel@gnu.org > Date: Fri, 18 Jun 2010 11:11:27 -0400 > > > . When try_window, called by try_scrolling, fails to find a proper > > place for cursor, after scrolling the window. This means that the > > computed amount of scroll was incorrect: it didn't bring point into > > the view. Not sure when this could happen. > > This case sounds like the culprit. I don't think so; this is just a generic "fire escape". I think the place to look is here: /* Compute the distance from the scroll margin to PT (including the height of the cursor line). Moving the iterator unconditionally to PT can be slow if PT is far away, so stop 10 lines past the window bottom (is there a way to do the right thing quickly?). */ move_it_to (&it, PT, -1, it.last_visible_y + 10 * FRAME_LINE_HEIGHT (f), -1, MOVE_TO_POS | MOVE_TO_Y); dy = line_bottom_y (&it) - y0; According to my reading, it stops the search for point if it is more than 10 lines below (resp above) the scroll margin. The reason is speed, as the comment says. Can we safely assume that whoever sets scroll-conservatively to the maximum value gives up this speed consideration? Or maybe we should have another option to replace the hard-coded value of 10?