The settings that are relevant for writing out a file are in two
categories. The first governs the conventions used to write out the
file, and the second governs the way a previous file of the same name is
dealt with in terms of backups. Finally there is a view-only setting
which doesn't allow the writing of a file at all. The various settings
are explained below.
The current write mode is indicated by a letter A,U,R or P in the
second position of the status characters in the status bar:
- A - MS-DOS and Atari mode.
- This mode can be selected with Alt-A.
In this mode each
line of output is terminated by both a carriage return and a
linefeed. This is the most widely used convention and also the
convention officially used by MS-DOS/Windows and Atari.
- U - Unix mode.
- This mode can be selected with Alt-U.
In this mode each line is
terminated by only a linefeed. This shortens the length of the file
by one character per line which can be useful. All Unix systems use
this convention and most C programs love it. If you have a system
that is used to the A-mode many programs might make a mess of your
file though.
- R - Raw mode.
- This mode can be selected with Alt-R.
In this case the lines are
written without any linefeed or carriage return termination
characters at all. Hence the lines will be run together and
unrecognizable thereafter as separate lines. When reading in a file
in this mode, the linefeeds and carriage returns are not interpreted
but simply treated as other characters. Hence this mode can be used
for reading in a binary file for limited editing and the file can be
saved without the introduction of any extraneous characters (see
also the chapter on hex code p.
). Since
writing in this mode could cause loss of information which may be
time-consuming to recover, whenever an attempt is made to write in
this mode, stedi asks for confirmation before proceeding.
- P - Printer mode.
- This mode can be selected with Alt-P.
Not
only is each line terminated by both a carriage return and a
linefeed, but the tabs are also expanded into the appropriate number
of blank spaces. This is useful for sending a file with special tab
settings to a printer on a different system. Its most frequent use
is however to avoid problems with compilers that don't like tabs.
Note however that expanding the tabs can make a file substantially
longer.
The writing mode is one of the variables that is kept in the default
file. It is also one of the variables that can be set for each buffer
independently.