This is because Mac and unix (even the unix part of OS X) use
different end of line conventions. (and Windows uses yet another
convention)

Here are a couple of ways to fix files that have the ^M in them
(after they've been pasted into emacs and saved use one of the
scripts, then re-open in emacs).

Save this in a file, make it executable, put it in your PATH
#! /bin/csh -f
echo Lines before: `wc -l $1`
setenv tmpfl tmp`echo $$`
# echo temp file name $tmpfl
mv $1 $tmpfl
tr '\015' '\n' < $tmpfl > $1
echo Lines after `wc -l $1`
## should test for successful return from tr before removing temp file
rm $tmpfl
echo Done


   alias mac2unix "perl -pi -e 'tr/\015/\012/' \!*"
And then you can use it directly from the command line:
    % mac2unix MacTextFile.txt ...

-Don

At 6:02 PM +0200 10/14/02, S�bastien Maret wrote:
>Does XDarwin support cut and paste from native MacOSX applications ?
>I manage to cut  some text  from Internet Explorer to Emacs but it
>does seems to work all the time. When it works, seems there's a
>problem of carriage return. Line breaks appears as ^M in my Emacs?
>Sebastien
>--
>S�bastien Maret
>Centre d'Etude Spatial des Rayonnements
>9 Av. Colonel Roche
>BP 4346
>31028 Toulouse cedex 04
>France
>Tel: (33) 5 61 55 81 89
>[EMAIL PROTECTED]
>
>
>
>-------------------------------------------------------
>This sf.net email is sponsored by:ThinkGeek
>Welcome to geek heaven.
>http://thinkgeek.com/sf
>_______________________________________________
>Fink-users mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/fink-users


--
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA
--------------------------------------


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Fink-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to