From 0992b41f807cf4bdeb4fd517d08adc8f8f8e258e Mon Sep 17 00:00:00 2001
From: Stefan Bodewig Ant adds a "banner" with the name of the current
task in front of all messages - and there are no built-in
- regular expressions in Emacs that would account for this.
@@ -715,7 +715,8 @@ shell-prompt> cat < foo
- Why doesn't (X)Emacs parse the error messages generated
- by Ant correctly?
+ Why doesn't (X)Emacs/vi/MacOS X's project builder
+ parse the error messages generated by Ant correctly?
You can disable this banner by invoking Ant with the
-emacs
switch. Alternatively you can add the
following snippet to your .emacs
to make Emacs
@@ -738,6 +739,48 @@ shell-prompt> cat < foo
;; works for javac
'("^\\s-*\\[[^]]*\\]\\s-*\\(.+\\):\\([0-9]+\\):" 1 2))
compilation-error-regexp-alist))
+
+
Yet another alternative that preserves most of Ant's + formatting is to pipe Ant's output through the following Perl + script by Dirk-Willem van Gulik:
+![]() |
+ ![]() |
+ ![]() |
+
![]() |
+ +#!/usr/bin/perl +# +# May 2001 dirkx@apache.org - remove any +# [foo] lines from the output; keeping +# spacing more or less there. +# +$|=1; +while(<STDIN>) { + if (s/^(\s+)\[(\w+)\]//) { + if ($2 ne $last) { + print "$1\[$2\]"; + $s = ' ' x length($2); + } else { + print "$1 $s "; + }; + $last = $2; + }; + print; +}; |
![]() |