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#52796: 28.0.90; Incorrect CC Mode fontification in frame.c Date: Tue, 28 Dec 2021 20:30:18 +0000 Message-ID: References: <831r20r1b6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1953"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52796@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 28 21:31:11 2021 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 1n2J7m-0000It-6A for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Dec 2021 21:31:10 +0100 Original-Received: from localhost ([::1]:34878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2J7l-00045Z-9k for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Dec 2021 15:31:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2J7e-00044E-AM for bug-gnu-emacs@gnu.org; Tue, 28 Dec 2021 15:31:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35988) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2J7e-0003XH-0s for bug-gnu-emacs@gnu.org; Tue, 28 Dec 2021 15:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n2J7d-00048K-Ut for bug-gnu-emacs@gnu.org; Tue, 28 Dec 2021 15:31:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Dec 2021 20:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52796 X-GNU-PR-Package: emacs Original-Received: via spool by 52796-submit@debbugs.gnu.org id=B52796.164072342715844 (code B ref 52796); Tue, 28 Dec 2021 20:31:01 +0000 Original-Received: (at 52796) by debbugs.gnu.org; 28 Dec 2021 20:30:27 +0000 Original-Received: from localhost ([127.0.0.1]:47534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2J74-00047U-UK for submit@debbugs.gnu.org; Tue, 28 Dec 2021 15:30:27 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:25201 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1n2J73-00047I-K4 for 52796@debbugs.gnu.org; Tue, 28 Dec 2021 15:30:26 -0500 Original-Received: (qmail 26074 invoked by uid 3782); 28 Dec 2021 20:30:19 -0000 Original-Received: from acm.muc.de (p4fe1552f.dip0.t-ipconnect.de [79.225.85.47]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 28 Dec 2021 21:30:19 +0100 Original-Received: (qmail 7622 invoked by uid 1000); 28 Dec 2021 20:30:18 -0000 Content-Disposition: inline In-Reply-To: <831r20r1b6.fsf@gnu.org> 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" Xref: news.gmane.io gmane.emacs.bugs:223286 Archived-At: Hello, Eli. On Sat, Dec 25, 2021 at 20:23:25 +0200, Eli Zaretskii wrote: > From: eliz@HOME-C4E4A596F7.mail-host-address-is-not-set > --text follows this line-- > To reproduce: > emacs -Q > C-x C-f src/frame.c > C-u 1262 M-g g > Observe a bunch of function and macro calls fontified as if they were > function names in function definitions. For example, the call to > create_tty_output, init_frame_faces, and (some) calls of FRAME_LINES. Sorry about that. There was an error in a cache, the cache that tracks whether or not braces are at the top level. In particular, this error was triggered by the first "struct" keyword in static struct frame * make_terminal_frame (struct terminal *terminal) { where it was failing to recognise the "*" as "cancelling" the expectation of braces as part of the struct construct. The patch below should fix the problem. If you want to try it out, please do. Otherwise I'll commit it to the release branch if I don't hear from you within a few days. > In GNU Emacs 28.0.90 (build 35, i686-pc-mingw32) > of 2021-12-25 built on HOME-C4E4A596F7 > Repository revision: c09ad0cabde922374c1a34350595a3141ab7f806 > Repository branch: emacs-28 > Windowing system distributor 'Microsoft Corp.', version 5.1.2600 > System Description: Microsoft Windows XP Service Pack 3 (v5.1.0.2600) [ .... ] diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index d37a50997a..d289148874 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -6139,7 +6139,7 @@ c-update-brace-stack (setq s (cons -1 (cdr s)))) ((and (equal match ",") (eq (car s) -1))) ; at "," in "class foo : bar, ..." - ((member match '(";" "," ")")) + ((member match '(";" "*" "," "(")) (when (and s (cdr s) (<= (car s) 0)) (setq s (cdr s)))) ((c-keyword-member kwd-sym 'c-flat-decl-block-kwds) diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 53f6206a82..85cc887110 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -3180,8 +3180,8 @@ c-populate-syntax-table (append (c-lang-const c-flat-decl-block-kwds) (if (c-lang-const c-recognize-<>-arglists) - '("{" "}" ";" "," ")" ":" "<") - '("{" "}" ";" "," ")" ":"))))) + '("{" "}" ";" "*" "," ")" ":" "<") + '("{" "}" ";" "*" "," ")" ":"))))) (c-lang-defvar c-brace-stack-thing-key (c-lang-const c-brace-stack-thing-key)) (c-lang-defconst c-brace-stack-no-semi-key -- Alan Mackenzie (Nuremberg, Germany).