Subject: Re: bug#4192: 23.1; special fontification for "//" in cc-mode

From: Alan Mackenzie <[email-masked]>
Date: Sat, 2 Nov 2019 16:35:13 +0000

Hello, Lars.

On Fri, Nov 01, 2019 at 17:08:48 +0100, Lars Ingebrigtsen wrote:
> Lars Ingebrigtsen <[email-masked]> writes:

> > Alan Mackenzie <[email-masked]> writes:

> >>> This is a feature request for cc-mode.

> >>> I work on a number of projects that use C89, not C99.  In these
> >>> projects, it is invalid to use "//"-style comment.  It would be
> >>> nice if cc-mode would optionally flag such comments in a special
> >>> face, so that I can immediately see when I've written a comment
> >>> incorrectly.

> >> I'm not sure this is important enough to warrant a fully
> >> implemented/documented/QA'd feature, but then again, I'm not sure
> >> it's not.

> >> Here's a quick hack called c-disable-line-comments.el.  Load it into
> >> your Emacs before CC Mode (in particular, before desktop gets
> >> loaded).

> >> Toggling c-disable-line-comments doesn't work smoothly with the font
> >> locking, but I'm assuming here you'll not really be wanting to
> >> toggle this.

> > I think this sounds useful.  For instance, in the Emacs source code,
> > // is also frowned upon, so having those be marked by CC mode would
> > be handy.  This doesn't seem to have made its way into the code base,
> > I think.

> Alan, have you thought any further about this?  It does seem like a
> nice feature.

I'm still not sure either way whether or not this is a feature worth
implementing.  It may be nice, but it will add bulk to CC Mode and Emacs.

But, given that there are people (yourself and Tom Tromey, the OP) who
think it worthwhile, I'm willing to implement it.  It will not be that
difficult, except for deciding what to call the new configuration
variable(s).  ;-)  A couple of hours, perhaps.

So, yes, sometime in the very near future, I will implement this.

> -- 
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no

-- 
Alan Mackenzie (Nuremberg, Germany).