On Dec 21, 2005, at 10:11 AM, Dave Baldwin wrote:
1. I would like the run script command (command R) to save all
files and run my designated 'main' file - this may not be the one
that is currently open. This is what Xcode does and while I could
write a macro to do this it would seem a generally useful thing to
have built in.
You can probably do what we do in the LaTeX bundle. In there, you
can define a project specific environment variable, in that case
TM_LATEX_MASTER, and have that be used if it is set, via a command
and then using "$M" whenever you need to. Take a look at the
"Typeset & View (PDF)" command in the LaTeX bundle.
As for saving all files in project, you can set that as the "Save:"
option in the command editing window. As I understand it, it is not
currently set up because this way you an execute a Ruby script
even if it is not saved, by saving it in a temporary directory, as
the current command does. So I would consider this a separate
command, preferably associated to cmd-B (for build).
2. When I run script (command R) in my
'main' ruby file I get an
error window popping up, but when I click on any of the hyper
links a blank file is opened, rather the one identified in the
error line. The file in error is in the project.
I believe that we do that also in the LaTeX bundle, same command.
Not sure how we accomplish it though. I think there is a script
doing that, but I haven't looked into it too closely.
I have looked in the Ruby bundle, but what is
going on is a
mystery to me.
What part of the Ruby bundle are you referring to?
I was looking at the tmruby.rb file.
I have spend some time looking at the Run script and the tmruby file
and basically understand what they are doing. I don't think it is
too hard to get the behaviour I want, and having a TM_MAIN_RUBY or
some such variable as you have for Latex looks like the best way,
particularly as this can be bound to a project. Thanks for this tip.
My main frustration is not being able to click through on reported
errors. While I understand what the script is doing, I don't
understand why the error produces different results when run from the
terminal or within TextMate.
From the terminal I get:
undefined method `readConfigW' for #<UI:0x11087cc
@allowTransition=false, @keysFromFile=false> (NoMethodError)
but from within TextMate the HTML looks like:
<p id="exception"><strong>NoMethodError</strong>: undefined
`readConfigW' for #<UI:0x35b84c @allowTransition=false,
<blockquote><table border="0" cellspacing="0"
<tr><td><a class="near" title="in ./Classes/ui.rb"
<strong>ui.rb</strong> at line
title="in ./Classes/os_gl.rb" href="txmt://open?url=file://./Classes/
strong> at line 32</td></tr><tr><td><a
class="near" title="in /Users/
td><td>in <strong>start.rb</strong> at line
The two differences are
1. In 'top level' line in terminal just includes the file name while
in the HTML it has the full path name in the url (and I can click
2. The lower level lines in terminal have the fully qualified path
name, but the HTML is relative to the top level file (and clicking
through just opens an empty window
Maybe the cause is the fork?
One fix would be to combine the top level path with the lower level
paths when making the url to make it an absolute path.
Thanks for any
For new threads USE THIS: textmate(a)lists.macromates.com
(threading gets destroyed and the universe will collapse if you don't)