From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw. Date: Sat, 16 Dec 2006 15:10:56 -0500 Message-ID: <87d56jzjn3.fsf@stupidchicken.com> References: <45768797.5010106@gmx.at> <87odqhj89q.fsf@stupidchicken.com> <20061210014526.GB3738@muc.de> <877ix0lfm8.fsf@furball.mit.edu> <20061210102249.GA1235@muc.de> <87d56rpk7a.fsf@stupidchicken.com> <20061213224009.GA1206@muc.de> <87odq72ssy.fsf@stupidchicken.com> <20061214084713.GA1333@muc.de> <45812BDF.5050107@gmx.at> <4583C7D3.1070703@gmx.at> <45843AA5.5080906@gmx.at> <45844243.4060706@gmx.at> <87hcvvzlco.fsf@stupidchicken.com> <4584500B.7020303@gmx.at> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1166299870 10556 80.91.229.10 (16 Dec 2006 20:11:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 16 Dec 2006 20:11:10 +0000 (UTC) Cc: Alan Mackenzie , Stefan Monnier , Richard Stallman , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 16 21:11:08 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1Gvfs5-0000IA-Ks for ged-emacs-devel@m.gmane.org; Sat, 16 Dec 2006 21:11:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gvfs5-00056S-2A for ged-emacs-devel@m.gmane.org; Sat, 16 Dec 2006 15:11:01 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gvfrs-00053y-Mb for emacs-devel@gnu.org; Sat, 16 Dec 2006 15:10:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gvfrr-00051B-7H for emacs-devel@gnu.org; Sat, 16 Dec 2006 15:10:48 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gvfrr-000510-20 for emacs-devel@gnu.org; Sat, 16 Dec 2006 15:10:47 -0500 Original-Received: from [18.19.1.138] (helo=cyd.mit.edu) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Gvfrq-0008GH-EN; Sat, 16 Dec 2006 15:10:46 -0500 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 37B514E44F; Sat, 16 Dec 2006 15:10:56 -0500 (EST) Original-To: martin rudalics In-Reply-To: <4584500B.7020303@gmx.at> (martin rudalics's message of "Sat\, 16 Dec 2006 20\:59\:07 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) 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:63848 Archived-At: martin rudalics writes: >> The trouble is that find_defun_start will scan from bob if >> open_paren... is 0: > > I see. Does it do that for every single comment in `syms_of_xdisp' or > is there something particular which triggers it in certain comments > only? >>From my understanding of the code, it will do it for every comment. So this slowness is triggered by doing a backward scan_list over a function which contains many comments and lives at the end of a long file. > Anyway, I'm afraid there's nothing we can do here at the moment. I'm > convinced that this bug is responsible for C mode being slow over the > past year. Eventually, Stefan will have to move syntax-ppss in here. > So far let's avoid setting `open-paren-in-column-0-is-defun-start' to > nil for _any_ mode. Unless you have an idea ... It might be possible to construct a "last known defun start position" cache variable living in scan_list, so that back_comment can use that instead of BOB. But I don't know how desirable or general such a fix is.