Next: Multiple Windows, Buffers, and
Up: Formatting Your Text
Previous: Changing Case
Contents
If you frequently deal with text
files created by Windows users, you will no doubt encounter the
frustrating M character littered throughout the text.
Remember that Unix, Windows, and Macs prior to OS X all deal with the end of
lines differently. Windows marks the end of a line with two
characters - an end of line ( n) and a carriage return
( r). Unix just uses the end of line ( n),
and Macintosh just uses the carriage return ( r). When
you open a text file originally created in Windows, the M
characters represent left-over carriage returns emacs didn't know what
to do with.
There is an easy way to get rid of them by just searching and
replacing. Navigate to one of them, select it the way you would any
other character or expression, and copy it using M-w. Then Hit M-%
to begin a search and replace session. When emacs asks what to
replace, hit C-y (yank). When emacs asks with what to replace the
character, just hit return. Emacs will then remove all those
M characters. You can also type C-q (``enter a
literal'') followed by C-m to enter the end-of-line character
directly, when asked.
Next: Multiple Windows, Buffers, and
Up: Formatting Your Text
Previous: Changing Case
Contents
Randall Wood
2011-03-31