[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dealing with "gnu" rule in compilation-error-regexp-alist
From: |
Stefan Monnier |
Subject: |
Re: Dealing with "gnu" rule in compilation-error-regexp-alist |
Date: |
Thu, 15 Apr 2010 14:54:31 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
> What do people suggest to work around this problem?
The Right Way is to get the tool to use the GNU format for its
error messages.
> When compile is called from inside the package-mode's buffer it could
> subtract "gnu" from compilation-error-regexp-alist, but that seems
> very unfriendly, and hard for users to debug.
Not knowing how your "package-mode" is typically used, I can't judge
whether messages from other tools are likely to appear there as well.
> Likewise tweaking the "gnu" rule makes a mess, as there's really
> several regexps causing the problem.
The patch below tweaks it in a way which seems to solve your problem.
> The solution needs to work with the already released versions of
> Emacs too.
;-)
> Long term, I think it would be good have some sort of
> ordering or priority to the rules; "gnu" being low priority,
> without breaking the later fontification rules (why these
> rules "append" now).
Supposedly there is such a priority based on ordering.
> (setq compilation-error-regexp-alist '(percent gnu))
> (compile "echo 'zz: %Error: foo.x:1: something'")
E.g. from what I understand the above *should* work, so there's maybe
a bug lurking here.
Stefan
=== modified file 'lisp/progmodes/compile.el'
--- lisp/progmodes/compile.el 2010-04-11 03:41:47 +0000
+++ lisp/progmodes/compile.el 2010-04-15 18:44:06 +0000
@@ -253,9 +253,9 @@
;; The core of the regexp is the one with *?. It says that a file name
;; can be composed of any non-newline char, but it also rules out some
;; valid but unlikely cases, such as a trailing space or a space
- ;; followed by a -.
+ ;; followed by a -, or a colon followed by a space.
"^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\)?\
-\\([0-9]*[^0-9\n]\\(?:[^\n ]\\| [^-/\n]\\)*?\\): ?\
+\\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\): ?\
\\([0-9]+\\)\\(?:\\([.:]\\)\\([0-9]+\\)\\)?\
\\(?:-\\([0-9]+\\)?\\(?:\\.\\([0-9]+\\)\\)?\\)?:\
\\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\