unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: tyler <tyler.smith@mail.mcgill.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: customizing syntax highlighting of variable and function usage in C and C++ mode
Date: Thu, 05 Feb 2009 11:06:32 -0400	[thread overview]
Message-ID: <87k584ditj.fsf@blackbart.sedgenet> (raw)
In-Reply-To: 87ab91ufiv.fsf@gmail.com

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





      reply	other threads:[~2009-02-05 15:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-03 15:38 customizing syntax highlighting of variable and function usage in C and C++ mode Geralt
2009-02-05 13:53 ` Geralt
2009-02-05 14:25   ` Joe Schafer
2009-02-05 15:06     ` tyler [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k584ditj.fsf@blackbart.sedgenet \
    --to=tyler.smith@mail.mcgill.ca \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).