* Compilation error regexp alist doesn't match my compiler anymor
@ 2004-05-25 17:13 Arjan Bos
2004-05-25 19:24 ` Michael Slass
2004-05-26 18:35 ` Stefan Monnier
0 siblings, 2 replies; 4+ messages in thread
From: Arjan Bos @ 2004-05-25 17:13 UTC (permalink / raw)
Hi all,
On the 23rd of May 2004, I checked out from cvs and compiled a new
version of Emacs. It's for MacOSX --with-carbon --without-x
Unfortunately, it does not match the output of my compiler anymore. How
do I customize the appropriate alists so that it does match it?
I tried to read the documentation for compilation-error-regexp-alist and
compilation-error-regexp-alist-alist and the documentation of list, cons
and append, but even this combined couldn't help me enough to make the
appropriate entry in my .emacs by myself.
A sample compilation output is:
Classification.nrx: method getUserObject
Classification.nrx: method delete
Classification.nrx: 965 if this.getPublishedSubSchemes().size()
\= null then
Classification.nrx: ^
Classification.nrx: Error: Cannot compare primitive type 'int'
to object reference type 'null'
Classification.nrx: method getDeletable
'Classification.nrx' is the file name and '965' is the line number.
So "^\\(.*\\.nrx:\\)[ \\t]*\\([0-9]+\\)" should be able to match it. But
then I'm lost in lists.
Any thoughts on matching the above sample output?
btw:
I remember a posting to gnu.emacs.sources a few months ago about a new
compile.el but since it stated that all the then current matchings
should be matched by the new system I didn't pay it any attention. It
seems that this is what is costing me ;-)
TIA,
Arjan
--
--
If you really want to contact me, then replace the "I see you" text by
its real value, the single word "het net".
Fabricate Diem PVNC, Motto of the Night Watch -- Terry Pratchett
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compilation error regexp alist doesn't match my compiler anymor
2004-05-25 17:13 Compilation error regexp alist doesn't match my compiler anymor Arjan Bos
@ 2004-05-25 19:24 ` Michael Slass
2004-05-25 22:33 ` Arjan Bos
2004-05-26 18:35 ` Stefan Monnier
1 sibling, 1 reply; 4+ messages in thread
From: Michael Slass @ 2004-05-25 19:24 UTC (permalink / raw)
Arjan Bos <Arjan.Bos@nospam.ISeeYou.nl> writes:
>A sample compilation output is:
>
>Classification.nrx: method getUserObject
>Classification.nrx: method delete
>Classification.nrx: 965 if
>this.getPublishedSubSchemes().size() \= null then
>Classification.nrx: ^
>Classification.nrx: Error: Cannot compare primitive type
>'int' to object reference type 'null'
>Classification.nrx: method getDeletable
>
>'Classification.nrx' is the file name and '965' is the line number.
>So "^\\(.*\\.nrx:\\)[ \\t]*\\([0-9]+\\)" should be able to match
>it. But then I'm lost in lists.
>
>Any thoughts on matching the above sample output?
>
,----[ 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:
| <snip>
`----
I don't know how much that has changed in the cvs version of emacs,
but the explanation below should let you adapt.
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
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?
--
Mike Slass
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compilation error regexp alist doesn't match my compiler anymor
2004-05-25 19:24 ` Michael Slass
@ 2004-05-25 22:33 ` Arjan Bos
0 siblings, 0 replies; 4+ messages in thread
From: Arjan Bos @ 2004-05-25 22:33 UTC (permalink / raw)
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:
> | <snip>
> `----
>
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compilation error regexp alist doesn't match my compiler anymor
2004-05-25 17:13 Compilation error regexp alist doesn't match my compiler anymor Arjan Bos
2004-05-25 19:24 ` Michael Slass
@ 2004-05-26 18:35 ` Stefan Monnier
1 sibling, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2004-05-26 18:35 UTC (permalink / raw)
[ Can you people read the INSTALL.CVS file, or otherwise just get used to
reporting problems via M-x report-emacs-bug? ]
> On the 23rd of May 2004, I checked out from cvs and compiled a new version
> of Emacs. It's for MacOSX --with-carbon --without-x
It's maybe a bug, so please don't try to work around it (which would be an
appropriate approach for released software, but not for CVS version).
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-05-26 18:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-25 17:13 Compilation error regexp alist doesn't match my compiler anymor Arjan Bos
2004-05-25 19:24 ` Michael Slass
2004-05-25 22:33 ` Arjan Bos
2004-05-26 18:35 ` Stefan Monnier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.