[OS X Emacs] opening old mac files (CR end of line char)
Bill Rising
brising at mac.com
Wed Dec 5 11:20:52 EST 2007
On Dec 5, 2007, at 9:29 , xah lee wrote:
>> Are you sure that the files don't have a mixture of EOL characters?
>> I see this from time to time with files that start with something
>> other than a Mac EOL, but then have Mac EOLs later.
>
> yeah... it's pure mac file. (open a unix file, change all LF to CR,
> then reopen it)
Here are the two cases I see:
When the ^M's show up:
1. Make a text file with the default unix eols.
2. Change eols using M-x replace-string
C-q C-j RET C-q C-m RET.
3. Save the file.
4. Open the file.
Result: Instead of the file being opened as a Mac file, it is opened
with encoding nil and shows ^Ms.
When the Mac eols are recognized:
1. as above
2. Change buffer encoding via C-x RET f Mac RET
3. Save the file.
4. Open the file.
Result: everything displays just fine, even though the eols are ^M
instead of ^J
So... it looks like something tied to the default encoding more than
the ability to use ^Ms.
I have no trouble opening Mac files that were made by Mac applications
with Mac EOLs. I see the problem only if I do the substitutions in the
first case above or if I have files with mixed EOLs.
I cannot say if this existed in earlier versions of Emacs (any
variety), because I always have changed the encoding using the easy-to-
remember (hah!) key-binding C-x RET f
Bill
More information about the MacOSX-Emacs
mailing list