Search code examples
textmate

Adding MacSpice bundle to TextMate


I don't really know how to add a MacSpice bundle to TextMate in order to run code directly from it.

I tried to see how to do it from reading other bundles commands (Xcode) but I didn't understand a thing. (probably written in Ruby)

If someone could help me by telling me how to simply check in a command:

1) If the file is a .cir file. 2) Save & Run it.

Thank you very much!


Solution

  • TextMate and MacSpice implement the server and client parts of the ODB Editor Suite respectively. Hence, the conventional way to use MacSpice (2.10.x) with TextMate is to type

    set editor = 'TxMt'

    as your first MacSpice command. You can put this command into '~Library:MacSpice:lib:scripts:spinit' or 'Library:MacSpice:lib:scripts:spinit' as appropriate. Once this has been done typing 'edit foo.cir' in MacSpice should fire up TextMate so that the file can be edited. When the file is saved by TextMate it notifies MacSpice appropriately.

    An approach based on TextMate 'bundles' would need to use the fact that MacSpice can be controlled with AppleEvents (e.g. from AppleScript), as described on the 'Inter-Process Communication' page of the MacSpice website:

    http://www.macspice.com/Interprocess.html

    This would be quite a lot more involved than the ODB mechanism, so I don't recommend it.