From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Order of associations in compilation-error-regexp-alist-alist Date: Mon, 24 Sep 2012 08:28:52 +0200 Message-ID: <83a9wgj5nf.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1348468185 11556 80.91.229.3 (24 Sep 2012 06:29:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Sep 2012 06:29:45 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 24 08:29:49 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TG2As-00087c-3m for ged-emacs-devel@m.gmane.org; Mon, 24 Sep 2012 08:29:46 +0200 Original-Received: from localhost ([::1]:37532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG2An-0007GB-BF for ged-emacs-devel@m.gmane.org; Mon, 24 Sep 2012 02:29:41 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:32921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG2Ak-0007Fn-H2 for emacs-devel@gnu.org; Mon, 24 Sep 2012 02:29:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TG2Aj-00050P-Gx for emacs-devel@gnu.org; Mon, 24 Sep 2012 02:29:38 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:35145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG2Aj-00050D-90 for emacs-devel@gnu.org; Mon, 24 Sep 2012 02:29:37 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MAU00300CL6GJ00@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Mon, 24 Sep 2012 08:29:00 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAU003Q5COBAU50@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Mon, 24 Sep 2012 08:29:00 +0200 (IST) X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:153505 Archived-At: 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?