From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mike Treseler Newsgroups: gmane.emacs.help Subject: Re: ^M characters Date: Wed, 22 Oct 2008 16:32:54 -0700 Message-ID: <48FFB826.6050300@gmail.com> References: <6f700367-8aa9-4112-bdbb-59ea98f809b5@f37g2000pri.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1224718858 17608 80.91.229.12 (22 Oct 2008 23:40:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Oct 2008 23:40:58 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 23 01:41:59 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KsnKu-00019g-LL for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Oct 2008 01:41:56 +0200 Original-Received: from localhost ([127.0.0.1]:47721 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KsnJo-0008KZ-Tv for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Oct 2008 19:40:48 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 36 Original-X-Trace: individual.net vWcLI5aKtCboUlXNR2Fh/gGPA8iX9QfveSonOLbkWwgqB70/tA Cancel-Lock: sha1:V+0u9TcMB79K+9emmA3SLN4dh+0= User-Agent: Thunderbird 1.5.0.14 (X11/20060911) In-Reply-To: <6f700367-8aa9-4112-bdbb-59ea98f809b5@f37g2000pri.googlegroups.com> Original-Xref: news.stanford.edu gnu.emacs.help:163712 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:59053 Archived-At: 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