>>>> "Uwe" == Uwe Brauer <oub(a)mat.ucm.es>
writes:
Uwe> My question is then, what is this feature good for,
Uwe> especially if mule is off?
It's called the "file coding" feature because it is a minimal
abstraction of Mule coding systems. Ie, it looks at the stream of
bytes as they go into the buffer, and does _nothing_.
In fact, it doesn't do absolutely nothing. It checks for occurances
of the characters or pairs CR, CRLF, and LF, and if one of them
predominates (I think the criterion is all of the linebreaks in the
first 3000 characters use that convention), then the file is judged to
be a Mac, DOS/Windows, or Unix text file, respectively. There are
also checks for things like excessively long lines and too many
non-whitespace control characters, which will automatically kick the
file into "binary" mode.
If the file appears to use the Mac convention, then CR->LF conversion
is done on input and LF->CR on output. If the file appears to use the
Windows convention, then the conversions are CRLF<->LF. If the file
appears to be from Unix, then no conversion is done, and the buffer
representation is the same as the external file.
Uwe> And what sort of harm can be done with the feature enabled?
If the file contains the other sort of control characters, then data
corruption can occur. Eg, if this file is detected as Windows
This is a single line<LF>containing a control character.<CRLF>
it will be represented in the buffer as
This is a single line<LF>containing a control character.<LF>
and converted to
This is a single line<CRLF>containing a control character.<CRLF>
on output. Unlike Mule, this kind of error is extremely rare because
of the stringent requirement that only one of the various conventions
occur in the first 3000 characters.
Also, if you exchange files with someone who uses a different kind of
system, you can get confused because XEmacs will always present you
with something that looks like ordinary text, but your correspondent
may use an editor that can't handle it. Some people prefer to edit
DOS files with a "^M" indicator at the end of every line.
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.