all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mike Treseler <mtreseler@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: ^M characters
Date: Wed, 22 Oct 2008 16:32:54 -0700	[thread overview]
Message-ID: <48FFB826.6050300@gmail.com> (raw)
In-Reply-To: <6f700367-8aa9-4112-bdbb-59ea98f809b5@f37g2000pri.googlegroups.com>

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


  reply	other threads:[~2008-10-22 23:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1834.1224707393.25473.help-gnu-emacs@gnu.org>
2008-10-22 21:25 ` ^M characters Xah
2008-10-22 23:32   ` Mike Treseler [this message]
2008-10-22 23:34     ` ^M characters - typo Mike Treseler
2008-10-23 19:55     ` ^M characters Mike Treseler
2008-10-23  9:49 roodwriter
  -- strict thread matches above, loose matches on Subject: below --
2008-10-22 20:29 Corey Foote
2008-10-22 20:43 ` Parker, Matthew

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48FFB826.6050300@gmail.com \
    --to=mtreseler@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.