Emacs on MS-DOS and on MS-Windows recognizes certain file names as text files or binary files. By "binary file" we mean a file of literal byte values that are not necessary meant to be characters. Emacs does no end-of-line conversion and no character code conversion for a binary file. Meanwhile, when you create a new file which is marked by its name as a "text file", Emacs uses DOS end-of-line conversion.
buffer-file-coding-system
, this variable is
used to determine which coding system to use when writing the contents
of the buffer. It should be nil
for text, t
for binary.
If it is t
, the coding system is no-conversion
.
Otherwise, undecided-dos
is used.
Normally this variable is set by visiting a file; it is set to
nil
if the file was visited without any actual conversion.
nil
for text, t
for binary, or a function to call to
compute which. If it is a function, then it is called with a single
argument (the file name) and should return t
or nil
.
Emacs when running on MS-DOS or MS-Windows checks this alist to decide
which coding system to use when reading a file. For a text file,
undecided-dos
is used. For a binary file, no-conversion
is used.
If no element in this alist matches a given file name, then
default-buffer-file-type
says how to treat the file.
file-name-buffer-file-type-alist
says nothing about the type.
If this variable is non-nil
, then these files are treated as
binary: the coding system no-conversion
is used. Otherwise,
nothing special is done for them--the coding system is deduced solely
from the file contents, in the usual Emacs fashion.
Go to the first, previous, next, last section, table of contents.