If text-only? is #f, then menu items that insert
non-text snips (such as Insert Image...) are appended to
the menu.

If popup-position is not #f, then append-editor-operation-menu-items
is expected to have been called to build a popup menu and the two elements
of the list should be the text% object where the mouse was clicked
for the popup menu and the position where the click happened. In that case,
the Copy and Cut menus are enabled when the click
lands on a snip that is not a string-snip%, and the corresponding
callbacks will copy and cut that one snip.

The initializer takes a keymap object and returns nothing. The default
initializer chains the given keymap to an internal keymap that
implements standard text editor keyboard and mouse bindings for cut,
copy, paste, undo, and select-all. The right mouse button is mapped
to popup an edit menu when the button is released. On Unix,
start-of-line (Ctl-A) and end-of-line (Ctl-E) are also mapped.

On Unix, editor selections conform to the X11 Windows selection
conventions. If on is
#f, the behavior is switched exclusively to the clipboard-based convention
(where copy must be explicitly requested before a paste).

Opens filename (in 'binary mode) and checks whether it looks
like a “graphical” file in editor format. If the file does not
appear to be an editor file, the file port is returned with line
counting enabled. Otherwise, the file is loaded into an editor, and
the result port is created with
open-input-text-editor.

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. 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 special value for the
port through the read-special method. If
snip-filter returns any other kind of snip, it is copied for
the special result. Finally, a non-snip first result from
snip-filter is used directly as the special result.

The port-name argument is used for the input port’s name. The
expect-to-read-all? argument is a performance hint; use
#t if the entire port’s stream will be read.

To help guard against such uses, if lock-while-reading? argument is
a true value, then open-input-text-editor will
lock the text-editor and call
begin-edit-sequence
before it returns and unlock it and
call end-edit-sequence
after it is safe to use the above methods. (In some
cases, it will not lock the editor
or put it in an edit sequence at all,
if using those methods are always safe.)

Creates an output port that delivers its content to text-editor.
The content is written to text-editor starting at the position
start-position, where 'end indicates that output should
start at the text editor’s current end position.

If special-filter is provided, it is applied to any value
written to the port with write-special, and the result is
inserted in its place. If a special value is a snip%
object, it is inserted into the editor. Otherwise, the special value
is displayed into the editor.

If line counting is enabled for the resulting output port, then the
port will report the line, offset from the line’s start, and position
within the editor at which the port writes data.

If eventspace is not #f, then when the output port
is used in a thread other than eventspace’s handler thread,
content is delivered to text-editor through a low-priority
callback in eventspace. Thus, if eventspace
corresponds to the eventspace for the editor’s displays,
writing to the output port is safe from any thread.

If eventspace is #f, beware that the port is only
weakly thread-safe. Content is delivered to text-editor in
an edit sequence, but an edit sequence is not enough
synchronization if, for example, the editor is displayed in an
enabled editor-canvas%. See Editors and Threads for
more information.

Reads version information from in-base, where in-base is
the base for in. The version information parsed from
in-base is recorded in in for later version-sensitive
parsing. The procedure result is true if the version information was
read successfully and if the version is supported.

If parse-format? is true, then in-base is checked for an
initial "WXME" format indicator. Use #f when
"WXME" has been consumed already by format-dispatching code.

If raise-errors? is true, then an error in reading triggers an
exception, instead of a #f result.

The handler recognizes editor files by the first twelve characters of
the file: WXME01‹digit›‹digit›##.
Such a file is opened for loading by creating a text%
object, loading the file into the object with insert-file, and then converting the editor content into a port with
open-input-text-editor. After obtaining a port in this way,
the content is read in essentially the same way as by the default
Racket load handler. The difference is that the editor may contain
instances of readable-snip<%>, which are “read” though the
snips’ read-special method; see
open-input-text-editor for details.