Subject: bug#2490: compilation only highlights the "E" of error

From: Johan Bockgård <[email-masked]>
Date: Tue, 12 Jul 2011 16:42:58 +0200

Lars Magne Ingebrigtsen <[email-masked]> writes:

> Johan Bockgård <[email-masked]> writes:
>
>> font-lock-keywords -> compilation--ensure-parse ->
>> compilation--parse-region -> compilation-parse-errors ->
>> compilation-error-regexp-alist-alist
>>
>> The lines in *Compile-Log* are matched by the `gnu' entry in
>> compilation-error-regexp-alist-alist (try `compilation-debug'):
>
> Thanks for finding this.  I've now installed a patch that seems to fix
> the bug.

The compiler output is classified as error/warning/info based on which
part of the expression that matched (see compilation-error-regexp-alist).
Your change marks "...:Error" as a warning:

--- a/lisp/progmodes/compile.el	2011-07-05 15:31:22 +0000
+++ b/lisp/progmodes/compile.el	2011-07-12 12:28:35 +0000
@@ -251,7 +251,7 @@
 \\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\): ?\
 \\([0-9]+\\)\\(?:[.:]\\([0-9]+\\)\\)?\
 \\(?:-\\([0-9]+\\)?\\(?:\\.\\([0-9]+\\)\\)?\\)?:\
-\\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\
+\\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\|[Ee]rror\\)\\|\
  *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\|[Nn]ote\\)\\|\
 \[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)"
      1 (2 . 4) (3 . 5) (6 . 7))
                         ^^^^^

6th subexpression matches => warning
7th subexpression matches => info
otherwise => error

I installed this patch instead:

=== modified file 'lisp/progmodes/compile.el'
--- lisp/progmodes/compile.el	2011-07-05 15:31:22 +0000
+++ lisp/progmodes/compile.el	2011-07-12 14:14:25 +0000
@@ -253,7 +253,7 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?
 \\(?:-\\([0-9]+\\)?\\(?:\\.\\([0-9]+\\)\\)?\\)?:\
 \\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\
  *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\|[Nn]ote\\)\\|\
-\[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)"
+ *[Ee]rror\\|\[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)"
      1 (2 . 4) (3 . 5) (6 . 7))