emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] how to add font-lock keywords


From: John Wiegley
Subject: Re: [O] how to add font-lock keywords
Date: Tue, 23 Aug 2011 20:01:31 -0500
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.3 (darwin)

>>>>> Le Wang <address@hidden> writes:

> I wasn't able to google a clear examples of how to do this.  For example,
> I'd like to highlight all text between double-quotes.

Typically it looks something like this:

  (font-lock-add-keywords org-mode
                          (list (list (concat "\\(\"[^\"]+\"\\)")
                                      1 highlight-face t)))

Where `highlight-face' is the face you'd like to use.  The regexp doesn't
handle cases where \" legitimately occurs in a string, either.  The part
between the \\(\\) is what gets colorized.

John




reply via email to

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