From xemacs-m  Thu Dec 19 00:29:29 1996
Received: from venus.Sun.COM (venus.Sun.COM [192.9.25.5])
          by xemacs.cs.uiuc.edu (8.8.4/8.8.4) with SMTP
	  id AAA07439 for <xemacs-beta@xemacs.org>; Thu, 19 Dec 1996 00:29:29 -0600 (CST)
Received: from Eng.Sun.COM ([129.146.1.25]) by venus.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id WAA29961; Wed, 18 Dec 1996 22:29:01 -0800
Received: from kindra.eng.sun.com by Eng.Sun.COM (SMI-8.6/SMI-5.3)
	id WAA06060; Wed, 18 Dec 1996 22:28:56 -0800
Received: from xemacs.eng.sun.com by kindra.eng.sun.com (SMI-8.6/SMI-SVR4)
	id WAA09228; Wed, 18 Dec 1996 22:28:55 -0800
Received: by xemacs.eng.sun.com (SMI-8.6/SMI-SVR4)
	id WAA06077; Wed, 18 Dec 1996 22:28:50 -0800
Date: Wed, 18 Dec 1996 22:28:50 -0800
Message-Id: <199612190628.WAA06077@xemacs.eng.sun.com>
From: Martin Buchholz <mrb@Eng.Sun.COM>
To: XEmacs Beta Test <xemacs-beta@xemacs.org>,
        "Barry A. Warsaw" <bwarsaw@anthem.cnri.reston.va.us>, tor@Eng.Sun.COM
Subject: Should // comments be recognized in C mode?
Reply-To: Martin Buchholz <mrb@Eng.Sun.COM>
Mime-Version: 1.0 (generated by tm-edit 7.94)
Content-Type: text/plain; charset=US-ASCII

Folks at Sun were complaining that `//' comments in their C++ header
files (.h) were not being recognized as comment delimiters.

Rather than change auto-mode-alist to set the mode of .h files to C++,
I discovered after some digging that 

(c-enable-//-in-c-mode)

does what I want.  Why don't we make this the default?

Some users will lose because of code like this:
double x = 1//*divide*/2;
but they deserve to lose.

I checked gcc, and it accepts `//' comments in C code unless the -ansi
flag is set.

Barry:  In any case, the value of c-C++-comment-start-regexp could be
defined slightly more efficiently as "/[/*]".

*** /tmp/geta6061	Wed Dec 18 22:21:45 1996
--- cc-mode.el	Wed Dec 18 22:21:44 1996
***************
*** 1197,1203 ****
  (defconst c-C++-friend-key
    "friend[ \t]+\\|template[ \t]*<.+>[ \t]*friend[ \t]+"
    "Regexp describing friend declarations in C++ classes.")
! (defconst c-C++-comment-start-regexp "//\\|/\\*"
    "Dual comment value for `c-comment-start-regexp'.")
  (defconst c-C-comment-start-regexp "/\\*"
    "Single comment style value for `c-comment-start-regexp'.")
--- 1197,1203 ----
  (defconst c-C++-friend-key
    "friend[ \t]+\\|template[ \t]*<.+>[ \t]*friend[ \t]+"
    "Regexp describing friend declarations in C++ classes.")
! (defconst c-C++-comment-start-regexp "/[/*]"
    "Dual comment value for `c-comment-start-regexp'.")
  (defconst c-C-comment-start-regexp "/\\*"
    "Single comment style value for `c-comment-start-regexp'.")

Martin

