all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Alan Mackenzie <acm@muc.de>
Cc: bug-cc-mode@gnu.org, emacs-devel@gnu.org
Subject: Re: CC Mode - syntactical can of worms.
Date: Thu, 31 Jan 2008 10:00:07 -0500	[thread overview]
Message-ID: <jwvd4rioxiu.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20080131114546.GA2150@muc.de> (Alan Mackenzie's message of "Thu,  31 Jan 2008 11:45:46 +0000")

> Hi, Emacs and CC Mode!
> Following up from: [orium69@gmail.com: Bug in emacs 22.1.1 (cosmetic
> bug)].

> This bug was in C Mode, with the following source line:

>     #warning for isn't a keyword here.

> This fouls up the fontification, because the syntactic fontification
> recognises the apostrophe as a string opener.  It can get pretty bad -
> here is a syntactically correct C function:

> 1   #warning for isn't a keyword here. (
> 2   //#warning for isnt a keyword here.
> 3   void foo (bar)
> 4   {
> 5   #error Brace yourself! }
> 6       printf ("Hello, world!\n") ; /* the famous one liner! */
> 7   }

You forget other interesting constructs such as

   #define HELLO }
   #define WORLD )
   
   void foo (WORLD
   {
     printf ("Hello\n"WORLD;
   HELLO

and of course, the more common ones like

   #if foo
   void foo (void)
   {
      size_t toto;
   #else
   int foo ()
   {
      unsigned toto;
   #endif

or how 'bout

   #include "hello.h"

   void foo (WORLD
   {
     printf ("Hello\n"WORLD;
   HELLO

CC-mode's job is fundamentally impossible.


        Stefan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/


  parent reply	other threads:[~2008-01-31 15:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-31 11:45 CC Mode - syntactical can of worms Alan Mackenzie
2008-01-31 12:53 ` Andreas Schwab
2008-01-31 15:00 ` Stefan Monnier [this message]
2008-01-31 22:05   ` Alan Mackenzie
2008-01-31 22:05     ` Lennart Borgman (gmail)

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=jwvd4rioxiu.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=acm@muc.de \
    --cc=bug-cc-mode@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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.