[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ^M's in source files

> This seems not to be the fault of any editor - just different end-of-line
> conventions by unix and DOS.  (In fact, I've used my editor to FIX that
> problem.)
>   I fix this by putting the line 
>       (set-syntax-from-char (code-char 13) #\Space)	
>   in the appropriate source file so that the UNIX machine does not get
>   confused by the ^M's.
> It turns out this is not a very good solution.  In particular, if your
> source file contains any ; comments, the rest of the file then looks
> like a comment (since it all appears to be part of the same line).
> (I thought those files compiled mighty fast!)

A better solution, if your Unix system has it, is the dos2unix command 
which automatically strips the ^Ms.  The syntax is:

dos2unix <source> <target>