Page 244 Table of Contents Index Page 246
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E



CHAPTER 24. INPUT EDITING AND COMPLETION FACILITIES

Members of this class are mutable.

=> with-input-editing (&optional stream &key input-sensitizer initial-contents) &body body [Macro]
Establishes a context in which the user can edit the input typed in on the interactive stream
stream. body is then executed in this context, and the values returned by body are returned as
the values of with-input-editing. body may have zero or more declarations as its first forms.

The stream argument is not evaluated, and must be a symbol that is bound to an input stream.
If stream is t (the default), *query-io* is used. If stream is a stream that is not an interactive
stream, then with-input-editing is equivalent to progn.

input-sensitizer, if supplied, is a function of two arguments, a stream and a continuation func-
tion; the function has dynamic extent. The continuation, supplied by CLIM, is responsible for
displaying output corresponding to the user's input on the stream. The input-sensitizer function
will typically call with-output-as-presentation in order to make the output produced by the
continuation sensitive.

If initial-contents is supplied, it must be either a string or a list of two elements, an object
and a presentation type. If it is a string, the string will be inserted into the input buffer using
replace-input. If it is a list, the printed representation of the object will be inserted into the
input buffer using presentation-replace-input.

=> with-input-editor-typeout (&optional stream) &body body [Macro]
Establishes a context inside of with-input-editing in which output can be done by body to the
input editing stream stream. with-input-editor-typeout should call fresh-line before and
after evaluating the body. body may have zero or more declarations as its first forms.

The stream argument is not evaluated, and must be a symbol that is bound to a stream. If
stream is t (the default), *query-io* is used. If stream is a stream that is not an input editing
stream, then with-input-editor-typeout is equivalent to calling fresh-line, evaluating the
body, and then calling fresh-line again.

24.1.1 The Input Editing Stream Protocol

Input editing streams obey both the extended input and extended output stream protocols,
and must support the generic functions that comprise those protocols. For the most part,
this will simply entail "trampolining" those operations to the encapsulated interactive stream.
However, some generic functions as stream-read-gesture and stream-unread-gesture will
need methods that observe the use of the input editor's scan pointer.

Input editing streams will typically also implement methods for prompt-for-accept (in order
to provide in-line prompting that interacts correctly with input editing) and stream-accept (in
order to cause accept to obey the scan pointer).

The following generic functions comprise the remainder of the input editing protocol, and must


Page 244 Table of Contents Index Page 246
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E