[TextMate] commands and parsing output

Allan Odgaard allan at macromates.com
Thu Oct 7 21:54:16 UTC 2004


On 7. Oct 2004, at 16:38, Brian Lalor wrote:

> I'm trying to work up a command to call ant with for my Java bundle.  
> I'm confused by the dual-pane window that's displayed.  The bottom 
> looks to be just the entire output of the command with line numbers in 
> the gutter.  The top I just don't grok, however.

The top part show lines parsed with the regex pattern. The bottom part 
is a raw dump (mostly useful when the patterns are incorrect).

> Does the pattern matching expect every single line to match the 
> pattern?  For example:

It was supposed to only show the lines which matched, in the top part 
(using the format string), and all lines in the bottom part.

It seems I got this wrong, and also do show non-matching lines in the 
top part. I'll have this fixed for 1.0.1!

>    Command(s):                ant -s build.xml -emacs

As a workaround I think you can set:
    Command(s):                ant -s build.xml -emacs | egrep 
'^/.+:.+:.+$'

Of course this will also affect the bottom part. As said, I'll have 
this fixed in next version!

> I would expect that the top part of the window would only show the 
> lines that matched the regexp, at a minimum, but I really think it 
> should perhaps highlight the line, make it clickable (to jump to the 
> source), etc.

You can click lines in the top part, and jump to that line in the 
source (but only for the lines matched by the regex of course).

> I think what's needed (for compiles, anyway) is to have the command 
> output displayed in a pane in the project window (say, at the bottom) 
> and display each line of output from the command.  Each line that 
> matches the regexp should appear in a different color, and, if the 
> line, and possibly column, are given as registers, the top part of the 
> project window should jump to the line and file, leaving the lower 
> pane in place.  I tend to keep my code windows up so that they take up 
> most of the screen real estate (especially with the project drawer 
> open).  The command window really gets in the way.  But I think it's a 
> step in the right direction, because I want to be able to jump to a 
> line in the file.

I agree that somehow putting the output directly into the project 
window would be an advantage, if I could figure out an elegant way to 
do it, that is!

The idea about coloring lines which match the regex in the raw output 
is good! The other things about jumping _should_ work (I tried to 
configure a command like yours, but with "cat" as the command, and the 
document being the output you gave, and this did then allow me to click 
the two lines which are matched by your regex).


Kind regards Allan




More information about the textmate mailing list