Subject: RE: More ctrl-M stuff

From: "George V. Reilly" <[email-masked]>
Date: Tue, 27 Aug 96 16:45:00 PDT

The solution that Vim uses, which works well in practice,
is to have two variables, textauto (global) and textmode
(buffer-local).  If textmode is set, a file is written with
DOS-style (CR-LF line separators); if it's off, the file is
written with Unix-style (LF line separators).  By default,
textmode is set on all new buffers for DOS-like systems
(DOS, OS/2, Win32) and cleared on all other systems.  If
textauto is set, then textmode is set for a buffer when
a file is read in which has every line separated by CR-LFs
and cleared otherwise.  In either case, the file looks fine
on screen.

If you edit and write a file, the line separator settings will
remain the same unless you explicitly override them.  This is
something I find very annoying with NT Emacs---especially
when diffing a modified file against an original file which
came from Unix and having diff report the whole file has
changed.  If the file has non-standard separator settings for
the OS (e.g., LFs on NT), you'll see a note about it in the
message line.
 --
/George V. Reilly   <[email-masked]>   <[email-masked]>
MicroCrafts, Inc., 17371 NE 67th Ct #205, Redmond, WA 98052, USA.
Tel: +1 206/250-0014  Fax: 206/250-0100  Web: www.microcrafts.com
Vim 4 (vi clone) for NT & Windows 95: http://www.halcyon.com/gvr/
pgp fingerprint: e2 b4 83 64 11 52 21 ea  bf d8 51 c2 11 00 78 fc