emacs-devel
[Top][All Lists]
Advanced

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

Re: How to highlight a large number of keywords?


From: Stefan Monnier
Subject: Re: How to highlight a large number of keywords?
Date: Fri, 23 Jul 2010 11:36:32 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> I'm trying to highlight a large number of keywords, 12000, with
> font-lock. I've made a regexp using regexp-opt. This doesnt work, I dont
> get any errors, but it seems the regexp is too large.

If you don't get an error, it should work (else, it's just a bug).
Most likely, it's a bug (12000 keywords is very likely to overflow the
maximum size of a compiled regexp).

> What would be the best way to highlight this large number of keywords
> in Emacs?

Use a regexp that matches a superset of all those keywords, and then
extract the matched string and compare it to your set of 12000 keywords
to see if it's indeed one of them.


        Stefan



reply via email to

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