GNU bug report logs - #63322
CC Mode 5.35.2 (C/*l); Various problems fontifying sfnt.c

Previous Next

Package: cc-mode;

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

Date: Sat, 6 May 2023 08:12: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 63322 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 63322 <at> debbugs.gnu.org
Subject: Re: bug#63322: CC Mode 5.35.2 (C/*l); Various problems fontifying
 sfnt.c
Date: Wed, 10 May 2023 10:55:29 +0000
[Message part 1 (text/plain, inline)]
Hello, Po.

Thanks for the bug report.

On Sat, May 06, 2023 at 16:11:25 +0800, Po Lu via CC-Mode-help wrote:
> Package: cc-mode

> Go to src/sfnt.c in the feature/android branch of Emacs.
> Type M-s o ^sfnt RET, then visit each of the following function
> definitions:

> sfnt_scale_by_freedom_vector
> sfnt_interpret_iup_1
> sfnt_interpret_font_program
> sfnt_interpret_control_value_program
> sfnt_interpret_simple_glyph
> sfnt_interpret_compound_glyph

> In each of these definitions, the identifier name is not fontified as a
> function!

Yes.  There were actually two distinct problems here, one trivial to
solve and the other difficult.

For most of these function names, you just need to add the macro name
"TEST_STATIC" to c-noise-macro-names, as is done in .dir-locals for some
other names, and is explained fully in the chapter "Noise Macros" in the
CC Mode manual.

For the other two function names, the problem was that they followed a
large chunk of CPP macros, bigger than a search limit for one of CC
Mode's backward searches.  The fix was to check for this possibility and
handle it.

Would you please do the usual with the enclosed patch (which should
apply cleanly to both the emacs-29 branch and master), and let me know
how well it works.  Thanks!

> Emacs  : GNU Emacs 29.0.90 (build 1, x86_64-pc-linux-gnu)
>  of 2023-04-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).

[diff.20230510.diff (text/plain, attachment)]

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

Previous Next


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