GNU bug report logs - #61135
CC Mode 5.35.2 (C/*l); Incorrect fontification of function call

Previous Next

Package: cc-mode;

Reported by: Po Lu <luangruo <at> yahoo.com>

Date: Sun, 29 Jan 2023 05:57:02 UTC

Severity: normal

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 61135 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 61135 <at> debbugs.gnu.org
Subject: Re: bug#61135: CC Mode 5.35.2 (C/*l); Incorrect fontification of
 function call
Date: Mon, 30 Jan 2023 20:23:45 +0000
Hello, Po.

On Sun, Jan 29, 2023 at 13:55:50 +0800, Po Lu via CC-Mode-help wrote:
> Package: cc-mode

> Insert the following text in a C Mode buffer:

> static const char *
> sfnt_interpret_font_program (struct sfnt_interpreter *interpreter,
> 			     struct sfnt_font_program *fpgm)
> {
>   if (setjmp (interpreter->trap))
>     return interpreter->trap_reason;

>   /* Set up the interpreter to evaluate the font program.  */
>   interpreter->PC = 0;
>   interpreter->SP = interpreter->stack;
>   interpreter->instructions = fpgm->instructions;
>   interpreter->num_instructions = fpgm->num_instructions;

>   sfnt_interpret_run (interpreter, SFNT_RUN_CONTEXT_FONT_PROGRAM);
> }

> `sfnt_interpret_run' will be fontified in font-lock-function-name-face,
> which is not how CC Mode usually works.  Thanks.

This bug was triggered by the string "struct" in fpgm->inSTRUCTions and
fpgm->num_inSTRUCTions.  It would also have been triggered by either of
"union" or "extern".  There was a regexp which was lacking a "\\>"
element for "match end of word".  ("\\_>" is unavailable on XEmacs.).

I've fixed the macro which generates that regexp and committed the
change to the release branch.  Would you please update your Emacs, and
confirm that the bug has indeed been fixed.  Thanks!

> Emacs  : GNU Emacs 30.0.50 (build 41, x86_64-pc-linux-gnu)
>  of 2023-01-29
> Package: CC Mode 5.35.2 (C/*l)
> Buffer Style: gnu
> c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-string-delim gen-comment-delim syntax-properties category-properties 1-bit)

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 2 years and 169 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.