From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Tailor an own compilation-error-regexp-alist. Date: Fri, 19 Jan 2007 00:10:51 -0700 Message-ID: References: <1168506028.157314.97100@k58g2000hse.googlegroups.com> <1168520326.589689.20540@i39g2000hsf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1169190688 15543 80.91.229.12 (19 Jan 2007 07:11:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 19 Jan 2007 07:11:28 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 19 08:11:26 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H7nuF-0001z9-EY for geh-help-gnu-emacs@m.gmane.org; Fri, 19 Jan 2007 08:11:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H7nuE-0000DH-R7 for geh-help-gnu-emacs@m.gmane.org; Fri, 19 Jan 2007 02:11:22 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H7nu1-0000Cw-3l for help-gnu-emacs@gnu.org; Fri, 19 Jan 2007 02:11:09 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H7ntz-0000Ck-2d for help-gnu-emacs@gnu.org; Fri, 19 Jan 2007 02:11:08 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H7nty-0000Ch-Ty for help-gnu-emacs@gnu.org; Fri, 19 Jan 2007 02:11:06 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H7nty-000882-HP for help-gnu-emacs@gnu.org; Fri, 19 Jan 2007 02:11:06 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1H7ntj-0006TP-CH for help-gnu-emacs@gnu.org; Fri, 19 Jan 2007 08:10:52 +0100 Original-Received: from c-24-9-156-178.hsd1.co.comcast.net ([24.9.156.178]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 19 Jan 2007 08:10:51 +0100 Original-Received: from kevin.d.rodgers by c-24-9-156-178.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 19 Jan 2007 08:10:51 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 50 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: c-24-9-156-178.hsd1.co.comcast.net User-Agent: Thunderbird 1.5.0.9 (Macintosh/20061207) In-Reply-To: <1168520326.589689.20540@i39g2000hsf.googlegroups.com> X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:40447 Archived-At: william.a.george@gmail.com wrote: > More information about my problem. > The compiler is C166/ST10. > > The error messages begins with the file name, and then a list of errors > and warnings in that file, then the next file name, followed by more > errors and warnings according the the example above. > I can give a new example for clarification: > > function.c: > 4390: } > W 183: variable 'varx possibly uninitialized > W 183: variable 'vary' possibly uninitialized > > log_master.c: > 401: re_p = RecMsg(); > E 42: syntax error, expecting statement > 769: U8 loop; /* Loop counter */ > E 42: syntax error, expecting declaration > > I think that once I get som help for the compiler, I can do the same > steps for the assembler and linker. > I hope that this can give more information to be able to help. Here's what I came up with: (add-to-list 'compilation-error-regexp-alist-alist '(tasking . ("^\\([^: \n]+\\):\n +\\([0-9]+\\):.*\\(\n[EW] +[0-9]+:.*\\)+" ; REGEXP 1 ; FILE 2 ; LINE ))) (add-to-list 'compilation-error-regexp-alist 'tasking) According to compilation-error-regexp-alist's doc string, the FILE index can reference a subexpression that doesn't match, in which case the previously matched file name is used. So it should be possible to match each erroneous source line number, by making the file name line optional. But wrapping "\\([^: \n]+\\):\n" in "\\(...\\)?" and incrementing FILE and LINE to 2 and 3 resp. yields an error (instead of matching log_master.c line 769 as a distinct error from line 401): font-lock-fontify-keywords-region: No match 2 in highlight (2 compilation-error-face) -- Kevin Rodgers Denver, Colorado, USA