unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* A problem in using font-lock-add-keywords
@ 2013-03-05  2:54 source liu
  2013-03-05  4:58 ` Dmitry Gutov
  2013-03-05  8:50 ` Dmitry Gutov
  0 siblings, 2 replies; 5+ messages in thread
From: source liu @ 2013-03-05  2:54 UTC (permalink / raw)
  To: help-gnu-emacs

Hi, list


1. about font-lock-add-keywords
I'm new to elisp, and i want to add some keywords to a mode( say,
c-mode), a list is below,
(defvar my-list '("FIXME" "AND" "OR"))


and I find some hint in emacs help  C-h f "font-lock-add-keywords"

========= reference from the buff of help ===========
 (add-hook 'c-mode-hook
  (lambda ()
   (font-lock-add-keywords nil
    '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend)
      ("\\<\\(and\\|or\\|not\\)\\>" .
       font-lock-keyword-face)))))
==========================================

i've tested it, it works, but when i change the expression of
"\\<(FIXME\\):"  by (regexp-opt mylist t), it can't work.  does
someone give me some hint where my problem is?

2. by the way, does emacs list have a max length?
i find when the list is beyond about 4600 words, the bracket ")" cant match "("






-- 
Liu An
Institution of modern physics, Shanghai, China



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-03-05 10:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-05  2:54 A problem in using font-lock-add-keywords source liu
2013-03-05  4:58 ` Dmitry Gutov
2013-03-05  7:34   ` source liu
2013-03-05  8:50 ` Dmitry Gutov
     [not found]   ` <CAAzVxgMu3EnA1_FMG9oLshCxhPV03=qkVNoWKhygUJKa8C6DwA@mail.gmail.com>
2013-03-05 10:14     ` Dmitry Gutov

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).