all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Chris Gordon-Smith <use.address@my.homepage.invalid>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Syntax Highlighting Problem
Date: Tue, 5 May 2009 20:00:47 +0000	[thread overview]
Message-ID: <20090505200047.GA4076@muc.de> (raw)
In-Reply-To: <765o0pF1baiftU1@mid.individual.net>

Hi, Chris,

On Sun, May 03, 2009 at 02:28:41PM +0000, Chris Gordon-Smith wrote:
> I am fairly new to emacs, and am having a problem with syntax
> highlighting with C++.

Yes.  C++ is an utter horror of a language, impossible to parse
syntactically in the general case; so CC Mode sometimes has to guess
what's going on, and sometimes gets it wrong.

> Although the highlighting seems to be working overall, it behaves
> strangely with macros.

OK, macros are a problem in any C and C++ (and Objective C), because
they can expand to anything.  If you can, it's best to write macros so
that they "look like normal code".

> I have a trace utility that can log entry and exit to each function.
> To enable the utility for a function, I invoke a macro at the start of
> the function like this:

>      TRACE

> The odd thing is that the highlighting of the macro call is not consistent; 
> sometimes it is in one colour, sometimes in another colour.

> Can anyone help?

OK, lets have some version numbers, please.  Do M-x emacs-version and
M-x c-version (where M-x means "press x whilst holding down the alt
key").  Thanks!

Second thing, could you post a sample of source which displays the
anomaly, please - the smaller the better (5 - 20 lines is usually enough
for this).  That way, I can reproduce the problem and hopefully debug
it.

Next, what are the "faces" (i.e. colours) which get put onto the
various occurrences of TRACE?  To see this, put point (the cursor) at
the pertinent places and type C-u C-x =.  (Where the "." is not what you
type, is a full stop at the end of my sentence.)  In the results window
at the bottom, you should see something like:

    There are text properties here:
      face                 font-lock-variable-name-face

Look forward to hearing back from you!

> -- Chris Gordon-Smith London www.simsoup.info

-- 
Alan Mackenzie (Nuremberg, Germany).




  reply	other threads:[~2009-05-05 20:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-03 14:28 Syntax Highlighting Problem Chris Gordon-Smith
2009-05-05 20:00 ` Alan Mackenzie [this message]
     [not found] ` <mailman.6684.1241553645.31690.help-gnu-emacs@gnu.org>
2009-05-06 23:07   ` Chris Gordon-Smith

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

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

  git send-email \
    --in-reply-to=20090505200047.GA4076@muc.de \
    --to=acm@muc.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=use.address@my.homepage.invalid \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.