unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
[parent not found: <44166427.6040005@gmx.at>]
* custom colorizing keywords
@ 2006-03-12 13:29 ken
  0 siblings, 0 replies; 5+ messages in thread
From: ken @ 2006-03-12 13:29 UTC (permalink / raw)



Wishing to colorize some of my own keywords, I stumbled across
font-lock-add-keywords and did C-h f on it.  I'm not an elisp
programmer, so of course the explanations there made hardly any sense.
So I tried just altering the example:

 (font-lock-add-keywords 'c-mode
  '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend)
    ("\\<\\(and\\|or\\|not\\)\\>" . font-lock-keyword-face)))

The help page says "MODE should be a symbol, the major mode command
name, such as `c-mode' or nil."  Because I want to highlight the added
keywords in all modes, I did this:

(font-lock-add-keywords nil
  '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend)
    ("\\<\\(XXX\\|xxx\\|???\\)\\>" . font-lock-keyword-face)))

Evaluating this failed, told me "Fontifying region...(invalid-regexp
Invalid regular expression)".  I've read enough elisp code that I pretty
much knew that there shouldn't be an apostrophe (') in front of nil, but
I tried it anyway.  Got the same error message.

I tried a lot of other things, but this is the easiest yet most
perplexing of several questions.  Searching the archives and EmacsWiki
yeilded nothing helpful.  Is what I'm asking even possible to do?


Thanks for any assistance.

-- 
"This world ain't big enough for the both of us,"
said the big noema to the little noema.

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

end of thread, other threads:[~2006-03-15 18:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.4.1142170197.32310.help-gnu-emacs@gnu.org>
2006-03-12 13:51 ` custom colorizing keywords Stefan Monnier
2006-03-13 18:59 ` Steve Wainstead
2006-03-15 18:41   ` ken
     [not found] <44166427.6040005@gmx.at>
2006-03-15 14:18 ` ken
2006-03-12 13:29 ken

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