[SVN] REQ: commands choosing output

Kevin Ballard kevin at sb.org
Sun Feb 20 15:27:37 UTC 2005


Here's a thought. Write a separate command-line tool that will live in 
the TextMate Resources dir. Make it use Distributed Objects to 
communicate with TextMate. For each command, assign it a unique ID 
(perhaps a uuid, since CF can create those easily) and record which 
buffer the command belongs to by way of the unique ID. Export 2 shells 
scripts to each command: ${TM_OUTPUT_SELECT} and ${TM_COMMAND_UUID}. 
That way commands simply have to run `${TM_OUTPUT_SELECT} 
${TM_COMMAND_ID} replace-window' (or whatever you decide to name the 
choices for the last argument), ${TM_OUTPUT_SELECT} being a path to the 
tool referenced earlier which uses DO to tell TextMate the output 
choices for the command with the given UUID. This has several benefits:

1) Much cleaner in the script than either applescript or the input 
stream parsing
2) Reasonably easy to implement
3) No chance of screwing up binary data with the script since we're not 
affecting the data passed back
4) Don't need to add anything to the output options - this should work 
no matter what default output option is selected
5) Not a kludge

What do you think?

-Kevin

On Feb 20, 2005, at 4:44 AM, Allan Odgaard wrote:

> I'm going back and forth on the kludgy thing. If instead the command 
> was to use a script hook to redirect the output, this would get 
> verbose because it would need to explicitly provide the context (e.g. 
> if it wants to replace the selection, TM would need to be told which 
> selection in which buffer, and TM would thus also need to tell the 
> shell command which buffer it was working on).

-- 
Kevin Ballard
kevin at sb.org
http://www.tildesoft.com
http://kevin.sb.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2378 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate-dev/attachments/20050220/7991a393/attachment.p7s>


More information about the textmate-dev mailing list