If no index is specified, then return a list whose elements are the names of all the marks that are currently set. Otherwise only return the names of all existing marks inside the specified range (inclusive the boundary). If only index1 is specified, then this single index is specifying the range.
An useful extension, the traversal with the mark next command is less comfortable than the use of mark names with index specification. Especially the callback of the new watch command may benefit from this extension (looking at the surrounding marks may give an useful hint how to proceed).