# File lib/plugins/haml.rb, line 39
    def editor(extname)
      unless cmd = ENV['VISUAL'] || ENV['EDITOR']
        raise 'Please set VISUAL or EDITOR variable.'
      end

      # XXX: works only in Ruby 1.8.7 or later
      Tempfile.open(['tmp', ".#{extname}"]) do |f|
        system cmd, f.path
        return f.read
      end
    end