The editor contains a number of internal variables such as the screen color, the backup mode, the write mode, the search mode, tab settings, and so forth, as well as possibly such things as contents of learn buffers, macro's and keyboard redefinitions. In order to save all these settings for future use, stedi allows them to be written away to a file which can be read in at some later time. The file, called stedi.dft is also read automatically at startup if stedi can find it.
Actually the situation with the default settings is not quite so simple as explained above because of STEDI's ten text buffers. Certain settings are global, that is, they affect all buffers (for example, the color, learn buffers, and key redefinitions), but others can be set individually for each of the ten buffers. For example, the backup mode can be set differently for each file in one of the ten text buffers. These latter settings will be called local.
Stedi maintains a central defaults buffer which is filled at startup with the contents of stedi.dft or set by built in defaults if this file is not available. All global and local settings are kept in this buffer. Then each time a text buffer is opened, a copy of the local settings which are in the central buffer is copied to the text buffer to begin the editing in that buffer. After this, the user is free to change the settings as desired and the settings for each individual buffer will be remembered until the buffer is cleared, or until the end of the editing session. If a buffer is cleared, the settings will revert back to those in the central buffer.
Naturally for greatest flexibility, stedi requires a number of commands for input and output of these settings and for moving them around from one buffer to another if desired. These commands are the subject of this chapter. Below, the commands will be explained in a logical order, building up from the more basic operations. However it should be realized that the first commands mentioned are not necessarily the most used. In fact, one may get by, using only one or two of the commands explained in this chapter. However they are all included for completeness. All these commands are issued from the command line.
The first commands are for reading and writing from a file to the central buffer and vice versa. These commands are:
In order to copy the defaults which are stored in the central buffer into the default settings of one of the ten text buffers, the following commands are available.
Of course if only the above commands were available, loading the settings of local variables into individual buffers could become quite laborious. Much more often one wants a combination of two of the above commands. Single commands accomplishing this are therefore available. These commands are:
It is useful to be able to specify a default directory or folder (other than than the current one which is searched automatically) from which stedi can read the default file stedi.dft. The DD (Default Directory) command serves this purpose. The default directory is also used for writing out the defaults. The associated commands are:
When the DD command is given without an argument, the name of the currently set default directory is reported on the message bar.
All commands mentioned so far in this chapter are case insensitive. Thus for the DW command, you may equally well type dw, dW or Dw.
During startup, you may pass a parameter to stedi to specify a default directory or a default file for reading the startup defaults. This is done by giving as a first parameter the characters -d or -D followed by one or more blanks and then a name. The name is interpreted as a path name and this will be the default directory. At the same time this directory will be searched when the help file is needed, or when a macro should be loaded from disk. After this come the file names to be edited separated by one or more blanks. For example suppose the startup defaults are in a directory called `BIN' on disk D and the file BIG.BUG in the current directory is desired to be edited. Then if starting from a shell, you would issue the command
stedi -d d:\bin big.bugThe other way to specify the default directory during startup (and also the preferred one) is by setting the environment variable STEDIDFT. If this variable can be located during startup its contents are interpreted as the name of the default directory. A trailing directory separator isn't needed.
The order in which directories are searched for the default file is different at startup than during the DW command. At startup (p. ) first the current directory is searched, independent of a -d parameter or an environment parameter. If this isn't successful the path given by the -d option is tried. If the -d option hasn't been used the environment is tried.
Finally we close this chapter with a list of those settings which are stored in the default file.
The global variables which affect all text buffers are: