From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kentaro NAKAZAWA Newsgroups: gmane.emacs.devel Subject: Re: Slow fontification in C mode buffers Date: Sat, 07 Jan 2012 09:09:01 +0900 Message-ID: <87r4zcjrvm.fsf@nifty.com> References: <87pqfso5d3.fsf@isil.kanru.info> <20111215134332.GA5698@acm.acm> <87y5udizdy.fsf@isil.kanru.info> <20111215181215.GA3464@acm.acm> <87ty51i6vf.fsf@isil.kanru.info> <20111216112617.GA3445@acm.acm> <87pqfngp3r.fsf@isil.kanru.info> <20111221105626.GA3263@acm.acm> <87ehvwxd8g.fsf@nifty.com> <20120106220806.GA3217@acm.acm> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1325920875 20819 80.91.229.12 (7 Jan 2012 07:21:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 7 Jan 2012 07:21:15 +0000 (UTC) Cc: Kan-Ru Chen , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 07 08:21:11 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RjQaU-0007y3-J9 for ged-emacs-devel@m.gmane.org; Sat, 07 Jan 2012 08:21:10 +0100 Original-Received: from localhost ([::1]:39241 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjQaU-00045W-0J for ged-emacs-devel@m.gmane.org; Sat, 07 Jan 2012 02:21:10 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:53884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjJqc-00015C-Jt for emacs-devel@gnu.org; Fri, 06 Jan 2012 19:09:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RjJqa-00053h-E4 for emacs-devel@gnu.org; Fri, 06 Jan 2012 19:09:22 -0500 Original-Received: from userg508.nifty.com ([202.248.238.88]:62056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjJqZ-00053E-NK for emacs-devel@gnu.org; Fri, 06 Jan 2012 19:09:20 -0500 Original-Received: from localhost.localdomain (eatkyo565213.adsl.ppp.infoweb.ne.jp [222.159.219.213])by userg508.nifty.com with ESMTP id q07091pe019479; Sat, 7 Jan 2012 09:09:01 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=mar2011msa; t=1325894941; bh=BcKdLKYmqPKsmsoJhziu7HXXmx3mprDpcEvAo7DgOms=; h=From:To:Cc:Subject:References:Date:Message-ID:MIME-Version: Content-Type; b=D1MtasYvxGIhkdeaD7398BLv1i5gQ/jjwq0/C8gRpxUH4Js+CPIw2XkSt5IwB9en6 guLQlzvvlooamdQZKa9mT0eotGBunY7tSdIFrv/AgFz2ZxiZ1NDAC1UZ3c7P5YIiRj Jn1YiC2xUVMUF45BGdXSTiO3x1Ki09VEdk0HBftY= X-Nifty-SrcIP: [222.159.219.213] User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 202.248.238.88 X-Mailman-Approved-At: Sat, 07 Jan 2012 02:21:08 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:147436 Archived-At: Hello, Alan. Alan Mackenzie writes: > Would you try this patch and let me know how it goes, please. > > > *** orig/cc-fonts.el 2012-01-06 12:27:14.000000000 +0000 > --- cc-fonts.el 2012-01-06 21:48:54.000000000 +0000 > *************** > *** 1394,1399 **** > --- 1394,1414 ---- > (c-fontify-recorded-types-and-refs) > nil) > > + ((and (not c-enums-contain-decls) > + ;; An optimisation quickly to eliminate scans of long enum > + ;; declarations in the next cond arm. > + (let ((paren-state (c-parse-state))) > + (and > + (numberp (car paren-state)) > + (save-excursion > + (goto-char (car paren-state)) > + (c-backward-token-2) > + (or (looking-at c-brace-list-key)) > + (progn > + (c-backward-token-2) > + (looking-at c-brace-list-key)))))) > + t) > + > (t > ;; Are we at a declarator? Try to go back to the declaration > ;; to check this. If we get there, check whether a "typedef" > *** orig/cc-langs.el 2012-01-06 12:27:14.000000000 +0000 > --- cc-langs.el 2012-01-06 12:54:00.000000000 +0000 > *************** > *** 2930,2935 **** > --- 2930,2941 ---- > ; generics is not yet coded in CC Mode. > (c-lang-defvar c-recognize-<>-arglists (c-lang-const c-recognize-<>-arglists)) > > + (c-lang-defconst c-enums-contain-decls > + "Non-nil means that an enum structure can contain declarations." > + t nil > + java t) > + (c-lang-defvar c-enums-contain-decls (c-lang-const c-enums-contain-decls)) > + > (c-lang-defconst c-recognize-paren-inits > "Non-nil means that parenthesis style initializers exist, > i.e. constructs like > Thank you for the patch. I applied a patch, it came to be able to edit the attribute.h comfortably. The original file with the problem is comfortable too. However, some key words were not colored. -- Kentaro Nakazawa