From: Eli Zaretskii <eliz@gnu.org>
To: emacs-devel@gnu.org
Subject: Order of associations in compilation-error-regexp-alist-alist
Date: Mon, 24 Sep 2012 08:28:52 +0200 [thread overview]
Message-ID: <83a9wgj5nf.fsf@gnu.org> (raw)
What's the deal with the significance of the order of associations in
compilation-error-regexp-alist-alist? I don't see that mentioned
anywhere, and yet matching by next-error clearly follows that order,
by virtue of mapcar in compilation-error-regexp-alist. This means
that if an error message matches more than one regexp there, the first
one wins.
Am I missing something? Are users expected to modify the order by
customizing compilation-error-regexp-alist, or is it supposed to work
correctly out of the box for all the compilers already in the list?
If the latter, how do we make sure only the correct regexp matches?
A colleague came up to me complaining that Emacs no longer gleans the
file name from the error messages emitted by the Microsoft compiler
that comes with Visual Studio 2010. It turned out that the cause was
that the blank marked below with "^=====" no longer exists in the
newer compiler's messages:
(msft
;; The message may be a "warning", "error", or "fatal error" with
;; an error code, or "see declaration of" without an error code.
"^ *\\([0-9]+>\\)?\\(\\(?:[a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) \
: \\(?:see declaration\\|\\(?:warnin\\(g\\)\\|[a-z ]+\\) C[0-9]+:\\)" ^=====
2 3 nil (4))
I promptly made that blank optional, but the problem surprisingly
didn't go away. It turned out that an earlier regexp, for EDG C/C++:
(edg-1
"^\\([^ \n]+\\)(\\([0-9]+\\)): \\(?:error\\|warnin\\(g\\)\\|remar\\(k\\)\\)"
1 2 nil (3 . 4))
also matched the output. However, in the MSVC message, the file name
was preceded by a "1>", which is supported by msft, but not by edg-1.
So the file name Emacs picked up was "1>foo.cpp", which ain't gonna
work.
What is the right fix for this?
next reply other threads:[~2012-09-24 6:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-24 6:28 Eli Zaretskii [this message]
2012-09-24 7:00 ` Order of associations in compilation-error-regexp-alist-alist Chong Yidong
2012-09-24 7:06 ` Eli Zaretskii
2012-09-24 7:13 ` Chong Yidong
2012-10-14 7:42 ` Eli Zaretskii
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83a9wgj5nf.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.