From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: wsnyder@wsnyder.org (Wilson Snyder)
Cc: emacs-devel@gnu.org
Subject: Re: Dealing with "gnu" rule in compilation-error-regexp-alist
Date: Thu, 15 Apr 2010 14:54:31 -0400 [thread overview]
Message-ID: <jwv4ojck1mb.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20100415112110.68C97188395@wsnyder.org> (Wilson Snyder's message of "Thu, 15 Apr 2010 07:21:10 -0400 (EDT)")
> 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:\\)\\|\
prev parent reply other threads:[~2010-04-15 18:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-15 11:21 Dealing with "gnu" rule in compilation-error-regexp-alist Wilson Snyder
2010-04-15 15:18 ` Chong Yidong
2010-04-15 15:26 ` Wilson Snyder
2010-04-15 18:54 ` Stefan Monnier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv4ojck1mb.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=wsnyder@wsnyder.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).