Next: , Previous: , Up: The Echo Area   [Contents][Index]


12.4 Defining New Prompting Functions

Prompting functions are implemented as a recursive edit in the Echo Area buffer. Completion, help, and other parsing features are implemented by commands which are bound in Echo Area Mode.

A prompting function passes information down into the recursive edit by binding a collection of special variables.

Variable: *parse-verification-function*

The system binds this to a function that Confirm Parse calls. It does most of the work when parsing prompted input. Confirm Parse passes one argument, which is the string that was in parse-input-region when the user invokes the command. The function should return a list of values which are to be the result of the recursive edit, or nil indicating that the parse failed. In order to return zero values, a non-nil second value may be returned along with a nil first value.

Variable: *parse-string-tables*

This is the list of string-tables, if any, that pertain to this parse.

Variable: *parse-value-must-exist*

This is bound to the value of the :must-exist argument, and is referred to by the verification function, and possibly some of the commands.

Variable: *parse-default*

When prompting the user, this is bound to a string representing the default object, the value supplied as the :default argument. Confirm Parse supplies this to the parse verification function when the parse-input-region is empty.

Variable: *parse-default-string*

When prompting the user, if parse-default is nil, Hemlock displays this string as a representation of the default object; for example, when prompting for a buffer, this variable would be bound to the buffer name.

Variable: *parse-type*

The kind of parse in progress, one of :file, :keyword or :string. This tells the completion commands how to do completion, with :string disabling completion.

Variable: *parse-prompt*

The prompt being used for the current parse.

Variable: *parse-help*

The help string or function being used for the current parse.

Variable: *parse-starting-mark*

This variable holds a mark in the echo-area-buffer which is the position at which the parse began.

Variable: *parse-input-region*

This variable holds a region with parse-starting-mark as its start and the end of the echo-area buffer as its end. When Confirm Parse is called, the text in this region is the text that will be parsed.


Next: Some Echo Area Commands, Previous: Control of Parsing Behavior, Up: The Echo Area   [Contents][Index]