 
   makeBus: ->
     @bus = new Bacon.Bus()
+    @emit = new Bacon.Bus()
 
   startSCLang: () ->
     opts =

        when 'compileError'
          # stdout
          # dirs
          for error in error.errors
            @bus.push rendering.renderParseError(error)
            # update any of these files that are open
            # goto first error

        # initFailure
        # descrepency
        # systemError
        else
          @bus.push("<div class='error'>ERROR: #{state}</div>")
          @bus.push("<div class='pre error'>#{error}</div>")


  constructor: (@uri="sclang://localhost:57120", projectRoot, @onClose) ->
    @projectRoot = projectRoot
    @ready = Q.defer()
    @makeBus()

  stop: ->
    @sclang?.quit()
    @postWindow.destroy()

  createPostWindow: ->

    onClose = () =>
      @sclang?.quit()
