From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#6671: moving point and scroll-conservatively Date: Wed, 23 Mar 2011 23:58:27 -0400 Message-ID: <87tyetb258.fsf@stupidchicken.com> References: <87vcz9s60m.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1300939642 32287 80.91.229.12 (24 Mar 2011 04:07:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 24 Mar 2011 04:07:22 +0000 (UTC) Cc: 6671@debbugs.gnu.org To: Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 24 05:07:16 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Q2bpK-0008Kp-RS for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Mar 2011 05:07:15 +0100 Original-Received: from localhost ([127.0.0.1]:38805 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2bpJ-0002Ri-Sj for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Mar 2011 00:07:13 -0400 Original-Received: from [140.186.70.92] (port=42152 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2bpE-0002RX-2i for bug-gnu-emacs@gnu.org; Thu, 24 Mar 2011 00:07:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2bpC-0004d7-T3 for bug-gnu-emacs@gnu.org; Thu, 24 Mar 2011 00:07:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2bpC-0004d1-MR for bug-gnu-emacs@gnu.org; Thu, 24 Mar 2011 00:07:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Q2bhN-000250-SG; Wed, 23 Mar 2011 23:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Mar 2011 03:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6671 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6671-submit@debbugs.gnu.org id=B6671.13009391167955 (code B ref 6671); Thu, 24 Mar 2011 03:59:01 +0000 Original-Received: (at 6671) by debbugs.gnu.org; 24 Mar 2011 03:58:36 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q2bgw-00024G-Sz for submit@debbugs.gnu.org; Wed, 23 Mar 2011 23:58:35 -0400 Original-Received: from vm-emlprdomr-05.its.yale.edu ([130.132.50.146]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q2bgv-000243-Nn for 6671@debbugs.gnu.org; Wed, 23 Mar 2011 23:58:34 -0400 Original-Received: from furball (dhcp128036014081.central.yale.edu [128.36.14.81]) (authenticated bits=0) by vm-emlprdomr-05.its.yale.edu (8.14.4/8.14.4) with ESMTP id p2O3wSKQ006811 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 23 Mar 2011 23:58:28 -0400 Original-Received: by furball (Postfix, from userid 1000) id D7AAF1607C6; Wed, 23 Mar 2011 23:58:27 -0400 (EDT) In-Reply-To: (Juanma Barranquero's message of "Thu, 24 Mar 2011 03:07:18 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Scanned-By: MIMEDefang 2.71 on 130.132.50.146 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 23 Mar 2011 23:59:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:45308 Archived-At: Juanma Barranquero writes: >> Is the "unintended recentering" problem purely associated with the >> commands next-line and previous-line? > > Other scrolling commands, like scroll-up-command, do respect > scroll-preserve-scroll-position and do not cause unexpected > recentering, though their performance isn't currently very good (try > keeping PgDn pressed in xdisp.c...). OK. After playing around with the "C-n in xdisp.c" testcase with the changes in revision 100619/100620 reverted, I think I know the problem. In this test case, recentering seems to be triggered by redisplay-time fontification. To demonstrat this, set fontification-functions to nil in xdisp.c, before initiating the C-n testcase. For me, at least, the anomalous recentering then does not occur. The precise mechanism by which the fontification functions screw things up is by narrowing the buffer. This is why, in last year's thread, the buffer's clip_changed flag was found to be set. That forces recentering in redisplay_window (xdisp.c:14159). So, a good fix might be to check whether redisplay-time fontification changes the buffer's restrictions, and, if so, reset the clip_changed flag. That should make the 100619/100620 changes unnecessary.