From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#64204: C/C++ local variables not syntax highlighted if they start with $ Date: Wed, 21 Jun 2023 21:06:37 +0000 Message-ID: References: <87edm52fu1.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="WSR0cPEg5Vb5sk+9" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37232"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, 64204@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 21 23:07: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 1qC52s-0009VG-8w for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Jun 2023 23:07:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qC52e-00030B-Vs; Wed, 21 Jun 2023 17:07:05 -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 1qC52c-000301-Q0 for bug-gnu-emacs@gnu.org; Wed, 21 Jun 2023 17:07: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 1qC52c-0005mi-Hm for bug-gnu-emacs@gnu.org; Wed, 21 Jun 2023 17:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qC52b-0003Se-SM for bug-gnu-emacs@gnu.org; Wed, 21 Jun 2023 17:07:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Jun 2023 21:07:01 +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.168738160613280 (code B ref 64204); Wed, 21 Jun 2023 21:07:01 +0000 Original-Received: (at 64204) by debbugs.gnu.org; 21 Jun 2023 21:06:46 +0000 Original-Received: from localhost ([127.0.0.1]:34304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qC52M-0003S8-Bw for submit@debbugs.gnu.org; Wed, 21 Jun 2023 17:06:46 -0400 Original-Received: from mx3.muc.de ([193.149.48.5]:36778) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qC52L-0003Rv-0q for 64204@debbugs.gnu.org; Wed, 21 Jun 2023 17:06:45 -0400 Original-Received: (qmail 5444 invoked by uid 3782); 21 Jun 2023 23:06:37 +0200 Original-Received: from acm.muc.de (pd953aea6.dip0.t-ipconnect.de [217.83.174.166]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 21 Jun 2023 23:06:37 +0200 Original-Received: (qmail 15079 invoked by uid 1000); 21 Jun 2023 21:06:37 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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:263848 Archived-At: --WSR0cPEg5Vb5sk+9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, Po. 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. On Wed, Jun 21, 2023 at 19:25:41 +0000, Alan Mackenzie wrote: > On Wed, Jun 21, 2023 at 19:51:50 +0800, Po Lu wrote: > > Joseph Garvin writes: [ .... ] > OK, I've amended C Mode, C++ Mode and Objective C Mode to fontify > identifiers starting with a $. > Please apply the patch below to .../lisp/progmodes/cc-langs.el, and > (since Lisp macros have been changed) recompile the entire CC Mode files > and reload them. (Joseph, if you want any help with the patching or > compiling, feel free to send me private email.) Then please try out the > new version on your real code, and confirm to me that the bug has been > fixed, or tell me what's still wrong. > Thanks! [ .... ] -- Alan Mackenzie (Nuremberg, Germany). --WSR0cPEg5Vb5sk+9 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="diff.20230621b.diff" diff -r c45cc2208ed4 cc-langs.el --- a/cc-langs.el Wed Jun 21 14:58:04 2023 +0000 +++ b/cc-langs.el Wed Jun 21 19:14:40 2023 +0000 @@ -819,8 +819,9 @@ keyword. It's unspecified how far it matches. Does not contain a \\| operator at the top level." t (concat "[" c-alpha "_]") + (c c++) (concat "[" c-alpha "_$]") java (concat "[" c-alpha "_@]") - objc (concat "[" c-alpha "_@]") + objc (concat "[" c-alpha "_@$]") pike (concat "[" c-alpha "_`]")) (c-lang-defvar c-symbol-start (c-lang-const c-symbol-start)) @@ -844,9 +845,10 @@ t (concat (c-lang-const c-symbol-start) "[" (c-lang-const c-symbol-chars) "]\\{,1000\\}") pike (concat - ;; Use the value from C here since the operator backquote is + ;; Use the value from AWK here since the operator backquote is ;; covered by the other alternative. - (c-lang-const c-symbol-key c) + (c-lang-const c-symbol-key awk + ) "\\|" (c-make-keywords-re nil (c-lang-const c-overloadable-operators)))) --WSR0cPEg5Vb5sk+9--