bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#64204: C/C++ local variables not syntax highlighted if they start wi


From: Alan Mackenzie
Subject: bug#64204: C/C++ local variables not syntax highlighted if they start with $
Date: Thu, 22 Jun 2023 09:11:38 +0000

Hello, Eli.

On Thu, Jun 22, 2023 at 07:50:47 +0300, Eli Zaretskii wrote:
> > Cc: acm@muc.de, 64204@debbugs.gnu.org
> > Date: Wed, 21 Jun 2023 21:06:37 +0000
> > From: Alan Mackenzie <acm@muc.de>

> > Apologies, the patch I sent earlier was defective, not applying cleanly
> > to the Emacs master branch.  I also should have sent the patch as an
> > attachment.

> > I'm now sending the patch as attachment.  It should apply cleanly to the
> > master branch or emacs-29.

> Thanks, but shouldn't this be optional behavior, which users should be
> able to control?  Standard C disallows '$' in identifiers AFAIK, and
> some users might wish to follow the Standard.

The thing is, such an option would be difficult to implement.  At the
moment, c-symbol-start and c-symbol-key (regular expressions which match
the start of an identifier and all of one) are calculated in cc-langs.el
at compilation time.  They are widely used (~40 times) in the indentation
engine and fontification.

It would be necessary to change these constants to variables, probably
doubling the number of relevant c-lang-const's in cc-langs.el, and to add
a mechanism to toggle between them at run time.

I don't feel that the benefit from this new option would really be worth
the work it would take to implement.  I don't think people are going to
be putting $ signs at the start of identifiers by accident.  CC Mode has
always fontified $s in the middle (or at the end) of identifiers, and
this doesn't seem to have caused problems.

-- 
Alan Mackenzie (Nuremberg, Germany).





reply via email to

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