>>>> "BS" == Bryan Shell
<bshell(a)civicnet.net> writes:
BS> 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!
>
BS> Here is what you can try:
BS> (defun my-c++-mode ()
BS> (setq c++-font-lock-keywords
BS> (append c++-font-lock-keywords
BS> (list '(**ADD KEYWORD REGEX AS STRING HERE** **ADD AN INT
BS> HERE** **ADD FONTLOCK FACE NAME HERE** t)))))
BS> (add-hook 'c++-mode-hook 'my-c++-mode)
Bryan,
I tried this:
(setq c++-font-lock-keywords
(append c++-font-lock-keywords
(list '(".*foreach.*" 1 font-lock-keyword-face t))))
but to no avail. I did check that in the c++-mode buffer, the
c++-font-lock-keywords variable has my setting but it still did not fontify.
Am I supposed to specify the regexp for my new keyword differently somehow?
Also, what is the final 't' used for in the list?
Thanks!
--
Jake Colman -- XEmacs Tinkerer