From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Dealing with "gnu" rule in compilation-error-regexp-alist Date: Thu, 15 Apr 2010 14:54:31 -0400 Message-ID: References: <20100415112110.68C97188395@wsnyder.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1271357688 12732 80.91.229.12 (15 Apr 2010 18:54:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Apr 2010 18:54:48 +0000 (UTC) Cc: emacs-devel@gnu.org To: wsnyder@wsnyder.org (Wilson Snyder) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 15 20:54:47 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O2UD6-0005go-7S for ged-emacs-devel@m.gmane.org; Thu, 15 Apr 2010 20:54:44 +0200 Original-Received: from localhost ([127.0.0.1]:34873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2UD5-0004eI-Jt for ged-emacs-devel@m.gmane.org; Thu, 15 Apr 2010 14:54:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2UD0-0004eD-9r for emacs-devel@gnu.org; Thu, 15 Apr 2010 14:54:38 -0400 Original-Received: from [140.186.70.92] (port=33141 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2UCx-0004e5-R0 for emacs-devel@gnu.org; Thu, 15 Apr 2010 14:54:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O2UCw-0002yR-5V for emacs-devel@gnu.org; Thu, 15 Apr 2010 14:54:35 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:54127) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2UCw-0002y2-2N for emacs-devel@gnu.org; Thu, 15 Apr 2010 14:54:34 -0400 Original-Received: from ceviche.home (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id o3FIsVU1032287; Thu, 15 Apr 2010 14:54:31 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 9D2DCB42CC; Thu, 15 Apr 2010 14:54:31 -0400 (EDT) In-Reply-To: <20100415112110.68C97188395@wsnyder.org> (Wilson Snyder's message of "Thu, 15 Apr 2010 07:21:10 -0400 (EDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3514=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:123717 Archived-At: > 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:\\)\\|\