[TxMt] New version breaks LaTeX templates?

Charilaos Skiadas skiadas at hanover.edu
Thu Nov 2 03:21:23 UTC 2006


On Nov 1, 2006, at 10:11 PM, Paul Starr wrote:

>
> On Nov 1, 2006, at 5:03 PM, Charilaos Skiadas wrote:
>
>> I'm very glad to hear people are using the LaTeX template command!
>
> Oh yes, it's wonderfully handy.
>
>> So first of all, restart textmate and try again, just to be on the  
>> safe side. Then, in the bundle editor, change the command's output  
>> to "Insert as Text" instead of "insert as Snippet".
>> This will give us a bit more of the error output, so that we can  
>> see where the problem is.
>
> It says:
>
> /tmp/temp_textmate.ClFG6H:8: undefined method `+' for nil:NilClass  
> (NoMethodError)
>
This is how the script looks like right now:

#!/usr/bin/ruby
# This command is meant to be used for quick insertion of your LaTeX  
template files. They should be placed
# in the directory ~/Library/Application Support/LaTeX/Temmlates. A  
pop-up is provided, letting you pick
# the template file you want inserted, and then it gets inserted as a  
snippet. See
# http://macromates.com/textmate/manual/snippets#snippets for what  
this implies.
require ENV['TM_SUPPORT_PATH'] + '/lib/exit_codes.rb'
require ENV['TM_SUPPORT_PATH'] + '/lib/dialog.rb'
require ENV['TM_SUPPORT_PATH'] + '/lib/escape.rb'
path = ENV['HOME'] + '/Library/Application Support/LaTeX/Templates/'
unless FileTest.directory?(path) then
   TextMate.exit_show_tool_tip "You need to create the directory # 
{path} first and\n populate it with your favorite LaTeX template  
files before using this command."
else
   files = `ls "#{path}"`.split("\n")
   TextMate.exit_tool_tip "You need to populate the template  
directory with some template files!" if files.empty?
   file_choice = Dialog.menu(files)
	# Need to fix this exit call here. It should not remove the "temp"  
part.
   TextMate.exit_discard if file_choice.nil?
   print(e_sn(File.read(path + files[file_choice])))
end


As you can see, line 8 is the third of those requires, so I can't see  
how it can fail without the others failing first. Or perhaps it's ENV 
['HOME'] that fails? Anyway, make sure the code looks exactly like  
what I have above.

If you are on IRC, we can probably try to resolve this through the  
#textmate channel.

> ... maybe my ruby is broken, somehow?
>
> --p

Haris





More information about the textmate mailing list