   run_context =
     current_options: {}
     default_options: default_options
-    output: ($document) ->
+    output: (output) ->
       $item = $ '<div class="item"/>'
-      if $document?
-        $item.append $document
+      if output?
+        $item.append output
       $el.append $item
       $item
     success: ->

          lead_string = lead.to_string result
          if $.type(result) == 'function'
            ops.text "#{lead_string} is a Graphite function"
            run_in_info_context "docs #{result.values[0]}"
          else
            ops.text "What do you want to do with #{lead_string}?"
            for f in ['data', 'graph', 'img', 'url']

  context =
    used: false
    editor: editor
    rendered: -> editor.refresh()
    $el: $el
    hide: -> $el.hide()
    is_clean: -> editor.getValue() is '' and not @.used
