Jake Colman wrote:
First, why does XEmacs have its own, very different, version of
font-lock?
Are our internals so incompatible that implementation of font-lock has to be
different? I'm not implying that that's not be the case; I'm simply curious
about the history over here.
My real issue is that FSF font-lock has a function called
font-lock-add-keywords that is missing from our implementation. There is a
comment in our implementation that says the following:
;;; FSF has here:
;; support for add-keywords, global-font-lock-mode and
;; font-lock-support-mode (unified support for various *-lock modes).
I'd really like to use this function and this comment does not quite do it
for me. Can anyone tell me why it's missing? Also, can anyone tell me how
to do the equivalent using XEmacs' font-lock? I'd like to (easily) add a new
C++ keyword to those that are already recognized for fontification.
Thanks!
Here is what you can try:
(defun my-c++-mode ()
(setq c++-font-lock-keywords
(append c++-font-lock-keywords
(list '(**ADD KEYWORD REGEX AS STRING HERE** **ADD AN INT HERE** **ADD
FONTLOCK FACE NAME HERE** t)))))
(add-hook 'c++-mode-hook 'my-c++-mode)