From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: tyler Newsgroups: gmane.emacs.help Subject: Re: customizing syntax highlighting of variable and function usage in C and C++ mode Date: Thu, 05 Feb 2009 11:06:32 -0400 Message-ID: <87k584ditj.fsf@blackbart.sedgenet> References: <87ab91ufiv.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1233847161 31709 80.91.229.12 (5 Feb 2009 15:19:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Feb 2009 15:19:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 05 16:20:35 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LV61n-0002qo-Lq for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Feb 2009 16:20:31 +0100 Original-Received: from localhost ([127.0.0.1]:52145 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LV60U-0005pG-Hj for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Feb 2009 10:19:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LV5ob-0008HM-8d for help-gnu-emacs@gnu.org; Thu, 05 Feb 2009 10:06:53 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LV5oa-0008GC-Ay for help-gnu-emacs@gnu.org; Thu, 05 Feb 2009 10:06:52 -0500 Original-Received: from [199.232.76.173] (port=36745 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LV5oa-0008G1-5E for help-gnu-emacs@gnu.org; Thu, 05 Feb 2009 10:06:52 -0500 Original-Received: from main.gmane.org ([80.91.229.2]:54988 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LV5oZ-0003LL-Er for help-gnu-emacs@gnu.org; Thu, 05 Feb 2009 10:06:51 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LV5oW-0008Hx-Mb for help-gnu-emacs@gnu.org; Thu, 05 Feb 2009 15:06:48 +0000 Original-Received: from hlfxns0169w-142068220183.pppoe-dynamic.ns.aliant.net ([142.68.220.183]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Feb 2009 15:06:48 +0000 Original-Received: from tyler.smith by hlfxns0169w-142068220183.pppoe-dynamic.ns.aliant.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Feb 2009 15:06:48 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 40 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: hlfxns0169w-142068220183.pppoe-dynamic.ns.aliant.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:x7Tza3KlrEL2hKqhKNQ2GrjOvLw= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:61925 Archived-At: Joe Schafer writes: > Geralt 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