Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Oct 2006 10:03:57 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Tsampros Leonidas <ltsampros@upnet.gr>
Cc:        Jerry McAllister <jerrymc@msu.edu>, Noah <admin2@enabled.com>, freebsd-questions@freebsd.org
Subject:   Re: replacing ^M with emacs
Message-ID:  <20061030080357.GA15874@gothmog.pc>
In-Reply-To: <20061028011857.GA31746@biftekaki.lan>
References:  <45425D61.6030209@enabled.com> <20061027213034.GD98266@gizmo.acns.msu.edu> <20061028011857.GA31746@biftekaki.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2006-10-28 04:18, Tsampros Leonidas <ltsampros@upnet.gr> wrote:
> I think there is something similar in emacs by using the
> set-buffer-file-coding-system (binded at C-x RET f in default
> configurations).
> 
> So to "cure" and succesfully "convert" DOS files into unix format, i
> use C-x RET f unix RET.

I'm not sure `set-buffer-file-coding-system' will have any effect on an
already opened file though.  I just tried this with a file which was
created outside Emacs, and contained:

    $ cat -vte foo 
    fooo^M$
    $

Opening this file with `C-x C-f foo RET' and setting the buffer file
coding system with `C-x RET f unix RET', marks the buffer as modified,
but saving the file does not modify the contents of the file to use UNIX
newlines only.

If you really want to use Emacs for the conversion, you have to
*explicitly* replace ^M characters, either with `M-x replace-string RET
C-q C-m RET RET' or some either way.




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