Next: , Up: Commands   [Contents][Index]


4.1 General Guidelines

Every command in ne has a long and a short name. Except in a very few cases, the short name is given by two or three letters that are the initials of the words that form the long name. For instance, SearchBack has short name SB, SaveDefPrefs has the short name SDP, and AdjustView’s short name is AV. There are some exceptions however. The most frequently used commands such as Exit have one-letter short names (X). Also some commands use a different short name to avoid clashes with a more common command’s short name. For example, StatusBar’s short name is ST rather than SB to avoid clashes with SearchBack’s short name.

A command always has at most one argument. This is a chosen limitation that allows ne’s parsing of commands and macros to be very fast. Moreover, it nullifies nearly all problems related to delimiters, escape characters, and the like. The unique argument can be a number, a string, or a flag modifier. You can easily distinguish these three cases even without this manual by looking at what the Help command says about the given command. Note that when a command’s argument is enclosed in square brackets, it is optional.

Strings are general purpose arguments. Numbers are used to modify internal parameters, such as the size of a TAB. A flag modifier is an optional number that is interpreted as follows:

Thus, StatusBar 1 will activate that status bar, while I will toggle insert/overstrike. This design choice is due to the fact that most of the time during interactive editing you need to change a flag. For instance, you may be in insert mode and you want to overstrike, or vice versa. Absolute settings (those with a number) are useful essentially for macros. It is reasonable to use the fastest approach for the most frequent interactive event. When a number or a string is required and the argument is optional, most of the time you will be prompted to type the argument on the command line.

As for the input line, for numeric arguments you can choose between decimal, octal and hexadecimal notation in the standard way: a number starting with ‘0’ is considered in octal, a number starting with ‘0x’ is considered in hexadecimal, and in all other cases decimal base is assumed.

When a number represents how many times ne should repeat an action, it is always understood that the command will terminate when the conditions for applying it are no longer true. For instance, the Paragraph command accepts the number of paragraphs to format. But if not enough paragraphs exists in the text, only the available ones will be formatted.

This easily allows performing operations on an entire document by specifying preposterously huge numbers as arguments. ToUpper 200000000 will make all the words in the document upper case. (At least, one would hope so!) Note that this is much faster than recording a macro with the command ToUpper in it and playing it many times because in the former case the command has to be parsed just one time.

In any case, if a macro or a repeated operation takes too long, you can stop it using the interrupt key (Control-\).

To handle situations such as an argument string starting with a space, ne implements a simple mechanism whereby you can enclose any string argument in double quotes. If the first non-blank character after the command and last character of the command line are double quotes, the quotes will be removed and whatever is left will be used as the string argument. For example, the Find command to find a space could be entered on the command line or in a macro as Find " ". The only case needing special treatment is when a string starts and ends with double quotes. The command Find ""quote"" would locate the next occurrence of the string ‘"quote"’ (including the double quotes). However, Find onequote" wouldn’t require special treatment because the command argument doesn’t both start and end with a double quote.


Next: , Up: Commands   [Contents][Index]