emacs supports files with Unix, Dos and Mac-OS line terminators. It does not support files with have a mixture of them. Unfortunately, there are tools, such as the Sun java compilers, that accept source files in which each line can be terminated by one
of the Unix, Dos or Mac-OS line terminators. The result is that emacs and such tools number lines differently, and a programmer, when trying to locate a line on which the compiler reported an error is at a loss.
E.g. take the attached file: it has been created with Emacs in Windows typing the text and adding with ctrl-q ctrl-m a carriage-return character at the end of the first line. When that file is opened with emacs, three lines are shown (i.e. that carriage-return
does not make an empty line). When the java compiler is run, this is the result:
D:\jtest>javac Errjava.java Errjava.java:3: <identifier> expected public main ... ^ 1 error
Note that the compiler is telling that there is an error on line 3, but for emacs that line is line 2.
P.S. there are other editors, such as PsPad which instead display the file with the same line numbering as the java compiler uses.
My request is to add a further choice of line terminators besises Unix, Dos and Mac-OS that considers lines terminated by any one of cr-lf, cr or lf (in this order).