GNU bug report logs - #1913
Identifier after reserved word "raise" is not always highlighted in Ada-mode

Previous Next

Package: emacs;

Reported by: Erik <esigra <at> gmail.com>

Date: Thu, 15 Jan 2009 08:05:05 UTC

Severity: minor

Done: Stephen Leake <stephen_leake <at> stephe-leake.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Erik <esigra <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 1913 <at> debbugs.gnu.org
Subject: bug#1913: Identifier after reserved word "raise" is not always highlighted in Ada-mode
Date: Fri, 16 Jan 2009 00:03:13 +0100
Juanma Barranquero skrev:
> On Thu, Jan 15, 2009 at 14:40, Erik <esigra <at> gmail.com> wrote:
>
>   
>> The patch is an improvement, but it highlights some illegal identifiers.
>>     
>
> That shouldn't be a problem. You don't use font-locking to determine
> whether the identifier follows Ada rules, do you? :-)
>   

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.


>> (no leading, consecutive or trailing '_')
>>     
>
> Yes, I know the spec. But I don't think the problem of false positives
> is worth making the regexp slower.
>   

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.

The regexp guru that I once talked with suggested this:
[[:alpha:]](?:_?[^\W_])*

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?


>> There seems to be a lot of places with a-z in ada-mode.el.
>>     
>
> Yes. I suppose Stephen will welcome patches, assuming they are correct.
>
> Are you aware of the Emacs ada-mode hompage
>
>   http://www.stephe-leake.org/emacs/ada-mode/emacs-ada-mode.html
>
> and list
>
>   http://stephe-leake.org/mailman/listinfo/emacs-ada-mode_stephe-leake.org
>
> ?
>   

No, I just subscribed now, thanks. If I make any changes I will send it
there.




This bug report was last modified 4 years and 330 days ago.

Previous Next


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