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 12:48:29 +0000 Message-ID: <20140629124829.GC2948@acm.acm> References: <20140627203416.GA4395@acm.acm> <20140628130059.GA4144@acm.acm> <53AECA88.7010401@gmx.at> <20140628145509.GB4144@acm.acm> <53AFD1FA.5010201@gmx.at> <20140629091757.GA2948@acm.acm> <53AFE536.7010407@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1404046476 17675 80.91.229.3 (29 Jun 2014 12:54:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 29 Jun 2014 12:54:36 +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 14:54:29 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 1X1Ecm-0003v6-4s for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Jun 2014 14:54:28 +0200 Original-Received: from localhost ([::1]:57610 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1Ecl-0006dA-Qp for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Jun 2014 08:54:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1Ecc-0006d3-5M for bug-gnu-emacs@gnu.org; Sun, 29 Jun 2014 08:54:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1EcU-0002xy-Ku for bug-gnu-emacs@gnu.org; Sun, 29 Jun 2014 08:54:18 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1EcM-0002xB-Og; Sun, 29 Jun 2014 08:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X1EcL-0003LB-WB; Sun, 29 Jun 2014 08:54: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 12:54: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.140404638612761 (code D ref 16526); Sun, 29 Jun 2014 12:54:01 +0000 Original-Received: (at 16526-done) by debbugs.gnu.org; 29 Jun 2014 12:53:06 +0000 Original-Received: from localhost ([127.0.0.1]:36497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X1EbS-0003Jl-4O for submit@debbugs.gnu.org; Sun, 29 Jun 2014 08:53:06 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:31142 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X1EbN-0003JG-TA for 16526-done@debbugs.gnu.org; Sun, 29 Jun 2014 08:53:02 -0400 Original-Received: (qmail 37364 invoked by uid 3782); 29 Jun 2014 12:53:00 -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 14:52:58 +0200 Original-Received: (qmail 31652 invoked by uid 1000); 29 Jun 2014 12:48:29 -0000 Content-Disposition: inline In-Reply-To: <53AFE536.7010407@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:90955 Archived-At: Hi, Martin. On Sun, Jun 29, 2014 at 12:06:46PM +0200, martin rudalics wrote: > > That's a bit philosophical. open-..-start is advertised as a high level > > option, and CC Mode only binds it to nil at a low level, the "engine" > > level. Binding user options to set values at a low level is quite a > > common practice in Elisp programming. > It is a quite bad common practice in Elisp programming. :-) We're down at the philosophy level again. > > The actual bug here is that find_defun_start in syntax.c doesn't do any > > cacheing, hence is scanning from BOB far too often. How about we see > > how things work once this is fixed. > We're discussing this problem for some ten years now and I'm afraid we > won't find a solution for the imminent release. We've been discussing it for some while, yes, but a concrete diagnosis of the problem first happened yesterday, as far as I'm aware. Do you feel like fixing it? I think you know the C code better than I do, and you're highly motivated. Once fixed, Stefan might be inclined to include the fix in 24.4. 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. The above simple cacheing might not be adequate in theory, but I'm guessing that in practice it will be a substantial win. > martin -- Alan Mackenzie (Nuremberg, Germany)