From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#16526: 24.3.50; scroll-conservatively & c-mode regression Date: Mon, 27 Jan 2014 09:20:57 +0100 Message-ID: <52E616E9.2040807@gmx.at> References: <52E38286.1050306@gmx.at> <838uu4cq11.fsf@gnu.org> <52E3D131.2090705@gmx.at> <83r47wausm.fsf@gnu.org> <52E3EAC2.2040100@gmx.at> <83lhy4as2l.fsf@gnu.org> <52E4019C.5080905@gmx.at> <83k3dnc3rl.fsf@gnu.org> <83iot7c3bq.fsf@gnu.org> <52E4EF61.3050404@gmx.at> <831tzubqxw.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1390810948 12811 80.91.229.3 (27 Jan 2014 08:22:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Jan 2014 08:22:28 +0000 (UTC) Cc: acm@muc.de, 16526@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 27 09:22:33 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W7hSj-0006MP-4o for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Jan 2014 09:22:33 +0100 Original-Received: from localhost ([::1]:58294 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7hSi-0007Oi-NT for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Jan 2014 03:22:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7hSX-0007Gh-Tq for bug-gnu-emacs@gnu.org; Mon, 27 Jan 2014 03:22:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7hSP-0003hT-Mj for bug-gnu-emacs@gnu.org; Mon, 27 Jan 2014 03:22:21 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7hSF-0003fc-2A; Mon, 27 Jan 2014 03:22:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W7hSE-0006Xs-R8; Mon, 27 Jan 2014 03:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 27 Jan 2014 08:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16526 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 16526-submit@debbugs.gnu.org id=B16526.139081087425050 (code B ref 16526); Mon, 27 Jan 2014 08:22:02 +0000 Original-Received: (at 16526) by debbugs.gnu.org; 27 Jan 2014 08:21:14 +0000 Original-Received: from localhost ([127.0.0.1]:37322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7hRR-0006Vx-5A for submit@debbugs.gnu.org; Mon, 27 Jan 2014 03:21:13 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:58921) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7hRJ-0006Vh-Lq for 16526@debbugs.gnu.org; Mon, 27 Jan 2014 03:21:11 -0500 Original-Received: from [62.47.55.74] ([62.47.55.74]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0Lx83d-1VFD690rTV-016i6b for <16526@debbugs.gnu.org>; Mon, 27 Jan 2014 09:21:04 +0100 In-Reply-To: <831tzubqxw.fsf@gnu.org> X-Provags-ID: V03:K0:NHyLfS8WovNijuKRgmq1RaxgGkzSKHeOYav5bMDn3LwM+Q6pNas 3Dhary5VyIoVRSKQTE2pTG8aXbWaLUSkspdM2PxEa0pLDA8n/viZyfioq/TB3VGLOf5FxDP iiKm0k7fpviwRAovRNtIN5r2xCqQPVwh86pydz2FljzZeKW4m4ZfVq3CFBkvunkDOqRiQtk cGjww0rNossO+ylorapsg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:84095 Archived-At: > After beginning-of-buffer jumps to point-min, redisplay kicks in. > Since scroll-conservatively is set to a large value, redisplay first > tries to see whether it can bring point into view by scrolling the > window as little as possible. It calls try_scrolling, which at some > point (around line 15000) tries to see whether the new location of > point is close enough to the current window start. It does so by > calling move_it_to, which simulates the display. While doing so, > move_it_to hits a portion of text with font-lock properties, and calls > JIT Lock to fontify them. Well... try_scrolling could detect that `point' is some 15000 lines away from the current window start so trying to scroll the window as little as possible might not be worth the effort. > And here's where things go awry: For some reason, the CC Mode > fontification code decides it needs to scan the buffer backwards, > starting from EOB. So it goes temporarily to EOB (this is why I saw > point being there), and scans all the way back, I think in this loop > from c-append-lower-brace-pair-to-state-cache, which is called with > its first argument FROM set to EOB: But it's redisplay which temporarily puts `point' at EOB and triggers the fontification subsystem to "work" at that position? > This loop takes a lot of time, of course, and is a waste of time, > since eventually try_scrolling comes to the correct conclusion that > scrolling is impossible, and instead recenters at BOB. Are you sure that try_scrolling doesn't call this loop over and over again? > Why does CC Mode decide to go from EOB backwards, I don't know; > presumably, this is decided by c-parse-state-get-strategy as part of > c-parse-state-1. This seems obvious. To decide whether code shall be fontified this way or another it has to decide whether the code is part of a comment and find that comment's start. As long as it is not aware of the fact that `point' is already at BOB, obviously. martin