Subject: Re: bug#59032: CC Mode 5.35.1 (C/*l); Incorrect fontification of `subsurface' during typing

From: Alan Mackenzie <[email-masked]>
Date: Tue, 8 Nov 2022 15:01:36 +0000

Hello, Po.

> > On Sat, Nov 05, 2022 at 09:34:41 +0800, Po Lu via CC-Mode-help wrote:
> >> Package: cc-mode

> >> Start with the following code in a c-mode buffer:

> >> static struct test_subsurface *
> >> make_test_subsurface (void)
> >> {
> >>   struct test_subsurface *subsurface;

> >>   subsurface = malloc (sizeof *subsurface);

> >>   if (!subsurface)
> >>     goto error_1;

> >>   subsurface->surface
> >>     = wl_compositor_create_surface (display->compositor);

> >>   if (!subsurface->surface)
> >>     goto error_2;

> >>   subsurface->subsurface
> >>     = wl_subcompositor_get_subsurface (subcompositor,
> >> 				       wayland_surface,
> >> 				       display->surface);

> >>  error_2:
> >>   free (subsurface);
> >>  error_1:
> >>   return NULL;
> >> }

> >> move point to the end of the line before "error_2".  Type:

> >>   s u b s u r f a c e - >

> >> then, hesitate for 1 second, and type:

> >>   <backspace> <backspace>

> >> wait 1 more second, then type:

> >>   <up>

> >> every occurrence of "subsurface" above will become fontified as a type,
> >> and will be stuck that way until you make an edit above that occurrence.

The bug is now fixed.  I'm closing it with this post.

-- 
Alan Mackenzie (Nuremberg, Germany).