all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* On Syntax
@ 2009-12-09 15:19 Nordlöw
  0 siblings, 0 replies; only message in thread
From: Nordlöw @ 2009-12-09 15:19 UTC (permalink / raw)
  To: help-gnu-emacs

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öw


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-09 15:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-09 15:19 On Syntax Nordlöw

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.