Previous Section | Next Section | Table of Contents | Glossary | Index |
Some primitives such as prompt-for-key and commands such as Emacs query replace read key-events directly from the keyboard instead of using the command interpreter. To encourage consistency between these commands and to make them portable and easy to customize, there is a mechanism for defininglogical key-events. A logical key-event is a keyword which stands for some set of key-events. The system globally interprets these key-events as indicators a particular action. For example, the :help logical key-event represents the set of key-events that request help in a given Hemlock implementation. This mapping is a many-to-many mapping, not one-to-one, so a given logical key-event may have multiple corresponding actual key-events. Also, any key-event may represent different logical key-events.
There are many default logical key-events, some of which are used by functions documented in this manual. If a command wants to read a single key-event command that fits one of these descriptions then the key-event read should be compared to the corresponding logical key-event instead of explicitly mentioning the particular key-event in the code. In many cases you can use the command-case macro. It makes logical key-events easy to use and takes care of prompting and displaying help messages.
:abort Indicates the prompter should terminate its activity without performing any closing actions of convenience, for example.
:yes Indicates the prompter should take the action under consideration.
:no Indicates the prompter should NOT take the action under consideration.
:do-all Indicates the prompter should repeat the action under consideration as many times as possible.
:do-once Indicates the prompter should execute the action under consideration once and then exit.
:help Indicates the prompter should display some help information.
:confirm Indicates the prompter should take any input provided or use the default if the user entered nothing.
:quote Indicates the prompter should take the following key-event as itself without any sort of command interpretation.
:keep Indicates the prompter should preserve something.
:y Indicates a short positive response
:n Indicates a short negative response
Define a new logical key-event whenever:
The key-event concerned represents a general class of actions, and several commands may want to take a similar action of this type.
The exact key-event a command implementor chooses may generate violent taste disputes among users, and then the users can trivially change the command in their init files.
You are using command-case
which prevents implementors from
specifying non-standard characters for dispatching in otherwise
possibly portable code, and you can define and set the logical
key-event in a site dependent file where you can mention
implementation dependent characters.
Previous Section | Next Section | Table of Contents | Glossary | Index |