gets a non-complete
then the system decides which external format to use by calling the function
The default behaviour of
is as follows:
:default, this finds a match based on the filename; or (if that fails), looks in the Emacs-style (-*-) attribute line for an option called ENCODING or EXTERNAL-FORMAT; or (if that fails), chooses from amongst likely encodings by analysing the bytes near the start of the file, or (if that fails) uses a default encoding.
:eol-styleparameter, it then also analyses the start of the file for byte patterns indicating the end-of-line style, and uses a default end-of-line style if no such pattern is found.
The file in this example was written by a Windows program which writes the Byte Order Mark at the start of the file, indicating that it is Unicode (UCS-2) encoded. The routine in step 1 above detects this:
(with-open-file (ss "C:/temp/unicode-notepad.txt")
(:UNICODE :LITTLE-ENDIAN T :EOL-STYLE :CRLF)
The behaviour of
is configurable via the variables
. See the
LispWorks Reference Manual