emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Le Wang <l26wang@gmail.com>
To: John Wiegley <jwiegley@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: how to add font-lock keywords
Date: Wed, 24 Aug 2011 12:25:44 +0800	[thread overview]
Message-ID: <CAM=K+iq=thmoyj0RA_g_5vH0qKJOrQSfYvdaTsjm6MzXbmEikg@mail.gmail.com> (raw)
In-Reply-To: <m262lnip5b.fsf@gmail.com>

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 <jwiegley@gmail.com> wrote:
>>>>>> John Wiegley <jwiegley@gmail.com> writes:
>
>>>>>> Le Wang <l26wang@gmail.com> 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
> [...]
>
> Sorry, that should be 'org-mode, to name the symbol, not attempt to use its
> value.
>
> John
>
>
>



-- 
Le

  reply	other threads:[~2011-08-24  4:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-23 17:51 how to add font-lock keywords Le Wang
2011-08-24  1:01 ` John Wiegley
2011-08-24  1:17   ` John Wiegley
2011-08-24  4:25     ` Le Wang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-12-11 11:21 How " Daniel Fleischer
2021-12-21 19:35 ` Bruno Barbier
2021-12-23  8:20   ` Daniel Fleischer

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAM=K+iq=thmoyj0RA_g_5vH0qKJOrQSfYvdaTsjm6MzXbmEikg@mail.gmail.com' \
    --to=l26wang@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jwiegley@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).