From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "=?ISO-8859-1?Q?Nordl=F6w?=" Newsgroups: gmane.emacs.help Subject: Performance tips when using regular expressions (regexps) in font-locking Date: Wed, 21 Nov 2007 09:00:30 -0800 (PST) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1195666851 2339 80.91.229.12 (21 Nov 2007 17:40:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Nov 2007 17:40:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 21 18:40:57 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IutZE-0006fh-1x for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Nov 2007 18:40:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IutYz-0007QN-PQ for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Nov 2007 12:40:37 -0500 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!postnews.google.com!b15g2000hsa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 11 Original-NNTP-Posting-Host: 150.227.15.253 Original-X-Trace: posting.google.com 1195664430 4581 127.0.0.1 (21 Nov 2007 17:00:30 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 21 Nov 2007 17:00:30 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b15g2000hsa.googlegroups.com; posting-host=150.227.15.253; posting-account=ytJKAgoAAAA1tg4ScoRszebXiIldA5vg User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.7) Gecko/20070923 Firefox/2.0.0.7 (Swiftfox),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 netcache (NetCache NetApp/6.1.1RC1) Content-Disposition: inline Original-Xref: shelby.stanford.edu gnu.emacs.help:153969 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49401 Archived-At: I have enhanced my cc-mode with extra font-locking for assignments, function calls, numerical literals, operators and even format strings to the [sf]?printf-functions. The regular expressions describing these context are quite complicated and as a result my cc-mode is no longer as snappy as without my enhancement. Does any have any tips on how to write regular expressions when performance is crucial? For example should I use [:space:] instead of [ \t]? Should I post the code aswell? Thanks in advance, Nordl=F6w