I'm using TextMate a lot these days to write code for R and I'd like to see if there's a way to make an improvement.
The existing command in the R bundle works fine as long as I'm sending just a handful of lines to the R application, but TextMate gives me the beach ball for as much as a minute when I send lots of code over, and then suddenly dumps all the code into R. For reference, here's the short R command:
osascript -e 'tell application "R" to activate' -e "tell application "R" to cmd "${TM_SELECTED_TEXT//"/\"}""
I'm guessing that TM itself doesn't have a problem with the amount of text, and that the bottleneck is in the applescript. Is there any way to speed up how this is done in the event of a large set of commands? For example, could the command be split into an array and run line-by- line? (Would this result in an increase in speed? I have no idea -- just thinking out loud.)
Thanks for suggestions. Cheers- -Alan
Hi Alan,
How much code are you sending to R? I can send thousands of lines without a problem. You may need to upgrade to the newest version of R: http://cran.r-project.org/. It seems there was a bug in the last release where commands sent to R (even in R's own text editor) caused similar problems (at least in the OS X version).
Hope that helps,
Jeff.
On Apr 17, 2006, at 5:18 PM, Alan Schussman wrote:
I'm using TextMate a lot these days to write code for R and I'd like to see if there's a way to make an improvement.
The existing command in the R bundle works fine as long as I'm sending just a handful of lines to the R application, but TextMate gives me the beach ball for as much as a minute when I send lots of code over, and then suddenly dumps all the code into R. For reference, here's the short R command:
osascript -e 'tell application "R" to activate' -e "tell application "R" to cmd "${TM_SELECTED_TEXT//"/\"}""
I'm guessing that TM itself doesn't have a problem with the amount of text, and that the bottleneck is in the applescript. Is there any way to speed up how this is done in the event of a large set of commands? For example, could the command be split into an array and run line-by-line? (Would this result in an increase in speed? I have no idea -- just thinking out loud.)
Thanks for suggestions. Cheers- -Alan
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
I have
osascript -e 'tell application "R" to activate' -e "tell application "R" to cmd "${TM_SELECTED_TEXT//"/\"}"" &
in my local bundle (note the ampersand which will at least prevent textmate from locking up by running the applescript in the background)
As Jeff mentioned, upgrading your R may also help (I have since stopped using the R GUI so I can't confirm this myself, although I do remember a few related messages on R-SIG-MAC)
It's nice to know that there are some fellow R users using textmate.
Hadley