[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: font lock problem in C mode

From: Alan Mackenzie
Subject: Re: font lock problem in C mode
Date: Sat, 16 Jun 2007 10:37:05 +0100
User-agent: Mutt/1.5.9i

Hi, Stephen, Hi, Martin!

Stephen, your address wouldn't be "Department of Applied Mathematics and
Theoretical Physics", by any chance?

On Fri, Jun 15, 2007 at 10:27:02PM +0200, martin rudalics wrote:
>  > Put the following C comment into a file, called e.g. "s.c"
>  >
>  > /**
>  >  * Simple comment.
>  >  */
>  >
>  > and then do:
>  >
>  > $emacs -q s2.c
>  >
>  > The comment is fontified as a "string", rather than a "comment".

> It is fontified as a "doc-string" (if you customize `font-lock-doc-face'
> you will see the difference).

>  > If I delete the 2nd asterisk on the first line, the font switches
>  > correctly to be fontified as a comment.

> It is a "feature".  Alan Mackenzie will explain this carefully and in
> full detail ... Alan, good evening, it's me again ;-)


The feature is in CC Mode what a doc-string is in Emacs Lisp.  It's
documented in the (new) CC Mode manual on page "Doc Comments".  The
default in C Mode is "gtkdoc", the documentation convention used by

If you don't like it (and I realise here that having an unwanted feature
thrust upon one is far worse than the lack of wanted one), disable it by
setting c-doc-comment-style to nil.  This is a CC Mode "style variable",
with all the facilities and hassle that come with these.  Basically, set
it to nil AS EARLY AS POSSIBLE in your .emacs (or use the customize-..
facilities), as described on the manual page "Config Basics".

Alan Mackenzie (Ittersbach, Germany).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]