One can run stedi from a command processor by typing its name followed by a number of file names. Stedi can read up to eight files during startup. There is also the possibility to tell stedi where to find its default file, its help file and the user defined macro's. If the first parameter given to stedi is -d (or -D), then the next parameter is interpreted as the name of a directory. Stedi will make this directory its default directory and look there for its default file, its help file and macro's when the user wants to execute them. Hence the command
~\bin\stedi -d ~\bin foo.c bar.cwill start a copy of stedi which is found in the directory
~\bin
, and the -d parameter along with the following path name
informs stedi that it can also find its default file, its help file
and the macro's there. Finally the command instructs stedi to read
the files foo.c
and bar.c
for editing. The file
foo.c
will be put in buffer 1 and the file bar.c
will be
put in buffer 2. In most shells this can be done simply by defining the
alias
alias e "~\bin\stedi -d ~\bin"After this, one may call stedi via the command
e foo.c bar.cThis command accomplishes exactly the same task as the command above that was fully written out. On MS-DOS one would include the directory
~\bin\
in the path variable in the file autoexec.bat, after
which one would accomplish the above with:
stedi -d ~\bin foo.c bar.cUNIX-like systems would have a similar statement in a `login' or `resource' file. The above is still not very handy. Therefore stedi will also recognize several variables in the environment. They are:
set STEDIDFT=C:\BIN\ set STEDIHLP=C:\BIN\ set STEDIMAC=C:\BIN\For UNIX-like systems or shells one specifies such variables usually in a login script or a resource script (.cshrc for the c-shell). One should use the setenv command for this.
The complete set of command line options is:
All above parameters can be given either in upper case or in lower case. The r, v and line number options can be combined. Each option must still be preceded by its own minus sign, but several of such parameters may be given before the actual file name is given. Example:
stedi -d ~/bin foo.c -v -800 bar.c -i actionThis command starts stedi, stedi will look in /bin for its default file, put the file foo.c in buffer 1, the file bar.c is put in buffer 2 and buffer 2 is put in the `view only' mode while the cursor is put at line 800. The file action.mac is looked for and if found it is executed as a regular macro.
It is allowed to use so called wildcard characters in the names of the files that should be read by stedi. The full pattern is given to the local file system and each successive match is read into a separate buffer until either there are no more matches, or all 8 buffers have been filled. If there were options specified they apply to all files that are read in with this pattern. If a pattern is used for the name of a macro it will not be interpreted and the results can be unpredictable. The order in which the files match the pattern depends on the file system. Some systems give a purely lexicographic order, while MS-DOS and GEMDOS like to use the order in which the files appear in the directory on the disk which is at first the order in which they were written to disk, but after the directory has been used intensively the order can be quasi random.
When using the environment to define default directories there is no need to have the three variables to point at the same directory. If both the environment has been set and the -d option is used, the -d option takes precedence (most likely it has been typed by hand so it should override the defaults). In all cases stedi will first look in the current directory for any of the files it needs, whatever the default settings. The rationale behind this is that a local file is usually project bound and should be preferred. This can avoid very nasty surprises.
Finally something more about the environment. When variables are used
(for instance in macro's) and the user specifies a variable that was
neither defined before, nor a predefined variable stedi will search
the environment for this variable. This search is done case insensitive.
If the variable is found in the environment its contents are returned.
If the variable doesn't occur in the environment the message variable is
undefined is given. See also the chapter on macro's p. .