Hello, Po. On Tue, Nov 29, 2022 at 15:08:15 +0800, Po Lu via CC-Mode-help wrote: > Package: cc-mode > Insert the following code in a buffer: > /* fns.c -- generic utility functions. */ > /* Allocate a scratch buffer with the given size. The buffer must be > used before the next call to allocscratch. */ > static void * > allocscratch (size_t size) > { > } > now, on the line below the first comment, type: > typedef struct foo > then pause for a second, and type: > bar; > c-found-types will then contain "allocscratch"!. Yes. This is not good. Please try out the attached patch which applies cleanly to the release branch (and almost certainly to the master branch too). This should fix the problem, in that although "allocscratch" gets entered into c-found-types, it gets removed again as soon as a type and declarator are typed in after the typedef. > Emacs : GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu) > of 2022-11-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).