s-news
[Top] [All Lists]

Re: Scanning a line for a carriage return

To: "J. S. Gangolly" <gangolly@csc.albany.edu>
Subject: Re: Scanning a line for a carriage return
From: Stuart Luppescu <s-luppescu@uchicago.edu>
Date: Fri, 09 Mar 2007 11:38:00 -0600
Cc: s-news@lists.biostat.wustl.edu
In-reply-to: <Pine.GSO.4.58.0703091205130.19655@cayley.ba.albany.edu>
References: <5B833E900330354F9FDA984D06F9242801559A8C@ca-exchange.corp.pharsight.com> <Pine.GSO.4.58.0703091006150.19494@cayley.ba.albany.edu> <1173454600.17614.4.camel@musuko.uchicago.edu> <Pine.GSO.4.58.0703091205130.19655@cayley.ba.albany.edu>
On 金, 2007-03-09 at 12:10 -0500, J. S. Gangolly wrote:
> Sure you can replace just about anything coded in ascii
> using replace-string in emacs. Unfortunately, many of these
> control characters are not encoded in ascii. That is why
> you don't see them in text editors. In emacs, SR-NL shows
> up as ^M for example. However, I don't think you can
> remove them, since ^M in ascii is semantically not the same
> as Meta-M or Ctrl-M in the encoding. 

Right. That's why you use the quote character to indicate an actual ^M.
As in my example:

M-x replace-string<ENTER>C-q C-m<ENTER><ENTER>

C-q (^Q) quotes the next character so it enters an actual ^M. If you
don't do that, emacs interprets the C-m (^M) the same as <ENTER>.
-- 
Stuart Luppescu -=-=- slu <AT> ccsr <DOT> uchicago <DOT> edu
CCSR at U of C ,.;-*^*-;.,  ccsr.uchicago.edu
     (^_^)/    才文と智奈美の父
Thank God I'm an atheist!

Attachment: smime.p7s
Description: S/MIME cryptographic signature

<Prev in Thread] Current Thread [Next in Thread>