unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Stephen Eglen <S.J.Eglen@damtp.cam.ac.uk>,
	martin rudalics <rudalics@gmx.at>
Cc: bug-cc-mode@gnu.org, bug-gnu-emacs@gnu.org, maechler@stat.math.ethz.ch
Subject: Re: font lock problem in C mode
Date: Sat, 16 Jun 2007 10:37:05 +0100	[thread overview]
Message-ID: <20070616093705.GA1945@muc.de> (raw)
In-Reply-To: <4672F616.5030103@gmx.at>

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 ;-)

OK, OK, OK!

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
Gnomes.

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).

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/


      parent reply	other threads:[~2007-06-16  9:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-15 17:26 font lock problem in C mode Stephen Eglen
2007-06-15 20:27 ` martin rudalics
2007-06-15 20:56   ` Jason Rumney
2007-06-16  9:37   ` Alan Mackenzie [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=20070616093705.GA1945@muc.de \
    --to=acm@muc.de \
    --cc=S.J.Eglen@damtp.cam.ac.uk \
    --cc=bug-cc-mode@gnu.org \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=maechler@stat.math.ethz.ch \
    --cc=rudalics@gmx.at \
    /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 public inbox

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

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).