[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Dealing with "gnu" rule in compilation-error-regexp-alist
From: |
Wilson Snyder |
Subject: |
Dealing with "gnu" rule in compilation-error-regexp-alist |
Date: |
Thu, 15 Apr 2010 07:21:10 -0400 (EDT) |
I'm trying to debug a problem with a compile error regexp. An
example is below; the highlighting may look correct, but
next-error will bring you to the wrong filename. (I'm using the
HEAD, but the same issue exists since Emacs 21.)
What's going on is the "gnu" rule is trumping the "percent" rule
- if you look at the comments for the "gnu" rule in compile.el,
it been hacked to reduce aggressiveness several times before.
What do people suggest to work around this problem? 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. Likewise
tweaking the "gnu" rule makes a mess, as there's really several
regexps causing the 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).
Thanks
(setq compilation-error-regexp-alist-alist
(append
'((percent "%?\\(Error\\|Warning\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):"
2 3))
compilation-error-regexp-alist-alist))
;; Ok
(setq compilation-error-regexp-alist '(percent))
(compile "echo 'zz: %Error: foo.x:1: something'")
(compile "echo '%Error: foo.x:1: something'")
;; Bad
(setq compilation-error-regexp-alist '(gnu percent))
(compile "echo 'zz: %Error: foo.x:1: something'")
;; Bad
(setq compilation-error-regexp-alist '(percent gnu))
(compile "echo 'zz: %Error: foo.x:1: something'")
- Dealing with "gnu" rule in compilation-error-regexp-alist,
Wilson Snyder <=