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: On Syntax Date: Wed, 9 Dec 2009 07:19:53 -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 1260373249 3065 80.91.229.12 (9 Dec 2009 15:40:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Dec 2009 15:40:49 +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 Dec 09 16:40:43 2009 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 1NIOeh-0000Od-24 for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Dec 2009 16:40:43 +0100 Original-Received: from localhost ([127.0.0.1]:48983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIOee-0006Y6-Hg for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Dec 2009 10:40:40 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!u7g2000yqm.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 22 Original-NNTP-Posting-Host: 150.227.15.253 Original-X-Trace: posting.google.com 1260371993 21830 127.0.0.1 (9 Dec 2009 15:19:53 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 9 Dec 2009 15:19:53 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u7g2000yqm.googlegroups.com; posting-host=150.227.15.253; posting-account=ytJKAgoAAAA1tg4ScoRszebXiIldA5vg User-Agent: G2/1.0 X-HTTP-Via: 1.1 ip1-w.foi.se:8080 (IronPort-WSA/6.3.0-604) X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.6 (KHTML, like Gecko) Chrome/4.0.267.0 Safari/532.6,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:175448 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:70524 Archived-At: I am currently implementing a Hit-Format- and Context-Clustered Search/ Scan in elisp. For this I am calling syntax-ppss() at the beginning/ end of each hit to check whether the hit lies inside a string, comment or code. However, syntax-ppss() is quite costly - the code gets around 5-10 times slower compared to simple context querying with looking-back() and looking-at(). Therefore, my question becomes: Is this what syntax-ppss() was built for? If so, could I somehow (re) use it to generate a list of *all* the regions (BEG-POS END-POS) of a buffer that contain either a string or a comment in a more efficient way than using syntax-ppss() on each region (BEG END)? I believe the syntax-ppss() uses some underlying cache, but it doesn't seem do be what I am looking for, right? I have looked at the code, but I haven't figured out how it works. I believe syntax-begin- function plays a key role. Thanks in advance, Nordl=F6w