[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ^M characters
From: |
Mike Treseler |
Subject: |
Re: ^M characters |
Date: |
Wed, 22 Oct 2008 16:32:54 -0700 |
User-agent: |
Thunderbird 1.5.0.14 (X11/20060911) |
Xah wrote:
> When you paste some code involving different EOL char, most editor
> deal with this by simply converting them to your current EOL. Usually
> they have a preference setting to indicate whether you want this to
> happen automatically or literal. I think emacs should also adapt this
> behavior.
When I run across such a text file,
I use hex-mode to see what is going on.
In every case I have seen, the problem
is due to a malformed end-of-line pattern.
Emacs recognizes and hides standard end-of-line patterns
if they are use consistently.
MAC-like (CR)
DOS-like (CR+LF)
Unix-like (LF)
Corey's file probably has the end-of-line pattern
CR+CR+LF where the first CR is printed ^M
while the CR+LF is interpreted as a DOS end-of-line and hidden.
In this case I would do
(buffer-to-unix)
to fix up the end-of-lines
and then a query-replace of the ^M characters to nothing.
-- Mike Treseler
Corey, see also:
http://www.rfc-editor.org/EOLstory.txt
http://en.wikipedia.org/wiki/Newline