From: Joseph Garvin <k04jg02@gmail.com>
To: 64204@debbugs.gnu.org
Subject: bug#64204: C/C++ local variables not syntax highlighted if they start with $
Date: Tue, 20 Jun 2023 15:54:52 -0500 [thread overview]
Message-ID: <CAH=MJ4YM7z=vNa1ZFBHXyaNyW+p=J0uzm8LsEwqj1ZVK_THQ_A@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]
Start emacs with `emacs -Q`, press C-x C-f and type in a filename that
ends in .cpp like "foo.cpp". Then type in:
int main()
{
int a = 0;
int b = 0;
int $ = 0;
int d$ = 0;
int $e = 0;
}
Yes it compiles! GCC, Clang, and MSVC all have a non-standard
extension that allows $ signs to appear in C/C++ variable and type
names: https://gcc.gnu.org/onlinedocs/gcc/Dollar-Signs.html
Then a,b,d$ will be highlighted correctly as local vars, but not $ or
$e. The highlighting doesn't appear to work whenever $ is the first or
only character. Since emacs is accepting of the $ sign anywhere else in
the variable name, I suspect supporting $ was intended, even though it's
non-standard. Even if not intended, it's a popular syntax
extension supported by the major current compilers and whose history
goes back to the DEC compiler, so support would be nice.
In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.16.0, Xaw3d scroll bars)
of 2021-05-14 built on eruv
Repository revision: efc24f1e0bb127481bcc9c3054c57c4cd3c99aa9
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 20.04.6 LTS
[-- Attachment #2: Type: text/html, Size: 1443 bytes --]
next reply other threads:[~2023-06-20 20:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-20 20:54 Joseph Garvin [this message]
2023-06-21 11:51 ` bug#64204: C/C++ local variables not syntax highlighted if they start with $ 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
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='CAH=MJ4YM7z=vNa1ZFBHXyaNyW+p=J0uzm8LsEwqj1ZVK_THQ_A@mail.gmail.com' \
--to=k04jg02@gmail.com \
--cc=64204@debbugs.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 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).