From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Enselic Newsgroups: gmane.emacs.help Subject: Re: C and C++ highlighting is not working properly (font-lock) Date: Sat, 30 Jun 2007 01:34:09 -0700 Organization: http://groups.google.com Message-ID: <1183192449.781552.293700@k79g2000hse.googlegroups.com> References: <1183167950.112690.110970@k29g2000hsd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: sea.gmane.org 1183192886 22607 80.91.229.12 (30 Jun 2007 08:41:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 30 Jun 2007 08:41:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 30 10:41:18 2007 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 1I4YW2-000470-WD for geh-help-gnu-emacs@m.gmane.org; Sat, 30 Jun 2007 10:41:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I4YW2-0007sE-I5 for geh-help-gnu-emacs@m.gmane.org; Sat, 30 Jun 2007 04:41:14 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!k79g2000hse.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 24 Original-NNTP-Posting-Host: 83.233.151.58 Original-X-Trace: posting.google.com 1183192449 384 127.0.0.1 (30 Jun 2007 08:34:09 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 30 Jun 2007 08:34:09 +0000 (UTC) In-Reply-To: <1183167950.112690.110970@k29g2000hsd.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20061201 Firefox/2.0.0.4 (Ubuntu-feisty),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: k79g2000hse.googlegroups.com; posting-host=83.233.151.58; posting-account=UCk5Bg0AAADPsAztUtvWN1oDuygFB2bK Original-Xref: shelby.stanford.edu gnu.emacs.help:149773 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:45361 Archived-At: On 30 Juni, 03:45, deccard wrote: > I'm using font-lock, but I'm getting quite weird behavior out of it. I > get right colors only for the first word. Even using tab messes it up! > What could be going on? I have not added anything to my .emacs. > > Here is a screen shot of my pseudo c++ program:http://www.helsinki.fi/~ipohjala/Problem.png First of all, font-lock probably assumes proper syntax and sane indentation, so fix that first. Second of all, it might look more wrong than it is if you have the same color for two different fonts. When I setup these colors and want full control, I bring up M-x customize-group font-lock-faces RET and M-x list-colors-display RET. Then I change a font, save the settings, switch to a C++ buffer, look at the results, go back to the customization group, change a color, save changes, look at result in C++ buffer, etc. This way I find that one gets much control over syntax. Hope this helps in some way, - Martin Nordholts