From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#16526: 24.3.50; scroll-conservatively & c-mode regression Date: Sun, 29 Jun 2014 14:41:51 +0000 Message-ID: <20140629144151.GD2948__19016.1642771729$1404053258$gmane$org@acm.acm> References: <20140628130059.GA4144@acm.acm> <53AECA88.7010401@gmx.at> <20140628145509.GB4144@acm.acm> <53AFD1FA.5010201@gmx.at> <20140629091757.GA2948@acm.acm> <53AFE536.7010407@gmx.at> <20140629124829.GC2948@acm.acm> <53B02042.1050107@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1404053258 22526 80.91.229.3 (29 Jun 2014 14:47:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 29 Jun 2014 14:47:38 +0000 (UTC) Cc: 16526-done@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 29 16:47:30 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 1X1GO7-0001yg-SQ for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Jun 2014 16:47:28 +0200 Original-Received: from localhost ([::1]:57921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1GO7-0008W2-HJ for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Jun 2014 10:47:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1GNx-0008Vw-PF for bug-gnu-emacs@gnu.org; Sun, 29 Jun 2014 10:47:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1GNq-0005Lr-8v for bug-gnu-emacs@gnu.org; Sun, 29 Jun 2014 10:47:17 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1GNi-0005KF-DG; Sun, 29 Jun 2014 10:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X1GNi-0006cY-0h; Sun, 29 Jun 2014 10:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sun, 29 Jun 2014 14:47:01 +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-done@debbugs.gnu.org id=D16526.140405318925388 (code D ref 16526); Sun, 29 Jun 2014 14:47:01 +0000 Original-Received: (at 16526-done) by debbugs.gnu.org; 29 Jun 2014 14:46:29 +0000 Original-Received: from localhost ([127.0.0.1]:36895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X1GNA-0006bP-Cd for submit@debbugs.gnu.org; Sun, 29 Jun 2014 10:46:28 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:13777 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X1GN5-0006b9-M8 for 16526-done@debbugs.gnu.org; Sun, 29 Jun 2014 10:46:24 -0400 Original-Received: (qmail 54442 invoked by uid 3782); 29 Jun 2014 14:46:21 -0000 Original-Received: from acm.muc.de (pD9518149.dip0.t-ipconnect.de [217.81.129.73]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 29 Jun 2014 16:46:20 +0200 Original-Received: (qmail 32193 invoked by uid 1000); 29 Jun 2014 14:41:51 -0000 Content-Disposition: inline In-Reply-To: <53B02042.1050107@gmx.at> User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de 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:90962 Archived-At: On Sun, Jun 29, 2014 at 04:18:42PM +0200, martin rudalics wrote: > > As I suggested yesterday, what is needed is for find_defun_start to > > actually determine the beginning-of-defun before POS/POS_BYTE (using > > scan_sexps_forward) rather than just giving up and returning BOB. > > This position must then be cached for future find_defun_start calls. > > The cacheing mechanism is already in place for non-nil open-...-start. > I don't even understand why you can't use the 9th element returned by > `syntax-ppss' to get the beginning of the outermost defun enclosing > `point'. scan-lists, a primitive, must be utterly robust. syntax-ppss is too fragile to be used here without a lot of hardening. syntax-ppss's cache is rendered invalid at any operation which changes the syntax table (e.g. `modify-syntax-entry'), or changes to a different syntax table (e.g. `with-syntax-table'), or when a syntax-table text property/overlay is applied to the buffer, or even when a symbol's property list is changed when that symbol is the value of a category text property. CC Mode does all these things, and does all of them apart from the first during run time, not merely at mode initialisation. Also, the syntax-ppss cache's functioning is dependent upon before-change-functions, which can be bound to nil by any program at any time. If one were to harden syntax-ppss against all these things, one would probably end up calculating the cache from scratch every time, in effect. scan-lists is a primitive, and must function correctly regardless of any trickery which might be played on it. > martin -- Alan Mackenzie (Nuremberg, Germany).