# Encoding: UTF-8 [{beforeRunningCommand: "nop", command: "# Evaluate the current seletion in our Scheme interpreter\n#\n# The interpreter you use should be set in the environment\n# variable TM_SCHEME_EVALUATOR \n\nINTERPRET=${TM_SCHEME_INTERPRETER:=csi}\nCMD=$(basename \"$INTERPRET\")\n\n# Run depending on the system are we on?\nif [ $CMD == \"mzscheme\" ] ; then\n\n\t# Check mzscheme version for decimal;\n\t# command-line behavior changed between\n\t# v372 and v4.0\n\n\tVER=$(\"$INTERPRET\" -v | sed -E 's/^Welcome to MzScheme v([^ ]+).*$/\\1/')\n\n\t# version 4.0 or later\n\tif (echo $VER | grep -q '\\.') ; then\n\t\t\"$INTERPRET\" -e \"$TM_SELECTED_TEXT\"\n\t# version 372 or earlier\n\telse\n\t\t\"$INTERPRET\" -vm -e \"$TM_SELECTED_TEXT\"\n\tfi\nelif [ $CMD == \"csi\" ] ; then\n\t\"$INTERPRET\" -q < /dev/stdin\nfi", fallbackInput: "line", input: "selection", keyEquivalent: "^E", name: "Evaluate Selection", output: "showAsTooltip", scope: "source.scheme", uuid: "B270255C-1AE7-47FA-B3A7-38E983402C36"}, {beforeRunningCommand: "nop", command: "#!/usr/bin/env ruby\n\nrequire ENV[\"TM_SUPPORT_PATH\"] + \"/lib/tm/executor\"\nrequire ENV[\"TM_SUPPORT_PATH\"] + \"/lib/tm/save_current_document\"\nrequire ENV[\"TM_SUPPORT_PATH\"] + \"/lib/escape\"\n\nTextMate.save_current_document\nTextMate::Executor.make_project_master_current_document\n\ninterpreters = [\"mzscheme\", \"csi\", \"guile\"]\nargs = []\nargs << (ENV[\"TM_SCHEME\"] || interpreters.select{|ii| ENV[\"PATH\"].split(\":\").any?{|dd| File.executable? File.join(dd, ii)}}.first)\n\ncase args[0]\nwhen \"mzscheme\"\n args << \"-e\" << '(require (lib \"errortrace.ss\" \"errortrace\"))' << \"-r\"\nelse\n args << \"-s\"\nend\n\nTextMate::Executor.run(args, ENV[\"TM_FILEPATH\"]) do |line,type|\n if line =~ /(.*):([0-9]+):([0-9]+):(.*)/ then\n unless ENV[\"TM_FILE_IS_UNTITLED\"] == \"true\"\n \"\#{htmlize($1)}:\#{$2}:\#{$3}:\#{htmlize($4)}\"\n else\n \"\#{htmlize($1)}:\#{$2}:\#{$3}:\#{htmlize($4)}\"\n end\n end\nend\n \n\n\n# def printheader(schemesystem, interpreter)\n# print <<-ENDHTML\n# \n# \n# Scheme TextMate Runtime\n# \n# \n#
\n# Executed Scheme file in \#{schemesystem} (\#{interpreter})\n#
\n# ENDHTML\n# end\n# \n# def printend\n# print <<-ENDHTML\n# \n# \n# ENDHTML\n# end\n# \n# def printoutput(ioport)\n# puts \"
\"\n# ioport.each do |line| \n# puts \"
\"\n# puts line\n# puts \"
\"\n# end\n# puts \"
\"\n# end\n# \n# def makeerrorlink(line, system)\n# case system\n# when \"mzscheme\"\n# a = line.split(':', 4)\n# file = a[0]\n# line = a[1]\n# column = a[2]\n# exp = a[3]\n# \"
\" +\n# File.basename(file) + \" line \#{line}, column \#{column}
\" +\n# '
' + \n# escape(exp) + \"
\"\n# end\n# end\n# \n# def printerrors(errorfile, system)\n# puts \"
\"\n# puts \"\"\n# errors = 0\n# f = File.new(errorfile) \n# f.each do |line|\n# errors = 1\n# case system\n# when \"mzscheme\"\n# if line =~ /:[0-9]+:[0-9]+:/ then\n# puts makeerrorlink(line, system)\n# else\n# puts \"
\"\n# puts line\n# puts \"
\"\n# end\n# when \"csi\"\n# if line =~ /^Error/ then\n# puts \"
\"\n# puts line\n# puts \"
\" \n# else\n# puts \"
\"\n# puts line\n# puts \"
\"\n# end\n# else\n# puts \"
\"\n# puts line\n# puts \"
\" \n# end\n# end\n# if errors == 0\n# puts \"Program exited normally.\"\n# end\n# puts \"
\"\n# end\n\n\n\n# error_fd ||= IO.for_fd(ENV[\"TM_ERROR_FD\"].to_i)\n# case type\n# when :err # \n# if str =~ /^([^\\:]+):(\\d+):(\\d+): (.*?): (.*) \\((-?\\d+)\\)$/ then\n# filepath, start, stop, err, msg, status = $1, $2.to_i, $3.to_i, $4, $5, $6\n# \n# err = err.gsub(/\\b\\w(?=\\w{3,})/) { |m| m.upcase }\n# \n# error_fd << \"
\\n\"\n# error_fd << \"

\#{htmlize err}: \#{htmlize msg}

\\n\"\n# \n# from = document[0..start].rindex(/^/)\n# to = start + document[start..-1].index(/$/)\n# src = document[from...to]\n# \n# line = document[0...start].count(\"\\n\") + 1\n# column = start - from\n# \n# link = \"txmt://open?line=\#{line}&column=\#{column}\"\n# error_fd << \"
\#{src}\\n\"\n#     error_fd << \"\#{' ' * (column)}↑
\"\n# error_fd << \"
line \#{line}, column \#{column} in \#{ENV['TM_DISPLAYNAME']}\\n\"\n# \n# error_fd << \"

Error \#{status}.

\\n\"\n# error_fd << \"
\\n\"\n# \n# error_fd.flush\n# \"\"\n# else\n# \"\#{htmlize(str)}
\"\n# end\n# when :out\n# htmlize(str)\n# end\n\n\n# Run the current document in our Scheme interpreter.\n#\n# The interpreter you use should be set in the environment\n# variable TM_SCHEME_INTERPRETER.\n#\n\n# # Save file, use tmp-file if there's no filepath.\n# [[ -z \"$TM_FILEPATH\" ]] && TM_TMPFILE=$(mktemp -t pythonmate)\n# : \"${TM_FILEPATH:=$TM_TMPFILE}\"; cat >\"$TM_FILEPATH\"\n# \n# # set up variables\n# INTERPRET=${TM_SCHEME_INTERPRETER:=csi}\n# CMD=$(basename \"$INTERPRET\")\n# SHOWOUTPUT=\"$TM_BUNDLE_SUPPORT/showoutput.rb\"\n# TM_ERRORTEMP=$(mktemp -t scheme)\n# \n# # Run depending on the system are we on?\n# if [ $CMD == \"mzscheme\" ] ; then\n# \"$INTERPRET\" -e '(require (lib \"errortrace.ss\" \"errortrace\"))' -r \"$TM_FILEPATH\" 2>\"$TM_ERRORTEMP\" | \"$SHOWOUTPUT\" \"$INTERPRET\" \"$TM_ERRORTEMP\"\n# elif [ $CMD == \"csi\" ] ; then\n# \"$INTERPRET\" -s \"$TM_FILEPATH\" 2>\"$TM_ERRORTEMP\" | \"$SHOWOUTPUT\" \"$INTERPRET\" \"$TM_ERRORTEMP\"\n# elif [ $CMD = \"guile\" ] ; then\n# \"$INTERPRET\" -s \"$TM_FILEPATH\" 2>\"$TM_ERRORTEMP\" | \"$SHOWOUTPUT\" \"$INTERPRET\" \"$TM_ERRORTEMP\"\n# fi\n# \n# # Delete tempfiles\n# rm -f \"$TM_TMPFILE\"\n# rm -f \"$TM_ERRORTEMP\" ", input: "document", keyEquivalent: "@r", name: "Run Script", output: "showAsHTML", scope: "source.scheme", uuid: "CBFEB6F9-D38C-4726-BD16-325E3FCC0C6B"}, {beforeRunningCommand: "nop", command: "osascript -e \"tell application \\\"Terminal\\\"\n do script \\\"clear; ${TM_SCHEME_INTERPRETER:=csi}\\\"\n activate\nend tell\"\n", input: "none", keyEquivalent: "^I", name: "Start Interpreter", output: "discard", scope: "source.scheme", uuid: "887AF89E-004D-42AC-B29E-D90B0147F6DC"}]