[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: customizing syntax highlighting of variable and function usage in C
From: |
tyler |
Subject: |
Re: customizing syntax highlighting of variable and function usage in C and C++ mode |
Date: |
Thu, 05 Feb 2009 11:06:32 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
Joe Schafer <joesmoe10@gmail.com> writes:
> Geralt <usr.gentoo@googlemail.com> writes:
>
>> Since nobody has replied I suppose that this is not possible, am I
>> correct?
>
> The default font-lock faces might not be affecting the text. You can
> check to see what face font-lock uses on some text by typing \C-x= at
> the point of the text. This runs `what-cursor-position'. But what you
> have is similar to what I have. Are you sure the rest your color-theme
> definition is correct?
>
> (font-lock-function-name-face ((t ( :foreground "palegreen3"))))
>
I can confirm the OP's observation on Emacs 23. Running emacs -Q and
opening a .c file, with a code snippet like the following:
int minrow, mincol, majrow, majcol, i; /*counters*/
int inputvalue, outputvalue, changecount;
changecount = 0;
The declaration rows are nicely coloured, but the following line
('changecount = 0') is not. Variable names in the declaration lines are
subject to font-lock-variable-name-face, while the variable name outside
of the declaration is given the default font. So, at least on my setup,
you can modify the font-lock for declarations, but not for subsequent
occurrences of the variable (or function). At least, not without some
further modification of the color-theme.
Tyler
--
There is something fascinating about science. One gets such wholesale
returns of conjecture out of such a trifling investment of fact.
--Mark Twain