Subject: bug#10652: font-lock very slow for C++

From: Toon Claes <[email-masked]>
Date: Mon, 02 Apr 2012 09:48:12 +0200

Hi Alan, 

emacs hangs for hours. Luckily it only used one of my 4
processor cores, so I could leave it loading in the background. 

This
is what I've done: 

Open the file, in c++-mode, and scroll to
end-of-buffer (M->). The mouse cursor starts spinning, but the end of
buffer is not shown. 

When I press C-g three times, the end of the
buffer is shown. The fontification looks correct. 

When I go back to
beginning-of-buffer, same problem. 

When I press M->, M-< several
times, I cannot recover with C-g and I need to kill emacs:-( 

isearch
works fine with font-lock-mode disabled. 

Even, depending on the
position in the buffer, it happens the command M-x font-lock-mode gives
the spinning mouse cursor. Again 3x C-g solves this. 

So I can say
pretty sure, font-lock-mode is causing the "delay". 

I've tested again
with the bazaar version of last friday. 

My test file contains
something like this: 

 int ClassName::MethodAbc(void) 

 { 

SOME_PRETEST_MACRO; 

 return TranslateResult(LibFunctionAbc(m_Member));

 } 

And this repeated for something like 20 times (of course with
different names, and with different parameters). 

The macro is
something like: 

 #define SOME_PRETEST_MACRO if (!Ready()) return -1;

With this test file, I could easily reproduce the problem. 

I hope
this can help investigating the issue. 

Toon 

On 2012-03-30 00:00,
Alan Mackenzie wrote: 

> Hello, Toon.
> On Thu, Mar 29, 2012 at
09:46:03PM +0200, Toon Claes wrote:
>> Hi Alan,
>> About: (i) yes
I've tried that, emacs -Q didn't make a difference
> Worth knowing