From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>, Joseph Garvin <k04jg02@gmail.com>
Cc: luangruo@yahoo.com, acm@muc.de, 64204-done@debbugs.gnu.org
Subject: bug#64204: C/C++ local variables not syntax highlighted if they start with $
Date: Wed, 28 Jun 2023 18:45:09 +0000 [thread overview]
Message-ID: <ZJx_tZu8KmhZvbWG@ACM> (raw)
In-Reply-To: <83wmzv3iu0.fsf@gnu.org>
Hello, Joseph and Eli.
On Thu, Jun 22, 2023 at 13:13:59 +0300, Eli Zaretskii wrote:
> > Date: Thu, 22 Jun 2023 09:11:38 +0000
> > Cc: luangruo@yahoo.com, 64204@debbugs.gnu.org
> > From: Alan Mackenzie <acm@muc.de>
> > > 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 do feel it's worth the effort. If we value correct fontification,
> of course. I don't know what my opinions on this mean for you, but
> there you have it. I cannot force you make this change, of course, I
> can only try to convince.
:-) OK, the fontification of identifiers with $ is now working. By
default they are fontified as normal identifiers (i.e. with
font-lock-type-face, font-lock-variable-name-face, or
font-lock-function-name-face), but if the (new) customisable option
c-warn-ids-with-dollar is set to non-nil, font-lock-warning-face is used
instead. The above applies only to C, C++, and Objective C Modes, and to
any derived modes which enable the mechanism.
So, I'm closing the bug now with this post.
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2023-06-28 18:45 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-20 20:54 bug#64204: C/C++ local variables not syntax highlighted if they start with $ Joseph Garvin
2023-06-21 11:51 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-21 19:25 ` Alan Mackenzie
2023-06-21 21:06 ` Alan Mackenzie
2023-06-22 4:50 ` Eli Zaretskii
2023-06-22 5:44 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-22 5:57 ` Eli Zaretskii
2023-06-22 6:18 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-22 6:55 ` Eli Zaretskii
2023-06-22 7:15 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-22 10:07 ` Eli Zaretskii
2023-06-22 11:46 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-22 12:00 ` Eli Zaretskii
2023-06-22 13:20 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-22 9:11 ` Alan Mackenzie
2023-06-22 10:13 ` Eli Zaretskii
2023-06-22 12:33 ` Alan Mackenzie
2023-06-28 18:45 ` Alan Mackenzie [this message]
2023-06-28 18:50 ` Eli Zaretskii
2023-06-28 23:19 ` Joseph Garvin
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=ZJx_tZu8KmhZvbWG@ACM \
--to=acm@muc.de \
--cc=64204-done@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=k04jg02@gmail.com \
--cc=luangruo@yahoo.com \
/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).