From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw. Date: Sat, 16 Dec 2006 18:29:20 -0500 Message-ID: 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 1166311780 11695 80.91.229.10 (16 Dec 2006 23:29:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 16 Dec 2006 23:29:40 +0000 (UTC) Cc: Alan Mackenzie , Chong Yidong , Richard Stallman , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 17 00:29:37 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 1GviyH-0001dA-IR for ged-emacs-devel@m.gmane.org; Sun, 17 Dec 2006 00:29:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GviyH-0000c5-2g for ged-emacs-devel@m.gmane.org; Sat, 16 Dec 2006 18:29:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gviy5-0000bZ-Gp for emacs-devel@gnu.org; Sat, 16 Dec 2006 18:29:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gviy4-0000ae-8H for emacs-devel@gnu.org; Sat, 16 Dec 2006 18:29:25 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gviy4-0000aP-42 for emacs-devel@gnu.org; Sat, 16 Dec 2006 18:29:24 -0500 Original-Received: from [83.228.164.152] (helo=alfajor.home) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Gviy2-0008Cd-V1; Sat, 16 Dec 2006 18:29:23 -0500 Original-Received: by alfajor.home (Postfix, from userid 20848) id E6CCD1C1D2; Sat, 16 Dec 2006 18:29:20 -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:63858 Archived-At: >> 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? The back_comment code tries to only use it when it can't detect the beginning-of-comment on its own. Problem is that in C modes this is the case very often. IIRC this is the case at least every time a /*..*/ comment spans two or more lines (because it means it contains a \n which is a comment marker for the other style of commenting, which makes it particularly tricky to reliably figure out what's going on). > convinced that this bug is responsible for C mode being slow over the > past year. Sounds credible. > Eventually, Stefan will have to move syntax-ppss in here. Anybody's free to take a crack at it. But I really hope nobody tries to port syntax-ppss to C code. The saner approach is to make sure that elisp code (in this case syntax-ppss) can be called from find_defun_start. Stefan