[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On Syntax

From: Nordlöw
Subject: On Syntax
Date: Wed, 9 Dec 2009 07:19:53 -0800 (PST)
User-agent: G2/1.0

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,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]