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

From: "Juanma Barranquero" <[email-masked]>
Date: Thu, 15 Jan 2009 10:12:38 +0100

On Thu, Jan 15, 2009 at 08:59, Erik <[email-masked]> wrote:

> So how should I tell the highlighter that the file is
> Ada95 or Ada2005 (and not Ada83)? I think that emacs should assume that
> the file is not Ada83 if a non-ASCII character is used in an identifier.

It's not that the Ada mode is assuming any specific version. There's a
variable `ada-language-version', but it just affects which keywords
are recognized as such. The problem is simply that some of the regexps
were written in the ASCII-only era and have not been updated.

Try the following patch, which should fix this particular case. I'll
bring the issue to the Ada mode maintainer for a more permanent fix.

    Juanma

Index: lisp/progmodes/ada-mode.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/ada-mode.el,v
retrieving revision 1.101
diff -u -2 -r1.101 ada-mode.el
--- lisp/progmodes/ada-mode.el	9 Jan 2009 04:15:56 -0000	1.101
+++ lisp/progmodes/ada-mode.el	15 Jan 2009 09:05:02 -0000
@@ -5224,5 +5224,5 @@
      ;; correctly highlight a with_clause that spans multiple lines.
      (list (concat "\\<\\(goto\\|raise\\|use\\|with\\)"
-		   "[ \t]+\\([a-zA-Z0-9_., \t]+\\)\\W")
+		   "[ \t]+\\([[:alnum:]_., \t]+\\)\\W")
 	   '(1 font-lock-keyword-face) '(2 font-lock-reference-face nil t))