[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
help with font locking
From: |
Mark P |
Subject: |
help with font locking |
Date: |
Thu, 12 Jan 2006 00:20:14 GMT |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041206 Thunderbird/1.0 Mnenhy/0.7.2.0 |
I'm trying to edit my .emacs file so that in c++-mode a frequently used
user-defined type "Coord" is highlighted like any built-in type (int,
bool, etc.) I searched around for a while but found only very limited
information. The best I could produce was the following:
;; customize font-locking
(font-lock-add-keywords
'c++-mode
'(("\\<\\(Coord\\)" 1 font-lock-type-face)
) )
This sort of works. In a statement like:
Coord fcn (Coord x);
"Coord" is highlighted twice, but neither "fcn" nor "x" is. In a normal
statement like:
int fcn (int x)
"int" is highlighted as are "fcn" and "x".
Can anyone suggest a way to make the behavior for Coord match that for
int. Any links to detail documentation on how this works would also be
appreciated. (For example, why all the quotes and slashes in the .emacs
code?)
Thanks,
Mark