Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Oct 2006 21:01:30 -0400
From:      Jerry McAllister <jerrymc@msu.edu>
To:        Noah <admin2@enabled.com>
Cc:        "Peter A. Giessel" <pgiessel@mac.com>, freebsd-questions@freebsd.org
Subject:   Re: replacing ^M with emacs
Message-ID:  <20061029010130.GA5166@gizmo.acns.msu.edu>
In-Reply-To: <4542C704.70309@enabled.com>
References:  <45425D61.6030209@enabled.com> <4542607E.8020101@mac.com> <45429451.3040706@enabled.com> <45429608.9090704@mac.com> <4542969E.1060903@enabled.com> <20061028003929.GA99333@gizmo.acns.msu.edu> <4542C704.70309@enabled.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Oct 27, 2006 at 07:57:08PM -0700, Noah wrote:

> well I am pressing control-J for return not control-M so I dont 
> understand your rationale.

I don't understand your comment.   There was no rationale.  That is
just what the ASCII characters are used for and a little of the history
of how they got that way - though the choice of numeric code was mostly
arbitrary, some of it had to do with easy processing of codes as control
for printers and teletypes.   

If you use the characters in a non-traditional way, that is up to
you, but other systems and utilities won't follow your pattern most
likely.   

Now, in UNIX, since it doesn't end lines with a pair of ^M^J but only
uses ^J, it may look like it is a RETURN, but the original designation
is Line Feed.  UNIX just picked that one.

////jerry

> 
> 
> Jerry McAllister wrote:
> >>Thanks Peter,
> >>
> >>where is the logic here?  What is control-q for and what is control-j 
> >>for?  I am trying to figure out how I could have figured that out.
> >>    
> >
> >They are ASCII characters.   For example, the ^M you wanted to get
> >rid of is CTRL-M.    There are ASCII tables in various places.
> >A quick search should turn up a few.   The assignment of the 
> >characters are ancient and traditional and somewhat weird by
> >how things are currently used, but will probably continue to stay
> >that way.
> >
> >Line-Feed, for example - which is that character that marks the end
> >of a line in text files, means it causes the printer to move the 
> >paper up one line - in old line printers and teletypes.  CTRL-M or ^M
> >is a RETURN (also ENTER nowdays) and that caused the print head to
> >return to the beginning of the line.  By the time UNIX came along,
> >it wasn't necessary to use both characters to move the paper and print
> >head because those were virtual.  So, they just used one character - 
> >the line feed.   But, MS-DOS and some others continued to use the
> >pair to mean a new line for some reason - maybe the original association
> >with IBM, although they didn't use ASCII, but EBCDIC - another animal.
> >
> >So, look up an ASCII chart with explanations and you can make an
> >educated guess on the meanings.
> >
> >////jerry
> >
> >  
> >>also is there a better page than the one I am using below to figure all 
> >>these keystrokes out?
> >>
> >>http://www.math.uh.edu/~bgb/emacs_keys.html
> >>
> >>Cheers,
> >>
> >>Noah
> >>
> >>
> >>Peter A. Giessel wrote:
> >>    
> >>>On 2006/10/27 15:20, Noah seems to have typed:
> >>> 
> >>>      
> >>>>this is the best answer.  Hits it right on the head of what I want.  
> >>>>What if I want the character to replace the ^M with a new line what do 
> >>>>I enter in the replace field?
> >>>>   
> >>>>        
> >>>control-q control-j
> >>> 
> >>>      
> >>_______________________________________________
> >>freebsd-questions@freebsd.org mailing list
> >>http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> >>To unsubscribe, send any mail to 
> >>"freebsd-questions-unsubscribe@freebsd.org"
> >>    



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061029010130.GA5166>