On Apr 8, 2009, at 4/8/093:05 PM, Allan Odgaard wrote:
If this is a TextMate command you can do:
#!/usr/bin/env ruby require "#{ENV['TM_SUPPORT_PATH']}/lib/escape" arg = STDIN.read arg.chomp! system("pointfree #{e_sh arg}")
Ok, that helped some, but I ended up using e_as instead as the appropriate method. However, I still can't get it to escape backticks properly. Here's the script now:
#!/usr/bin/env ruby require "#{ENV['TM_SUPPORT_PATH']}/lib/escape" arg = STDIN.read arg.chomp! arg = e_as arg arg.gsub!("`", "\`") puts("pointfree "" + arg + """)
The puts is just for debugging purposes. When I run this command on the selected text:
\x y -> x `div` y
I am hoping to get:
pointfree "\x y -> x `div` y"
But I get this instead:
pointfree "\x y -> x \x y -> x div\x y -> x `div y"