GNU bug report logs - #59032
CC Mode 5.35.1 (C/*l); Incorrect fontification of `subsurface' during typing

Previous Next

Package: cc-mode;

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

Date: Sat, 5 Nov 2022 01:36:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 59032 <at> debbugs.gnu.org
Subject: bug#59032: CC Mode 5.35.1 (C/*l); Incorrect fontification of `subsurface' during typing
Date: Mon, 7 Nov 2022 20:49:34 +0000
Hello, Po.

Thanks for yet another bug.

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.

I have a fix for this, I think, but it overlaps with an earlier fix to
bug #58883.  I sent you a patch on Sunday 2022-10-30 for this earlier
bug.  Did you get this patch?  If so, have you any reaction to it?

It would help me keep things straight if we could commit that patch to
#58883, and then create another patch for the current bug.

Thanks!

> Emacs  : GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu)
>  of 2022-10-29
> Package: CC Mode 5.35.1 (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 199 days ago.

Previous Next


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