Subject: Re: bug#1913: Identifier after reserved word "raise" is not always highlighted in Ada-mode

From: Juanma Barranquero <[email-masked]>
Date: Fri, 16 Jan 2009 00:10:44 +0100

On Fri, Jan 16, 2009 at 00:03, Erik <[email-masked]> wrote:

> Actually I do notice the highlighting and take advantage of it as an
> early error detector. If it makes me notice an error immediately, before
> I move on to another part of the code or try to compile things, it is
> useful. If a word is not highlighted as expected when I have typed it, I
> automatically stop to see what I did wrong.

But we're not talking of something that is highlighted "when you move
to another part of the code"; more like "when you finish the next
token in the line".

> Did you have a performance problem with that regexp? I do not really
> believe that there is a reason to worry about it without some
> measurements. I have a 1.6 GHz CPU and want to take advantage of it. I
> think it should be able to recognize Ada identifiers as a type them.

I don't have a performance problem, but font-locking isn't the fastest
of Emacs features. You have a 1,6 GHz CPU; mine is fast, too. But
Emacs is used in all kinds of computers. That said, if you write a
patch to make the font-locking more correct without sacrificing
performance, I'm sure it'll be very welcome.

> The (?:) is equivalent to () but faster since it is a so-called
> non-capturing group, which should always be used when capturing is not
> needed. Maybe that helps?

Not really. Font-lock patterns have capturing groups for a reason
(that's what the 1, 2 in the next line refer to).

    Juanma