From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Arjan Bos Newsgroups: gmane.emacs.help Subject: Re: Compilation error regexp alist doesn't match my compiler anymor Date: Wed, 26 May 2004 00:33:22 +0200 Organization: Planet Internet Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: Reply-To: Arjan.Bos@ISeeYou.nl NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1085525979 8855 80.91.224.253 (25 May 2004 22:59:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 25 May 2004 22:59:39 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 26 00:59:31 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BSktP-0000FX-00 for ; Wed, 26 May 2004 00:59:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BSkkG-0007CX-PW for geh-help-gnu-emacs@m.gmane.org; Tue, 25 May 2004 18:50:04 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!news.glorb.com!transit.nntp.hccnet.nl!newsfeeder.wxs.nl!textnews.wxs.nl!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 69 Original-NNTP-Posting-Host: ip51cd7a2f.adsl-surfen.hetnet.nl Original-X-Trace: reader13.wxs.nl 1085524406 17727 81.205.122.47 (25 May 2004 22:33:26 GMT) Original-X-Complaints-To: abuse@planet.nl Original-NNTP-Posting-Date: 25 May 2004 22:33:26 GMT User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en In-Reply-To: Original-Xref: shelby.stanford.edu gnu.emacs.help:123437 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:18736 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:18736 Michael Slass wrote: > > ,----[ C-h v compilation-error-regexp-alist RET ] > | compilation-error-regexp-alist's value is shown below. > | > | Documentation: > | Alist that specifies how to match errors in compiler output. > | Each elt has the form (REGEXP FILE-IDX LINE-IDX [COLUMN-IDX FILE-FORMAT...]) > | If REGEXP matches, the FILE-IDX'th subexpression gives the file name, and > | the LINE-IDX'th subexpression gives the line number. If COLUMN-IDX is > | given, the COLUMN-IDX'th subexpression gives the column number on that line. > | If any FILE-FORMAT is given, each is a format string to produce a file name to > | try; %s in the string is replaced by the text matching the FILE-IDX'th > | subexpression. > | > | Defined in `compile'. > | > | Value: > | > `---- > > I don't know how much that has changed in the cvs version of emacs, > but the explanation below should let you adapt. > I know that it should be sufficient, but I never put enough effort in learning lists in lisp. But it has changed a lot since my previous snapshot (last march). > So, you're pretty close: you've got a regex which captures your > filename (and, incorrectly, the trailing colon) into subexp 1, and the > line number in subexp 2. You want to add an element to > compilation-error-regexp-alist that includes your regex, the capture > index of the filename, and the capture index of the line number, in > that order: > ( "^\\(.*\\.nrx\\):[ \\t]*\\([0-9]+\\)" 1 2) > --- note the colon moved outside the capture parens Hmm, should have noticed that meself. > > Then you want to add the little list above to the place where > compile-mode will find it, compilation-error-regexp-alist. You do > that with a function called add-to-list > > Try this: > > (add-to-list > 'compilation-error-regexp-alist > '("^\\(.*\\.nrx\\):[ \\t]*\\([0-9]+\\)" 1 2)) > > Make sense? Yes, thanks a lot, the add-to-list form was missing from my lisp vocabulary. It does indeed work now. However, its new value is now (("^\\(.*\\.nrx\\):[ \\t]*\\([0-9]+\\)" 1 2) absoft ada aix ant bash borland caml comma edg-1 edg-2 epc ...) Where the names somehow point to entries in compilation-error-regexp-alist-alist. So I got lost in thinking that I should add a name in compilation-error-regexp-alist and the regexp in compilation-error-regexp-alist-alist. Let's hope this current solution is future proof. -- -- If you really want to contact me, then replace the "I see you" text by its three letter accronym, ICU. Fabricate Diem PVNC, Motto of the Night Watch -- Terry Pratchett