From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: joakim@verona.se
Cc: Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: How to highlight a large number of keywords?
Date: Fri, 23 Jul 2010 11:36:32 +0200 [thread overview]
Message-ID: <jwveieur18b.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m3k4om7hvo.fsf@verona.se> (joakim@verona.se's message of "Fri, 23 Jul 2010 09:54:35 +0200")
> 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
prev parent reply other threads:[~2010-07-23 9:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-23 7:54 How to highlight a large number of keywords? joakim
2010-07-23 9:36 ` Stefan Monnier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwveieur18b.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=joakim@verona.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.