From mboxrd@z Thu Jan 1 00:00:00 1970 From: Le Wang Subject: Re: how to add font-lock keywords Date: Wed, 24 Aug 2011 12:25:44 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:53269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qw52A-0007zp-CX for emacs-orgmode@gnu.org; Wed, 24 Aug 2011 00:25:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qw529-00033W-KI for emacs-orgmode@gnu.org; Wed, 24 Aug 2011 00:25:46 -0400 Received: from mail-qw0-f41.google.com ([209.85.216.41]:36001) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qw529-00033Q-GE for emacs-orgmode@gnu.org; Wed, 24 Aug 2011 00:25:45 -0400 Received: by qwd6 with SMTP id 6so609942qwd.0 for ; Tue, 23 Aug 2011 21:25:44 -0700 (PDT) In-Reply-To: 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: John Wiegley Cc: emacs-orgmode@gnu.org Thanks for the hint, I tried this, but all my beautiful salad bowl colours went away. (font-lock-add-keywords 'org-mode '(("\"\\(\\(?:.\\|\n\\)*?[^\\]\\)\"" 0 font-lock-string-face))) Notice that I made a bad attempt to handle escaped quotation mark in the string. Does anyone know a better solution to handle escaped characters in font-lock? On Wed, Aug 24, 2011 at 9:17 AM, John Wiegley wrote: >>>>>> John Wiegley writes: > >>>>>> Le Wang writes: >>> I wasn't able to google a clear examples of how to do this. =A0For exam= ple, >>> I'd like to highlight all text between double-quotes. > >> Typically it looks something like this: > >> =A0 (font-lock-add-keywords org-mode > [...] > > Sorry, that should be 'org-mode, to name the symbol, not attempt to use i= ts > value. > > John > > > --=20 Le