From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#64204: C/C++ local variables not syntax highlighted if they start with $ Date: Wed, 21 Jun 2023 19:51:50 +0800 Message-ID: <87edm52fu1.fsf@yahoo.com> References: Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12766"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Alan Mackenzie , 64204@debbugs.gnu.org To: Joseph Garvin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 21 13:53:18 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qBwOk-00037U-By for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Jun 2023 13:53:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qBwOV-0005BS-Tx; Wed, 21 Jun 2023 07:53:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qBwOU-00057A-Hg for bug-gnu-emacs@gnu.org; Wed, 21 Jun 2023 07:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qBwOU-0005F5-8N for bug-gnu-emacs@gnu.org; Wed, 21 Jun 2023 07:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qBwOU-0004h6-4U for bug-gnu-emacs@gnu.org; Wed, 21 Jun 2023 07:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Jun 2023 11:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64204 X-GNU-PR-Package: emacs Original-Received: via spool by 64204-submit@debbugs.gnu.org id=B64204.168734832717984 (code B ref 64204); Wed, 21 Jun 2023 11:53:02 +0000 Original-Received: (at 64204) by debbugs.gnu.org; 21 Jun 2023 11:52:07 +0000 Original-Received: from localhost ([127.0.0.1]:60808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBwNb-0004fz-Fu for submit@debbugs.gnu.org; Wed, 21 Jun 2023 07:52:07 -0400 Original-Received: from sonic306-20.consmr.mail.ne1.yahoo.com ([66.163.189.82]:41465) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBwNY-0004fU-Ux for 64204@debbugs.gnu.org; Wed, 21 Jun 2023 07:52:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1687348318; bh=FngHUd5hwsviZ5X0RYJQOJCLvylu0XO5tlvCaFCquH0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=sCt4v+1NMT+PupH/YPQCEHVRFFQ0a/MehQ6ttLuIfXECp5HoGjOyY3KXH4WMajj2XNQhGhvom/K9Uhs3Od3HSStvlbhC3/7k/RBVTcsTN0BRIURA95k0bNnXeacwSeH7neNzPu4B/1JiXYq/pEVCq4HiIq9PzFrcxcfF0FJmbd35UFSAK0HSAd05ERYuNv7+NYYyY2gJv9Lt5f47AweGU53YH9Ocu7Jda4QN7TR7RHH5pTUip0gmYsivkoQrn1p2C1uDetkHFGHDw6P6IkoAAg3G3IwerduU/TTvxgqbWg03vL5lqd7ECDTR/tdd6EqNrs6uI4jBJRgkdPG3m/d2Yw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1687348318; bh=t8dDrp4Ear5dt1dQHM69xJqqKSdFb3WoLWSgAuREPen=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=rss2+4Z8mGUGyiCEm6aM7Ky1+QboNohbxAncYBuSvp8mO5XcvSccSrsUDPdFErce5Td9tLfQgjf5r6tTStufhreVLyDY2HNUkxLEmpXo52A/monhi3/+rPatDy7VoMCPK1gHcTG1S39YJH6ysCKBCtJFUf3BrwgHbh6bszgQKpMn956QfeuCLSwBVyIW3nZs/xKJR7fNW3J7L15BoKleSTXfWAgJC2vtzURWlVtGRKg1H9PH6XJ2t/B41hMwHcFVVNr+wvd/YOQ1BbD0YMS4p2mretRdTd05XUBHXdLKnLm2tyPDeyqOT/XkYFD9t/anQ97OduB+oHErGa9NH2c77w== X-YMail-OSG: SHayCXkVM1kwLWs5dIA15X5OLQB0HXR7tI8e1OqCg2nxB5UmnEmefwV9zGv27mz DoRnF2ZjuAnunczSJhmHdCN65BwdjyTS5myQHgPUhR0AYTxR9J9WmmK5B32T58gGYBfbTmATbeZF s6S23QkQ4xNCER02z8DvqQUumCt6Fh2DVtNZgPDEj90QUL_2TfNm.ysNIK1h6G9E1U.eG31uruy8 caW6w4a2PuMNdKEaPAD5YyUG3ZJXHPnNK32ZZZ0tGalLc.CJSLLEKXoj_1Qq5Lzt8m4XWvXiJA5H qJyKgSrR51hFe6oKkFrY8kVbOh.1zzcCrGpXL5o.Ee_AGNGRsB9XwXUPYhyVUhxHMDzX1xPyTeMz bMRFjtP1r2vyYo_AEHSkdOo6XT6cIbibnXg.2TUBGojM8TDoOs9OrZsVGJ6H64EtTNUNS_R8hWuV fkUoHZl4OHsMEPn9IIQAmYAQOHuYaqnhmeqadrAa.L_nyZ.xWraP.MCYcWL5OfqO.8Crqcfe3u_H 8UaSRIzA5HglCGQIz52httpZpHaOJhvq.aWXBSnWr__lpCRdsWK6kM4WUBnlYZKQM1JPHEdzHjLd _0iUgBijxSoqFr1MtABfVyby5DLkXFPwpY8_iESCcfBiG6tzFwMHl6tFgGunoXcXuifKahyQIzF. MBkLLJZMgyrm50D36n5BZs7Wc3D_1Ah1bfCeHkxy5_9PNnrXcos5WW2dYPVEySOVO6U_pJ12rvAi Z3UFgZBFXPFc14oY4eZJCxCW.2uBoLxlxzZSmFnE3C0cRKM5nO9GZeLjb8UZIuPka7YAxhu1O8bf hDNIVvqN8PecH9R6OA7ovj6KjkGl4XquHxcOsoeQ_L X-Sonic-MF: X-Sonic-ID: be25f04c-eb13-4752-8d63-053b0e701f69 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Wed, 21 Jun 2023 11:51:58 +0000 Original-Received: by hermes--production-sg3-748897c457-q47mh (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 650f0311feb92d268a13059005dbbad8; Wed, 21 Jun 2023 11:51:55 +0000 (UTC) In-Reply-To: (Joseph Garvin's message of "Tue, 20 Jun 2023 15:54:52 -0500") X-Mailer: WebService/1.1.21557 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:263806 Archived-At: Joseph Garvin writes: > 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. This is a bug indeed. Alan, would you please look into this?