On Tue, 18 Nov 2003, Jake Colman wrote:
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))))
You prompted me to fix my .el files, to not use the
font-lock-add-buffer-keywords I had aquired on the emacs wiki site,
I think I *might* have just found out what you are doing wrong:
Where you by chance getting a "fontifying blah.c... aborted.aborted."
message in the modeline?
Try putting brackets around the (1 font-lock-keyword-face t) list.
So I have now in one of mine:
(setq font-lock-keywords
(append font-lock-keywords
(list
'("\\<\\(d?a?\\(cos\\|sin\\|tan\\|tan\\|tan2\\)\\(deg\\)?\\|d?\\(sqrt\\|sqr\\|exp\\|abs\\|int\\|nint\\|min\\|max\\|sign\\|log\\|log10\\)\\)h?\\>"
(0 font-lock-math-face append)))))
)
Personally, I found the hyper-apropros font-lock-keywords documentation
not the easiest to understand :)
--
TimC --
http://astronomy.swin.edu.au/staff/tconnors/
There are running jobs. Why don't you go chase them?