From dave.baldwin@3dlabs.com Thu Dec 22 11:35:30 2005 From: Dave Baldwin To: textmate@lists.macromates.com Subject: Re: [TxMt] XCode like behaviour and hyperlink problem Date: Thu, 22 Dec 2005 11:35:23 +0000 Message-ID: <79762C82-EB52-4B10-A488-30FDB4CC0004@3dlabs.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0381643342998248047==" --===============0381643342998248047== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 21 Dec 2005, at 17:30, Charilaos Skiadas wrote: > Dave > 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 > like: > M=${TM_LATEX_MASTER:=$TM_FILEPATH} > 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: /Users/dave/Chips/DES/mediaUI/Classes/ui.rb:63:in `initialize': undefined method `readConfigW' for # (NoMethodError) from /Users/dave/Chips/DES/mediaUI/Classes/os_gl.rb:32:in `initialize' from start.rb:34 but from within TextMate the HTML looks like:

NoMethodError: undefined method `readConfigW' for #<UI:0x35b84c @allowTransition=false, @keysFromFile=false>

method initializein ui.rb at line 63
method initializein os_gl.rb at line 32
at top levelin start.rb at line 34
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 through here). 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. Dave. >> Thanks for any help, >> >> Dave. > > Haris > > > > ______________________________________________________________________ > For new threads USE THIS: textmate(a)lists.macromates.com > (threading gets destroyed and the universe will collapse if you don't) > http://lists.macromates.com/mailman/listinfo/textmate --===============0381643342998248047==--