[TextMate] commands and parsing output

Brian Lalor blalor at bravo5.org
Thu Oct 7 14:38:19 UTC 2004


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.

It may be that I'm completely missing the point of the command output  
window; if so, please set me straight. :-)

Does the pattern matching expect every single line to match the  
pattern?  For example:
	/path/to/file:1: error on line 1
	/path/to/file:2: warning on line 2

"ant -emacs" has output like this:
 >>>>begin
[...]
compile:
Compiling 1 source file to  
/Users/blalor/devel/java/portal/ConsumerCustomCommands/build
/Users/blalor/devel/java/portal/ConsumerCustomCommands/src/com/ 
deltafaucet/portal/commands/profile/AprimoAccountListener.java:30:  
cannot resolve symbol
symbol  : class Foo
location: class  
com.deltafaucet.portal.commands.profile.AprimoAccountListener
         private static Foo bar = new Baz();
                        ^
/Users/blalor/devel/java/portal/ConsumerCustomCommands/src/com/ 
deltafaucet/portal/commands/profile/AprimoAccountListener.java:30:  
cannot resolve symbol
symbol  : class Baz
location: class  
com.deltafaucet.portal.commands.profile.AprimoAccountListener
         private static Foo bar = new Baz();
                                      ^
<<<<end

I'm not sure what the command output window is trying to accomplish...   
I've got my command set up like this:
    Before running command:    Save modified files in project
    Command(s):                ant -s build.xml -emacs
    Standard input:            None
    Standard output:           Show in separate window
    Pattern:                   ^(/[^:]+):(\d+):(.*)$
    Format string:             $3
    File register:             1
    Line:                      2
    Column:

This causes the command window to look like this:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedGraphic1.tiff
Type: image/tiff
Size: 56344 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20041007/632c136f/attachment.tiff>
-------------- next part --------------


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.

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.

-- 
    __   ____
   / /  / __/ Brian Lalor
  / _ \/__ \  blalor at bravo5.org
/_.__/____/  http://bravo5.org/


More information about the textmate mailing list