 Q = require 'q'
 {deprecate} = require 'grim'
 {Model} = require 'theorist'
-{Subscriber} = require 'emissary'
-EmitterMixin = require('emissary').Emitter
-{Emitter} = require 'event-kit'
+{Emitter, Subscriber} = require 'emissary'
 Serializable = require 'serializable'
 TextBuffer = require 'text-buffer'
 {Directory} = require 'pathwatcher'


  constructor: ({path, @buffers}={}) ->
    @buffers ?= []
    @emitter = new Emitter

    for buffer in @buffers
      do (buffer) =>
        buffer.onDidDestroy => @removeBuffer(buffer)

    @setPath(path)

  ###
  Section: Event Subscription
  ###

  # Essential: Invoke the given callback when the project's path has changed.
  #
  # * `callback` {Function}
  #   * `path` the new path
  onDidChangePath: (callback) ->
    @emitter.on 'did-change-path', callback

  on: (eventName) ->
    switch eventName
      when 'path-changed'
        deprecate 'Use Project::onDidChangePath instead'
      else
        deprecate 'Project::on is deprecated. Use event subscription methods instead.'
    EmitterMixin::on.apply(this, arguments)

  ###
  Section: Methods
  ###

  serializeParams: ->
    path: @path

    else
      @rootDirectory = null

    @emit "path-changed"

  # Public: Returns the root {Directory} object for this project.
  getRootDirectory: ->
