bug#58883:

Alan Mackenzie <[email protected]> Fri, 18 Nov 2022 22:03:47 +0000
Newsgroups gmane.emacs.cc-mode.general
Message-ID <Y3gBQ9krNSIoix40@ACM>
Hello, Po.

On Fri, Nov 18, 2022 at 09:53:43 +0800, Po Lu wrote:
> Po Lu <[email protected]> writes:

> > Thanks!  This seems to be working very well.

> > Unfortunately, there is one small problem: editing inside an identifier
> > name becomes a little sluggish: if you go down to `x_initialize' (in
> > xterm.c), type "int", TAB, and hold down "ddddddddddddddddddddddd" on
> > any line, you will see Emacs slow down to a crawl.

> > That seems to only be a problem in big files, however.

> Big problem: trying to edit in a string literal in a big file results is
> very slow.  Quitting reveals the following call stack:

> Debugger entered--entering a function:
> * re-search-forward("[[:alpha:]_]" 25554 bound)
>   c-unfind-tokens-in-region(1 25554)
>   c-before-change(1 25554)
>   c-after-change(25546 25547 0)
>   self-insert-command(1 100)
>   funcall-interactively(self-insert-command 1 100)
>   command-execute(self-insert-command)

Yes, that is a big problem.  Apologies that the patch was not very good.
I'll be looking at it over the coming days, and hope to produce a
properly working version in that sort of timescale.  Please regard the
patch as a mere proof of concept, that the bug _can_ be fixed, rather
than the fix itself.

> here is some text to reproduce the problem.  Insert the following text
> in a c-mode buffer:

Thanks for that.  I can reproduce all the problems.

[ .... ]

> Thanks.

-- 
Alan Mackenzie (Nuremberg, Germany).