From rsaccon at gmail.com Sat Dec 1 17:54:08 2007 From: rsaccon at gmail.com (Roberto Saccon) Date: Sat, 1 Dec 2007 15:54:08 -0200 Subject: [TxMt Plugins] plugin beginner questions In-Reply-To: References: Message-ID: thanks very much. I managed to adapt the Clock example plugin so it starts an Erlang VM in the background and I am working on a simple C program to serve as command line utility within scripts to bridge to the background Erlang VM. But one stupid litte thing I didn't manage to figure out when I tried to create my own plugin project with xcode. Which template do I choose to get a *.tmplugin and not an *.app ? regards Roberto On Nov 27, 2007 6:37 PM, Ciar?n Walsh wrote: > While what you want to do is likely possible, there is currently no > API for plug-ins (aside from the facility to load them) so anything > you want to do must essentially be done through reverse-engineering/ > hacking TextMate. > I believe at some point TextMate 2.0 will offer a plug-in API, and > TextMate 2.0 itself will be mostly a complete rewrite, so plug-ins > written for the current version are unlikely to work. > > That said: > > The clock plug-in includes some code for observing the currently > edited document (I believe it's commented out at the top of Clock.mm, > the NSWindow subclass and poseAsClass: call below). > At its simplest this would allow you to observe when the current > document changes to one with an extension you are interested in and > then run your code. > > To hook into file saving I think you'd want to swizzle[1] - > [OakDocumentController saveDocument:], but an easier method would be > to change the target of the "Save" menu item to call a method in your > plug-in class and then call saveDocument: from there, before doing > your custom operations. > > [1]: http://www.cocoadev.com/index.pl?MethodSwizzling > > > On 27 Nov 2007, at 13:58, Roberto Saccon wrote: > > > I am struggling with plugins, and I am at the very first begin, just > > played with the clock demo. > > > > I posted about this on normal textmate list, and now I discovered that > > there is a specific plugin mailing list. I want to do better Erlang / > > textmate integration, see details here: > > http://www.rsaccon.com/2007/11/faster-interaction-between-erlang-and.html > > > > What I want to do is subscribe to events when a textmate starts and > > stops (or even when a specific language grammar gets activated or > > deactivated if that is possible) and when a document gets saved. And > > in case of such events I want to run my custom code in C for starting > > a Erlang VM in the background, Erlang compiling and other stuff. I am > > not familiar with Objective C, nor with Cocoa, but I am familiar with > > C, so I guess I an figure out things .. > > > > Is this possible at all ? Somebody can point me in the right > > direction, for me figuring out how to do it ? > > > > Does it make sense at all ? If with upcoming TextMate 2.0 things will > > look completely different, just say "no". > > > > regards > > -- > > Roberto Saccon > > http://rsaccon.com > > _______________________________________________ > > textmate-plugins mailing list > > textmate-plugins at lists.macromates.com > > http://lists.macromates.com/mailman/listinfo/textmate-plugins > > _______________________________________________ > textmate-plugins mailing list > textmate-plugins at lists.macromates.com > http://lists.macromates.com/mailman/listinfo/textmate-plugins > -- Roberto Saccon http://rsaccon.com From ciawal at gmail.com Sat Dec 1 20:04:10 2007 From: ciawal at gmail.com (=?ISO-8859-1?Q?Ciar=E1n_Walsh?=) Date: Sat, 1 Dec 2007 14:04:10 -0600 Subject: [TxMt Plugins] plugin beginner questions In-Reply-To: References: Message-ID: <52BF7175-E353-4BD7-8E7D-F522C6060938@gmail.com> Download this: http://ciaranwal.sh/files/TextMate%20Plugin.tgz And extract it to /Developer/Library/Xcode/Project Templates/Bundle/ (for Leopard ? I can?t remember the location for Tiger but I?m sure you can find it). On 1 Dec 2007, at 11:54, Roberto Saccon wrote: > thanks very much. I managed to adapt the Clock example plugin so it > starts an Erlang VM in the background and I am working on a simple C > program to serve as command line utility within scripts to bridge to > the background Erlang VM. > > But one stupid litte thing I didn't manage to figure out when I tried > to create my own plugin project with xcode. Which template do I choose > to get a *.tmplugin and not an *.app ? > > regards > Roberto > > On Nov 27, 2007 6:37 PM, Ciar?n Walsh wrote: >> While what you want to do is likely possible, there is currently no >> API for plug-ins (aside from the facility to load them) so anything >> you want to do must essentially be done through reverse-engineering/ >> hacking TextMate. >> I believe at some point TextMate 2.0 will offer a plug-in API, and >> TextMate 2.0 itself will be mostly a complete rewrite, so plug-ins >> written for the current version are unlikely to work. >> >> That said: >> >> The clock plug-in includes some code for observing the currently >> edited document (I believe it's commented out at the top of Clock.mm, >> the NSWindow subclass and poseAsClass: call below). >> At its simplest this would allow you to observe when the current >> document changes to one with an extension you are interested in and >> then run your code. >> >> To hook into file saving I think you'd want to swizzle[1] - >> [OakDocumentController saveDocument:], but an easier method would be >> to change the target of the "Save" menu item to call a method in your >> plug-in class and then call saveDocument: from there, before doing >> your custom operations. >> >> [1]: http://www.cocoadev.com/index.pl?MethodSwizzling >> >> >> On 27 Nov 2007, at 13:58, Roberto Saccon wrote: >> >>> I am struggling with plugins, and I am at the very first begin, just >>> played with the clock demo. >>> >>> I posted about this on normal textmate list, and now I discovered >>> that >>> there is a specific plugin mailing list. I want to do better >>> Erlang / >>> textmate integration, see details here: >>> http://www.rsaccon.com/2007/11/faster-interaction-between-erlang-and.html >>> >>> What I want to do is subscribe to events when a textmate starts and >>> stops (or even when a specific language grammar gets activated or >>> deactivated if that is possible) and when a document gets saved. And >>> in case of such events I want to run my custom code in C for >>> starting >>> a Erlang VM in the background, Erlang compiling and other stuff. I >>> am >>> not familiar with Objective C, nor with Cocoa, but I am familiar >>> with >>> C, so I guess I an figure out things .. >>> >>> Is this possible at all ? Somebody can point me in the right >>> direction, for me figuring out how to do it ? >>> >>> Does it make sense at all ? If with upcoming TextMate 2.0 things >>> will >>> look completely different, just say "no". >>> >>> regards >>> -- >>> Roberto Saccon >>> http://rsaccon.com >>> _______________________________________________ >>> textmate-plugins mailing list >>> textmate-plugins at lists.macromates.com >>> http://lists.macromates.com/mailman/listinfo/textmate-plugins >> >> _______________________________________________ >> textmate-plugins mailing list >> textmate-plugins at lists.macromates.com >> http://lists.macromates.com/mailman/listinfo/textmate-plugins >> > > > > -- > Roberto Saccon > http://rsaccon.com > _______________________________________________ > textmate-plugins mailing list > textmate-plugins at lists.macromates.com > http://lists.macromates.com/mailman/listinfo/textmate-plugins From rsaccon at gmail.com Sat Dec 1 21:11:45 2007 From: rsaccon at gmail.com (Roberto Saccon) Date: Sat, 1 Dec 2007 19:11:45 -0200 Subject: [TxMt Plugins] plugin beginner questions In-Reply-To: <52BF7175-E353-4BD7-8E7D-F522C6060938@gmail.com> References: <52BF7175-E353-4BD7-8E7D-F522C6060938@gmail.com> Message-ID: Ciar?n, Christmas came early this year. Thanks very much. On Dec 1, 2007 6:04 PM, Ciar?n Walsh wrote: > Download this: http://ciaranwal.sh/files/TextMate%20Plugin.tgz > > And extract it to /Developer/Library/Xcode/Project Templates/Bundle/ > (for Leopard ? I can't remember the location for Tiger but I'm sure > you can find it). > > > On 1 Dec 2007, at 11:54, Roberto Saccon wrote: > > > thanks very much. I managed to adapt the Clock example plugin so it > > starts an Erlang VM in the background and I am working on a simple C > > program to serve as command line utility within scripts to bridge to > > the background Erlang VM. > > > > But one stupid litte thing I didn't manage to figure out when I tried > > to create my own plugin project with xcode. Which template do I choose > > to get a *.tmplugin and not an *.app ? > > > > regards > > Roberto > > > > On Nov 27, 2007 6:37 PM, Ciar?n Walsh wrote: > >> While what you want to do is likely possible, there is currently no > >> API for plug-ins (aside from the facility to load them) so anything > >> you want to do must essentially be done through reverse-engineering/ > >> hacking TextMate. > >> I believe at some point TextMate 2.0 will offer a plug-in API, and > >> TextMate 2.0 itself will be mostly a complete rewrite, so plug-ins > >> written for the current version are unlikely to work. > >> > >> That said: > >> > >> The clock plug-in includes some code for observing the currently > >> edited document (I believe it's commented out at the top of Clock.mm, > >> the NSWindow subclass and poseAsClass: call below). > >> At its simplest this would allow you to observe when the current > >> document changes to one with an extension you are interested in and > >> then run your code. > >> > >> To hook into file saving I think you'd want to swizzle[1] - > >> [OakDocumentController saveDocument:], but an easier method would be > >> to change the target of the "Save" menu item to call a method in your > >> plug-in class and then call saveDocument: from there, before doing > >> your custom operations. > >> > >> [1]: http://www.cocoadev.com/index.pl?MethodSwizzling > >> > >> > >> On 27 Nov 2007, at 13:58, Roberto Saccon wrote: > >> > >>> I am struggling with plugins, and I am at the very first begin, just > >>> played with the clock demo. > >>> > >>> I posted about this on normal textmate list, and now I discovered > >>> that > >>> there is a specific plugin mailing list. I want to do better > >>> Erlang / > >>> textmate integration, see details here: > >>> http://www.rsaccon.com/2007/11/faster-interaction-between-erlang-and.html > >>> > >>> What I want to do is subscribe to events when a textmate starts and > >>> stops (or even when a specific language grammar gets activated or > >>> deactivated if that is possible) and when a document gets saved. And > >>> in case of such events I want to run my custom code in C for > >>> starting > >>> a Erlang VM in the background, Erlang compiling and other stuff. I > >>> am > >>> not familiar with Objective C, nor with Cocoa, but I am familiar > >>> with > >>> C, so I guess I an figure out things .. > >>> > >>> Is this possible at all ? Somebody can point me in the right > >>> direction, for me figuring out how to do it ? > >>> > >>> Does it make sense at all ? If with upcoming TextMate 2.0 things > >>> will > >>> look completely different, just say "no". > >>> > >>> regards > >>> -- > >>> Roberto Saccon > >>> http://rsaccon.com > >>> _______________________________________________ > >>> textmate-plugins mailing list > >>> textmate-plugins at lists.macromates.com > >>> http://lists.macromates.com/mailman/listinfo/textmate-plugins > >> > >> _______________________________________________ > >> textmate-plugins mailing list > >> textmate-plugins at lists.macromates.com > >> http://lists.macromates.com/mailman/listinfo/textmate-plugins > >> > > > > > > > > -- > > Roberto Saccon > > http://rsaccon.com > > _______________________________________________ > > textmate-plugins mailing list > > textmate-plugins at lists.macromates.com > > http://lists.macromates.com/mailman/listinfo/textmate-plugins > > _______________________________________________ > textmate-plugins mailing list > textmate-plugins at lists.macromates.com > http://lists.macromates.com/mailman/listinfo/textmate-plugins > -- Roberto Saccon http://rsaccon.com From rsaccon at gmail.com Thu Dec 6 12:29:10 2007 From: rsaccon at gmail.com (Roberto Saccon) Date: Thu, 6 Dec 2007 10:29:10 -0200 Subject: [TxMt Plugins] how to hook into preferences Message-ID: I have seen that for example the SVNMate plugin hooks into the preferences and add their own tab. Does there exist a recommended way of adding such a custom tab or can anybody point me to some source-code where I can see how this can be implemented ? regards -- Roberto Saccon http://rsaccon.com From ciawal at gmail.com Thu Dec 6 15:43:08 2007 From: ciawal at gmail.com (=?ISO-8859-1?Q?Ciar=E1n_Walsh?=) Date: Thu, 6 Dec 2007 09:43:08 -0600 Subject: [TxMt Plugins] how to hook into preferences In-Reply-To: References: Message-ID: <7E1ABADE-7B1F-4473-A032-D9998A616DA6@gmail.com> There really are no recommended ways to do anything ;) In fact I?d recommend against it as it?s pretty messy (you need to swizzle all the toolbar delegate methods). The clock example plug-in shows how to add an item to the Window menu and open a window from a nib when it?s clicked ? that?s generally what people do for their plug- ins. On 6 Dec 2007, at 06:29, Roberto Saccon wrote: > I have seen that for example the SVNMate plugin hooks into the > preferences and add their own tab. > > Does there exist a recommended way of adding such a custom tab or can > anybody point me to some source-code where I can see how this can be > implemented ? > > regards > -- > Roberto Saccon > http://rsaccon.com > _______________________________________________ > textmate-plugins mailing list > textmate-plugins at lists.macromates.com > http://lists.macromates.com/mailman/listinfo/textmate-plugins From rsaccon at gmail.com Thu Dec 13 07:17:21 2007 From: rsaccon at gmail.com (Roberto Saccon) Date: Thu, 13 Dec 2007 05:17:21 -0200 Subject: [TxMt Plugins] how can I intercept when textmate shuts down ? Message-ID: I made some progress with my Erlang background server which gets started with a textmate plugin. it basically works, just some minor details are missing, one of them is: how can I intercept when textmate shuts down ? (I need to shutdown my dameon) does there any specific method get called ALWAYS when textmate exits, so I can apply MethodSwizzeling or is there any other "recommended apporach" ? regards -- Roberto Saccon http://rsaccon.com From ciawal at gmail.com Thu Dec 13 07:35:48 2007 From: ciawal at gmail.com (=?ISO-8859-1?Q?Ciar=E1n_Walsh?=) Date: Thu, 13 Dec 2007 01:35:48 -0600 Subject: [TxMt Plugins] how can I intercept when textmate shuts down ? In-Reply-To: References: Message-ID: <64FF4EC3-FB28-49AE-A9E1-9BE234B843ED@gmail.com> Use this in -initWithPlugInController: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:) name:NSApplicationWillTerminateNotification object:nil] then add a method to your controller: - (void)applicationWillTerminate:(NSNotification*)notification On 13 Dec 2007, at 01:17, Roberto Saccon wrote: > I made some progress with my Erlang background server which gets > started with a textmate plugin. > > it basically works, just some minor details are missing, one of them > is: > > how can I intercept when textmate shuts down ? (I need to shutdown > my dameon) > > does there any specific method get called ALWAYS when textmate exits, > so I can apply MethodSwizzeling or is there any other "recommended > apporach" ? > > regards > -- > Roberto Saccon > http://rsaccon.com > _______________________________________________ > textmate-plugins mailing list > textmate-plugins at lists.macromates.com > http://lists.macromates.com/mailman/listinfo/textmate-plugins From rsaccon at gmail.com Fri Dec 14 03:09:34 2007 From: rsaccon at gmail.com (Roberto Saccon) Date: Fri, 14 Dec 2007 01:09:34 -0200 Subject: [TxMt Plugins] how can I intercept when textmate shuts down ? In-Reply-To: <64FF4EC3-FB28-49AE-A9E1-9BE234B843ED@gmail.com> References: <64FF4EC3-FB28-49AE-A9E1-9BE234B843ED@gmail.com> Message-ID: thanks, got it working now I am wondering where to install my daemon. is there any reason I should not put it at: ~/Library/Application\ Support/TextMate/Support/bin/ regards On Dec 13, 2007 5:35 AM, Ciar?n Walsh wrote: > Use this in -initWithPlugInController: > > [[NSNotificationCenter defaultCenter] addObserver:self > selector:@selector(applicationWillTerminate:) > name:NSApplicationWillTerminateNotification object:nil] > > then add a method to your controller: > > - (void)applicationWillTerminate:(NSNotification*)notification > > > On 13 Dec 2007, at 01:17, Roberto Saccon wrote: > > > I made some progress with my Erlang background server which gets > > started with a textmate plugin. > > > > it basically works, just some minor details are missing, one of them > > is: > > > > how can I intercept when textmate shuts down ? (I need to shutdown > > my dameon) > > > > does there any specific method get called ALWAYS when textmate exits, > > so I can apply MethodSwizzeling or is there any other "recommended > > apporach" ? > > > > regards > > -- > > Roberto Saccon > > http://rsaccon.com > > _______________________________________________ > > textmate-plugins mailing list > > textmate-plugins at lists.macromates.com > > http://lists.macromates.com/mailman/listinfo/textmate-plugins > > _______________________________________________ > textmate-plugins mailing list > textmate-plugins at lists.macromates.com > http://lists.macromates.com/mailman/listinfo/textmate-plugins > -- Roberto Saccon http://rsaccon.com From ciawal at gmail.com Fri Dec 14 03:55:33 2007 From: ciawal at gmail.com (=?ISO-8859-1?Q?Ciar=E1n_Walsh?=) Date: Thu, 13 Dec 2007 21:55:33 -0600 Subject: [TxMt Plugins] how can I intercept when textmate shuts down ? In-Reply-To: References: <64FF4EC3-FB28-49AE-A9E1-9BE234B843ED@gmail.com> Message-ID: <8EB3F36D-CD70-4162-8DF6-580FCE91E132@gmail.com> What is the daemon, and what does installation involve? You should just bundle it inside the plug-in package, is there a reason it needs to be moved from there? On 13 Dec 2007, at 21:09, Roberto Saccon wrote: > thanks, got it working > > now I am wondering where to install my daemon. > > is there any reason I should not put it at: > > ~/Library/Application\ Support/TextMate/Support/bin/ > > regards > > On Dec 13, 2007 5:35 AM, Ciar?n Walsh wrote: >> Use this in -initWithPlugInController: >> >> [[NSNotificationCenter defaultCenter] addObserver:self >> selector:@selector(applicationWillTerminate:) >> name:NSApplicationWillTerminateNotification object:nil] >> >> then add a method to your controller: >> >> - (void)applicationWillTerminate:(NSNotification*)notification >> >> >> On 13 Dec 2007, at 01:17, Roberto Saccon wrote: >> >>> I made some progress with my Erlang background server which gets >>> started with a textmate plugin. >>> >>> it basically works, just some minor details are missing, one of them >>> is: >>> >>> how can I intercept when textmate shuts down ? (I need to shutdown >>> my dameon) >>> >>> does there any specific method get called ALWAYS when textmate >>> exits, >>> so I can apply MethodSwizzeling or is there any other "recommended >>> apporach" ? >>> >>> regards >>> -- >>> Roberto Saccon >>> http://rsaccon.com >>> _______________________________________________ >>> textmate-plugins mailing list >>> textmate-plugins at lists.macromates.com >>> http://lists.macromates.com/mailman/listinfo/textmate-plugins >> >> _______________________________________________ >> textmate-plugins mailing list >> textmate-plugins at lists.macromates.com >> http://lists.macromates.com/mailman/listinfo/textmate-plugins >> > > > > -- > Roberto Saccon > http://rsaccon.com > _______________________________________________ > textmate-plugins mailing list > textmate-plugins at lists.macromates.com > http://lists.macromates.com/mailman/listinfo/textmate-plugins From rsaccon at gmail.com Fri Dec 14 04:17:16 2007 From: rsaccon at gmail.com (Roberto Saccon) Date: Fri, 14 Dec 2007 02:17:16 -0200 Subject: [TxMt Plugins] how can I intercept when textmate shuts down ? In-Reply-To: <8EB3F36D-CD70-4162-8DF6-580FCE91E132@gmail.com> References: <64FF4EC3-FB28-49AE-A9E1-9BE234B843ED@gmail.com> <8EB3F36D-CD70-4162-8DF6-580FCE91E132@gmail.com> Message-ID: On Dec 14, 2007 1:55 AM, Ciar?n Walsh wrote: > What is the daemon, and what does installation involve? > You should just bundle it inside the plug-in package, is there a > reason it needs to be moved from there? oh, just was confusing things, everything fine now, thanks very much -- Roberto Saccon http://rsaccon.com From rsaccon at gmail.com Fri Dec 21 13:14:08 2007 From: rsaccon at gmail.com (Roberto Saccon) Date: Fri, 21 Dec 2007 11:14:08 -0200 Subject: [TxMt Plugins] how to integrate interactive shell Message-ID: I would like to add to my Erlang TextMate integration an interactive shell. Is anybody aware of an open source plugin which does provide an interactive shell for any other interpreted language ? Or any other recommendation where to look for in the cocoa universe for such constructs which provide the framework for building an interactive shell ? regards -- Roberto Saccon http://rsaccon.com From bibiko at eva.mpg.de Fri Dec 21 13:28:36 2007 From: bibiko at eva.mpg.de (=?ISO-8859-1?Q?Hans-J=F6rg_Bibiko?=) Date: Fri, 21 Dec 2007 14:28:36 +0100 Subject: [TxMt Plugins] how to integrate interactive shell In-Reply-To: References: Message-ID: <5CA1E727-D336-4A9D-AF9A-B01D9CCF2A4D@eva.mpg.de> On 21.12.2007, at 14:14, Roberto Saccon wrote: > I would like to add to my Erlang TextMate integration an interactive > shell. Is anybody aware of an open source plugin which does provide an > interactive shell for any other interpreted language ? Or any other > recommendation where to look for in the cocoa universe for such > constructs which provide the framework for building an interactive > shell ? I just did this for R. I believe there's no open source plugin but you can look at my Rdaemon. Look at Rdaemon/daemon/Rdaemon.rb. Here you can see how I did spawn R in a pseudo terminal. In principal you can use it as template for Erlang if the Erlang interpreter returns always anything (a newline, a prompt etc.). If you have further question mail me privately. --Hans