Philip Aston wrote:
> > Is it possible to set buffer-file-coding-system-for-read
to a coding
> > system such that:
> >
> > 1. Loading a file, modifying it, and saving it does not change its EOL
> > type.
> >
> > 2. Line breaks are auto-detected (and displayed without control
> > charatcers etc).
> >
> > ?
> >
> >
> > I find that 'no-coding satisfies 1 but I have to live with ^M's, and
> > that every other coding system I try uses a particular, fixed, eol
> > type for write. I expected 'undecided to be the answer, but this
> > strips CR's from CRLF encoded files on write.
>
> As the name implies, buffer-file-coding-system-for-read only applies
> to reading the file. buffer-file-coding-system determines the EOL
> convention used when writing the file.
So.. urmm.. same question but
s/buffer-file-coding-system-for-read/buffer-file-coding-system/g ?
Namely, what do I set (or rather set-default) it to such that eol type
is preserved?
Almost anything that doesn't have a suffix of -unix, -dos or -mac
(except "binary"). The exact choice depends upon how you want
non-ASCII characters to be handled by a MULE-enabled version of
XEmacs.
Basically, every coding system has four variants. E.g. for ISO-8859-1,
you have: iso-8859-1, iso-8859-1-unix, iso-8859-1-dos and
iso-8859-1-mac. The "basic" version autodetects the EOL convention,
while the others assume a specific convention (LF, CRLF, and CR
respectively).
If you wish to autodect the base coding system, as well as the EOL
convention, use "undecided".
--
Glynn Clements <glynn.clements(a)virgin.net>