auto - Automatic source file line type detection
A - mode line letter.
When this mode is enabled the line style of the source file, with respect to CR/LF/CTRL-Z characters, are automatically detected and the file (if saved) is written out in the same style as it was read in. This mode is designed to solve the problems of MS-DOS which utilize a '\r\n' with every new line and a ctrl-Z as a file terminator, conversely UNIX utilizes only '\n' as a line terminator.
auto mode therefore allows files to be edited across file system types without corrupting the line style of the native platform.
At load time, if auto detects CR/LF style line feeds then it enables the buffer mode crlf(2m), and if a CTRL-Z is found at the end of the file then mode ctrlz(2m) is enabled. Otherwise these modes are cleared.
At write time, if auto mode is enabled then the file is written out is a style determined by modes crlf and ctrlz. For example, if crlf was enabled and ctrlz disabled then the file would be written out with new lines as '\r\n' and with no ending ctrl-z.
If auto is not enabled then the file is written out in the style of the current platform, regardless of the current settings on modes crlf and ctrlz.
The operation on the modes may be summarized as follows:-
This mode MUST be enabled globally when the file is loaded for the file style to be correctly detected.
It is strongly advised that auto mode is permanently enabled.
Windows systems tend to use a '\r\n' style line feed but with no trailing ctrl-z.
Copyright (c) 1998-2006 JASSPA
Last Modified: 2004/01/05
Generated On: 2006/10/07