 {Range} = require 'text-buffer'
 _ = require 'underscore-plus'
-{Emitter} = require 'event-kit'
+{CompositeDisposable, Emitter} = require 'event-kit'
 Grim = require 'grim'
 
 # Essential: Represents a buffer annotation that remains logically stationary

    @oldTailScreenPosition = @getTailScreenPosition()
    @wasValid = @isValid()

    @subscribe @bufferMarker.onDidDestroy => @destroyed()
    @subscribe @bufferMarker.onDidChange (event) => @notifyObservers(event)

  # Essential: Destroys the marker, causing it to emit the 'destroyed' event. Once
  # destroyed, a marker cannot be restored by undo/redo operations.
  destroy: ->
    @bufferMarker.destroy()
    @unsubscribe()

  # Essential: Creates and returns a new {Marker} with the same properties as this
  # marker.

    @displayBuffer.pixelRangeForScreenRange(@getScreenRange(), false)

if Grim.includeDeprecations
  EmitterMixin = require('emissary').Emitter
  EmitterMixin.includeInto(Marker)

  Marker::on = (eventName) ->
    switch eventName
