         null
 
   # Converts an object to a function.
-  # 
-  # If the passed object is a string, it will be converted using 
+  #
+  # If the passed object is a string, it will be converted using
   # ST.stringToProc.
   toProc: (object) ->
     if object.call

    ST._history.push command if command.reverse
    ST._command = null
    command
  
  command: (name, forward, reverse=null) ->
    command = @beginCommand name
    result = forward()
    command.reverse = reverse
    @endCommand()
    result
  
  undo: ->
    if command = ST._history.pop()
      console.log "Undo command: #{command.name}" if _logging
      command.reverse()
  
  once: (key, fn) ->
    if ST._command
      ST._command.oneTimeTasks[key] ||= fn

        }
        return -1;
    };
  `
