[TxMt] Re: tmCommand, Dialogs and multiple outputs (Ack problem)

Trevor Squires trevor at protocool.com
Tue Aug 5 16:45:26 UTC 2008

Hey Adam,

For issue #1 - it's possible to have a command use (for example) the
tooltip output and then have the process exit with a "use html output"
exit code (iirc exit_show_html).

However, the fact that it's an exit code means your process must
complete in order to tell texmate you'd like html output instead.

For ack in project, using an exit code is simply too late - I want to
start spitting out results to the user the moment they are available.

One promising alternative is to use a combination of the
tooltip-becomes-html exit code thing, along with using the
TextMate.sysem javascript call as a way to actually do your work.
Output buffering can be a bit of a pig if you're not careful but it's
certainly something to try.

For issue #2, I seem to recall being able to create that behavior when
the command is completely asynch - iirc it only spawned a new window
if the command was still running however.

Personally, it bugs me when my screen is littered with "windows I
forgot to close" - something that happens much more often than wanting
to display the results for 2 different search terms (in which case I
use a regex and display both results in the same output window).


On Tue, Aug 5, 2008 at 6:57 AM, Adam Strzelecki <ono at java.pl> wrote:
> Hi,
> I don't know if it was discussed already but there's something that
> bothers me very much, the way showAsHTML in tmCommand works.
> Right now using "Ack in Project" with ⇧⌘A opens empty blank output
> window (killing old window if it was there), then Ack displays dialog
> asking for the search query, if I press cancel output is left blank. I
> was thinking it was fault of Ack scripts themselves, but unfortunately
> it is way the commands work in TM.
> So my Q is, would it be feasible to:
> (1) Show output window only once command writes something into the
> output first time -> So in Ack when the window is popped up we don't
> see output window yet, and when we Cancel we won't see the output as
> well (it will mimic better expected interface)
> (2) Ability to create multiple output windows for single tool,
> currently Ack has its own single output window so:
>   * When I search something new, all my previous results are killed,
> even when I press by mistake the shortcut, now the output window is
> emptied
>   * I wish to search for few things at once and make all the results
> stay
> Seting "uid" to nothing (or removing the uid section from tmCommand)
> somehow makes many output windows to show up (2), but something wrong
> makes sometimes TM crash with such windows.
> Regards,
> --
> Adam Strzelecki
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate

Trevor Squires

More information about the textmate mailing list