If he says (DOS) about modeling when opening a file on Unix, the line ending is a Windows style. If it says (Unix) when you open the file on Windows, the line ending is a Unix style.
In the Emacs 22.2 manual (Node: Mode line):
If the spooled file uses carriage return with return, the colon changes either the backslash ('\') or '(DOS)', depending on the system. If the file uses only carriage return, the colon pointer changes to either a slash ('/') or '(Mac)'. On some systems, Emacs displays "(Unix)" instead of a colon for files that use the new line as a line separator.
Here is a function that - I think ndash; shows how to check from elisp what Emacs defines as a type of line endings. If it looks overly complex, perhaps it is.
(defun describe-eol () (interactive) (let ((eol-type (coding-system-eol-type buffer-file-coding-system))) (when (vectorp eol-type) (setq eol-type (coding-system-eol-type (aref eol-type 0)))) (message "Line endings are of type: %s" (case eol-type (0 "Unix") (1 "DOS") (2 "Mac") (t "Unknown")))))
source share