Page 279 Table of Contents Index Page 281
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 27. COMMAND PROCESSING


27.6 The Command Processor

Once a set of commands has been defined, CLIM provides a variety of means to read a command.
These are all mediated by the Command Processor.

=> read-command command-table &key (stream *query-io*) command-parser command-unparser
partial-command-parser use-keystrokes
[Function]
read-command is the standard interface used to read a command line. stream is an extended
input stream, and command-table is a command table designator.

command-parser must be a function of two arguments, a command table and a stream. It reads
a command from the user and returns a command object. The default value for command-parser
is the value of *command-parser*.

command-unparser must be a function of three arguments, a command table, a stream, and a
command to "unparse". It prints a textual description of the command its supplied arguments
onto the stream. The default value for command-unparser is the value of *command-unparser*.

partial-command-parser must be a function of four arguments, a command table, a stream, a
partial command, and a start position. The partial command is a command object with the
value of *unsupplied-argument-marker* in place of any argument that needs to be filled in.
The function reads the remaining, unsupplied arguments in any way it sees fit (for example, via
an accepting-values dialog), and returns a command object. The start position is the original
input-editor scan position of the stream, when the stream is an interactive stream. The default
value for partial-command-parser is the value of *partial-command-parser*.

command-parser, command-unparser, and partial-command-parser have dynamic extent.

When use-keystrokes is true, the command reader will also process keystroke accelerators. (Im-
plementations will typically use with-command-table-keystrokes and read-command-using-
keystrokes
to implement the case when use-keystrokes is true.)

Input editing, while conceptually an independent facility, fits into the command processor via its
use of accept. That is, read-command must be implemented by calling accept to read command
objects, and accept itself makes use of the input editing facilities.

=> with-command-table-keystrokes (keystroke-var command-table) &body body [Macro]
Binds keystroke-var to a sequence that contains all of the keystroke accelerators in command-
table
's menu, and then executes body in that context. command-table is a command table desig-
nator
. body may have zero or more declarations as its first forms.

=> read-command-using-keystrokes command-table keystrokes &key (stream *query-io*) command-
parser command-unparser partial-command-parser
[Function]
Reads a command from the user via command lines, the pointer, or a single keystroke, and
returns either a command object, or a keyboard gesture object if the user typed a keystroke that


Page 279 Table of Contents Index Page 281
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