Look into font-lock-add-keywords.
Details:
C-h f font-lock-add-keywords RET yields
-----------------------------
font-lock-add-keywords is a compiled Lisp function in `font-lock'.
(font-lock-add-keywords MODE KEYWORDS &optional APPEND)
Add highlighting KEYWORDS for MODE.
MODE should be a symbol, the major mode command name, such as `c-mode'
or nil. If nil, highlighting keywords are added for the current buffer.
KEYWORDS should be a list; see the variable `font-lock-keywords'.
By default they are added at the beginning of the current highlighting
list.
If optional argument APPEND is `set', they are used to replace the
current
highlighting list. If APPEND is any other non-nil value, they are added
at the
end of the current highlighting list.
For example:
(font-lock-add-keywords 'c-mode
'(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend)
("\\<\\(and\\|or\\|not\\)\\>" . font-lock-keyword-face)))
adds two fontification patterns for C mode, to fontify `FIXME:' words,
even in
comments, and to fontify `and', `or' and `not' words as keywords.
When used from an elisp package (such as a minor mode), it is
recommended
to use nil for MODE (and place the call in a loop or on a hook) to avoid
subtle problems due to details of the implementation.
Note that some modes have specialized support for additional patterns,
e.g.,
see the variables `c-font-lock-extra-types',
`c++-font-lock-extra-types',
`objc-font-lock-extra-types' and `java-font-lock-extra-types'.
------------------
You need to set this up in the jde-mode-hook.
Here is how I add JSP tags:
(font-lock-add-keywords 'jde-mode
'(
("%>\\([^]*?\\)<%" 1
'font-lock-comment-face t)
("<[^%].*?[^%]>" 0
jde-java-font-lock-bold-face t)
("<[_a-zA-Z0-9]+:.*/?>" 0
font-lock-function-name-face t)
("</[_a-zA-Z0-9]+:.*>" 0
font-lock-function-name-face t)
("<[EMAIL PROTECTED]>" 0
jde-java-font-lock-api-face t)
("\\(<%=\\).*\\(%>\\)"
(1 jde-java-font-lock-bold-face t)
(2 jde-java-font-lock-bold-face t)
)
("\\(<[EMAIL PROTECTED] +page\\s
+\\)\\(import\\)\\(\\s
*=\\s *\"\\)\\([,a-zA-Z._0-9*]+\\)\\(\"\\s *?%>\\)"
(1 jde-java-font-lock-api-face prepend)
(2 font-lock-keyword-face prepend)
(3 jde-java-font-lock-api-face prepend)
(4 jde-java-font-lock-package-face prepend)
(5 jde-java-font-lock-api-face prepend)
)
)
)
-----Original Message-----
From: Guy Thomas [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 09, 2004 3:02 AM
To: [EMAIL PROTECTED]
Subject: adding new keywords
How do I set up new keywords (like "enum" in JDK 1.5) for correct syntax
coloring?
Thanks