From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: wsnyder@wsnyder.org (Wilson Snyder) Newsgroups: gmane.emacs.devel Subject: Re: Dealing with "gnu" rule in compilation-error-regexp-alist Date: Thu, 15 Apr 2010 11:26:14 -0400 (EDT) Message-ID: <20100415152615.0313B188395@wsnyder.org> References: <20100415112110.68C97188395@wsnyder.org> <87bpdku4kd.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1271346797 31050 80.91.229.12 (15 Apr 2010 15:53:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Apr 2010 15:53:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 15 17:53:16 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 1O2RNT-0006V0-A1 for ged-emacs-devel@m.gmane.org; Thu, 15 Apr 2010 17:53:15 +0200 Original-Received: from localhost ([127.0.0.1]:43330 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2RNS-0002Xq-Va for ged-emacs-devel@m.gmane.org; Thu, 15 Apr 2010 11:53:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2QxR-00022L-3R for emacs-devel@gnu.org; Thu, 15 Apr 2010 11:26:21 -0400 Original-Received: from [140.186.70.92] (port=55851 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2QxP-00020C-B6 for emacs-devel@gnu.org; Thu, 15 Apr 2010 11:26:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O2QxN-0006vq-RO for emacs-devel@gnu.org; Thu, 15 Apr 2010 11:26:19 -0400 Original-Received: from wsnyder.org ([66.249.9.161]:53030) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2QxN-0006uz-LV for emacs-devel@gnu.org; Thu, 15 Apr 2010 11:26:17 -0400 Original-Received: from wsnyder.org (c-24-91-159-26.hsd1.ma.comcast.net [24.91.159.26]) by wsnyder.org (Postfix) with ESMTP id D7578E0234; Thu, 15 Apr 2010 15:26:15 +0000 (UTC) Original-Received: by wsnyder.org (Postfix, from userid 1017) id 0313B188395; Thu, 15 Apr 2010 11:26:14 -0400 (EDT) X-ssh-sendmail: true 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:123710 Archived-At: >wsnyder@wsnyder.org (Wilson Snyder) writes: > >> (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 '(percent gnu)) >> (compile "echo 'zz: %Error: foo.x:1: something'") > >You need to anchor your regexp at the start of the line. For example, > > "^[^%\n]*%?\\(Error\\|Warning\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 2 3)) Unfortunately I had already tried that. It looks better for the example I sent but doesn't solve more complicated patterns. >> Long term, I think it would be good have some sort of >> ordering or priority to the rules. > >This is already the case. Can you describe how to use it then? Sorry I missed it - I followed the code and it seems to just do a mapcar to build the font-lock list and always uses 'append, so font-lock will keep processing. -Wilson