Subject: bug#35454: 26.2.50; CC-Mode fontification fails inside macro

From: Alan Mackenzie <[email-masked]>
Date: Sat, 27 Apr 2019 20:36:46 +0000

Hello, Mauro.

On Sat, Apr 27, 2019 at 12:57:05 -0300, Mauro Aranda wrote:
> Hello.

> Steps to reproduce:
> 1) emacs -Q
> 2) Open up a new .c file:
> C-x C-f test.c
> 3) Type this text:
> #define FOO        \
>   /* Some comms.  */     \
>   struct foobar my_foo; \
>   struct foobar my_bar;

> The first struct foobar after the comment is not fontified as the second
> one.  That is, the second foobar has face font-lock-type-face, and
> my_bar has face font-lock-variable-name-face, but the first foobar and
> my_foo don't get those face values.

> I actually bumped into this issue while visiting the emacs source file
> src/editfns.c.  In that file, search for "#define EXTRA_CONTEXT_FIELDS"
> and the problem should be evident.

Thanks!  I can reproduce this easily, and will look into it in the next
day or two.

Of interest is the fact that if FOO is given an empty argument list
(i.e. one writes
    #define FOO()  \
    ...
), the bug doesn't happen.

> I can reproduce it with the latest Emacs 26, as well as with the latest
> master:
> Repository revision: 8dc00b2f1e6523c634df3e24379afbe712a32b27
> Repository branch: master

> Best regards,
> Mauro.

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).