From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Wiegley Subject: Re: how to add font-lock keywords Date: Tue, 23 Aug 2011 20:01:31 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:35299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qw1s8-0007pg-FZ for emacs-orgmode@gnu.org; Tue, 23 Aug 2011 21:03:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qw1s7-0006bS-Ia for emacs-orgmode@gnu.org; Tue, 23 Aug 2011 21:03:12 -0400 Received: from lo.gmane.org ([80.91.229.12]:49525) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qw1s7-0006az-B3 for emacs-orgmode@gnu.org; Tue, 23 Aug 2011 21:03:11 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Qw1s5-0001gT-2H for emacs-orgmode@gnu.org; Wed, 24 Aug 2011 03:03:09 +0200 Received: from c-98-214-102-66.hsd1.il.comcast.net ([98.214.102.66]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Aug 2011 03:03:09 +0200 Received: from jwiegley by c-98-214-102-66.hsd1.il.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Aug 2011 03:03:09 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org >>>>> Le Wang 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