         textBuffer.setTextInRange pasteRange, pasteText
         editor.setCursorBufferPosition (textBuffer.positionForCharacterIndex pasteIxRange[0] + pasteText.length)
 
-  # Wrapper for easy access of common variables
+  # TODO: @callbacks and @typedefs somehow need to be global or they cannot be referenced (~ an / don't work).
+  ###*
+   * Wrapper callback for accessing objects common to all list-edit actions.
+   * @global
+   * @callback WrapperCallback
+   * @param {TextEditor}  editor           - The active text editor.
+   * @param {TextBuffer}  textBuffer       - The corresponding text buffer.
+   * @param {string}      bufferText       - The text string for textBuffer.
+   * @param {number[]}    selectionIxRange - Character index range ([startIx, endIx]) for the most recently added user selection (multiple ranges are not supported).
+   * @param {ElementList} elementList      - The element list that contains selectionIxRange.
+   * @param {number[]}    listSelection    - List-element index range corresponding to selectionIxRange.
+  ###
+
+  ###*
+   * Wrapper that creates the ElementList object and provides access to common objects.
+   * @param  {WrapperCallback} callback - Is only called if there is a valid element list for the current selection.
+  ###
   withSelectedList: (callback) ->
     editor = atom.workspace.getActiveTextEditor()
     if editor?
       textBuffer = editor.getBuffer()
       bufferText = textBuffer.getText()
       selectionIxRange = TextManipulation.getIxRangeForRange textBuffer, (editor.getSelectedBufferRange())
-      ignoreRanges = @scanIgnoreRanges editor, textBuffer, bufferText
+      ignoreRanges = @scanIgnoreRanges editor
       elementList = TextManipulation.ElementList.getElementList bufferText, ignoreRanges, selectionIxRange
       if not elementList?
         atom.notifications.addWarning 'Selection is not in well-formed list.'

{CompositeDisposable, Range, TextBuffer} = require 'atom'
_ = require 'underscore-plus'
TextManipulation = require './text-manipulation'

          # Can also use => in the definition of the callbacks that require @, but this is safer
          (callback.bind this) editor, textBuffer, bufferText, selectionIxRange, elementList, listSelection

  ###*
   * Clipboard metadata for list-edit operations. Contains the specifics for the source list of a copy or cut operation.
   *
   * @global
   * @typedef {Object} ListEditMeta
   * @property {string}     id                - Is always 'list-edit-clip-meta'.
   * @property {string}     openBracket       - String of length 1.
   * @property {string}     initialWhitespace - Whitespace following the opening bracket.
   * @property {string}     finalWhitespace   - Whitespace preceding the closing bracket.
   * @property {string}     separator         - String of length 1.
   * @property {number[][]} eltRanges         - Character index in clipboard string (not buffer) for actual list elements (without leading/trailing whitespace).
  ###

  ###*
   * Create clipboard metadata object.
   *
   * @param  {ElementList} elementList Source element list for the clip.
   * @param  {number} selStart    Buffer-text index of start of selection.
   * @param  {number} selEnd      Buffer-text index of end of selection.
   * @return {ListEditMeta}
  ###
  mkListEditMeta: (elementList, selStart, selEnd) ->
    { startIx: listStartIx, endIx: listEndIx
    , openBracket: openBracket, separator: separator
