Every command of ne
has a long and a short name. Except in a very few
cases, the short name is given by two or three letters which are the initials
of the words which form the long name. Thus, for instance, SearchBack
has short name SB
. However, most used commands such as Exit
have
one-letter short names (X
), and StatusBar
's short name is
ST
in order to avoid clashes with SearchBack
's.
A command has always at most an argument. This is a chosen limitation, which
allows ne
's parsing of commands and macros to be very fast (a hash table
with no conflicts decodes the command name). Moreover, it almost cancel all
problems related to delimitators, escape characters, et cetera. 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 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. Flag modifiers are an optional number which 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 one is faced with changing a
flag; for instance, one is in insert mode and wants to overstrike, or
viceversa. Absolute settings (i.e., with a number) are useful essentially
for macros. It is reasonable to keep 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 times the user will be prompted to typing
the argument on the command line.
When a number represent the times ne
should repeat an action, it is
always understood that the command will terminate anyway when the conditions
for applying it are not longer true. For instance, the Paragraph
commands
accepts the number of paragraphs to format. But if not enough paragraphs
exists in the text, only the available ones will be formatted.
This allows to easily perform operation on the whole text by specifying
preposterously huge numbers as arguments. ToUpper 2000000000
will
(hopefully) upper the case of all the words in the document. Note that
this is much faster than recording a macro with a command and playing
it many times, because 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
-\).
In order to handle situations such as an argument string starting with a
space, ne
implements the following simple mechanism: an argument
string can be included in quotes, provided that the closing quote is the
last character of the command line.
The main advantage of this approach is that no escape convention is
necessary when putting quotes inside a quoted string, since ne
can
use contextual information in order to tell the real delimitator. The only
case needing a special treatment is the case of an argument string starting
and ending with a quote: unless it is again enclosed in quotes, ne
will believe the quotes are delimitators, and act accordingly.