def edit_external
      require 'canis/core/include/appmethods'
      require 'tempfile'
      f = Tempfile.new("canis")
      l = self.text
      l.each { |line| f.puts line }
      fp = f.path
      f.flush

      editor = ENV['EDITOR'] || 'vi'
      vimp = %x[which #{editor}].chomp
      ret = shell_out "#{vimp} #{fp}"
      if ret
        lines = File.open(f,'r').readlines
        if @document
          @document.text = lines
          @document.parse_required
          self.text(@document)
          # next line works
          #self.text(lines, :content_type => :tmux)
        else
          set_content(lines)
        end
      end
    end
def edit_external
      require 'canis/core/include/appmethods'
      require 'tempfile'
      f = Tempfile.new("canis")
      l = self.text
      l.each { |line| f.puts line }
      fp = f.path
      f.flush

      editor = ENV['EDITOR'] || 'vi'
      vimp = %x[which #{editor}].chomp
      ret = shell_out "#{vimp} #{fp}"
      if ret
        lines = File.open(f,'r').readlines
        if @document
          @document.text = lines
          @document.parse_required
          self.text(@document)
          # next line works
          #self.text(lines, :content_type => :tmux)
        else
          set_content(lines)
        end
      end
    end
Edit the content of the textpad using external editor defaulting to EDITOR.
 copied from textarea, modified for textpad and document, needs to be tested TODO
 This should not be allowed as a default, some objects may not want to allow it.
 It should be enabled, or programmer should bind it to a key