Changes

Jump to navigation Jump to search
1,043 bytes added ,  03:47, 28 January 2008
→‎weird tab completions: and \stopsomething
== document creation of autocomplete scripts ==
== fix some weird tab completions ==
This is wrong:How does one use this one?
<nowiki>\date ${1:[${2:...,...=...,...}]}[${3:...,...,...}]
$4</nowiki>
 Also, it would be nice to:* be able do completion as it replaces \definesomething [...] [...]* use sensible names instead of dots where possible (maybe misusing italic is possible) \externalfigure [file][...,...=...,...]* have the brackets as wellendings: \stopsomething for example (cloned from HTML):  <nowiki>#!/usr/bin/env ruby doc = STDIN.readline = ENV['TM_LINE_NUMBER'].to_iline_index = ENV['TM_LINE_INDEX'].to_i if ENV.has_key? 'TM_INPUT_START_LINE' then line = ENV['TM_INPUT_START_LINE'].to_i line_index = ENV['TM_INPUT_START_LINE_INDEX'].to_iend before = /(.*\n){#{line-1}}.{#{line_index}}/.match(doc)[0] #before.gsub!(/<[^>]+\/\s*>/i, '') # remove all commentsbefore.gsub!(/[%].*/, '') stack = [ ]before.scan(/\\(start|stop)([a-zA-Z]+)/) do |m| if m[0] == 'start' then stack << m[1] else until stack.empty? do close_tag = stack.pop # print ">>#{close_tag}" break if close_tag == m[1] end endend if stack.empty? then %x{ osascript -e beep &>/dev/null & }else print "\\stop#{stack.pop}"end</nowiki>

Navigation menu