open-input-text-editor in Editors
(open-input-text-editor -> input-port
text-editor start-position end-position snip-filter)
text-editor : text% object
start-position = : exact non-negative integer
0
end-position = : exact non-negative integer or 'end'end
snip-filter = : a procedure of one argument: a (lambda (s) (values s 1))snip% object
Creates an input port that draws its content from text-editor.
The editor content between positions start-position and
end-position is the content of the port. If end-position
is 'end, the content runs until the end of the editor. If a
snip that is not a string-snip% object spans
start-position or end-position, the entire snip
contributes to the port. If a string-snip% instance spans
start-position, only the part of the snip after
start-position contributes, and if a string-snip%
object spans end-position, only the part before
end-position contributes.
An instance of string-snip% in text-editor generates
a character sequence in the resulting port. All other kinds of snips
are passed to snip-filter to obtain a ``special'' value for the
port, plus the special value's span. If a snip is returned as the
first result from snip-filter, and if the snip is an instance
of readable-snip<%>, the snip generates a sequence of special
values (and spans) for the port through the
read-one-special method. If
snip-filter returns any other kind of snip, it is copied for
the special result, and the second result of snip-filter is
used as the span. Finally, a non-snip first result from
snip-filter is used directly as the special result, and the
second value from snip-filter is the span.