From owner-freebsd-questions@FreeBSD.ORG Mon Oct 30 08:03:58 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A9E9116A47E for ; Mon, 30 Oct 2006 08:03:58 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23D8E43D5A for ; Mon, 30 Oct 2006 08:03:56 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.pc (host5.bedc.ondsl.gr [62.103.39.229]) (authenticated bits=128) by igloo.linux.gr (8.13.8/8.13.8/Debian-2) with ESMTP id k9U83Pa4028756 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 30 Oct 2006 10:03:31 +0200 Received: from gothmog.pc (gothmog [127.0.0.1]) by gothmog.pc (8.13.8/8.13.8) with ESMTP id k9U83xuH016020; Mon, 30 Oct 2006 10:03:59 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.pc (8.13.8/8.13.8/Submit) id k9U83waf016019; Mon, 30 Oct 2006 10:03:58 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Mon, 30 Oct 2006 10:03:57 +0200 From: Giorgos Keramidas To: Tsampros Leonidas Message-ID: <20061030080357.GA15874@gothmog.pc> References: <45425D61.6030209@enabled.com> <20061027213034.GD98266@gizmo.acns.msu.edu> <20061028011857.GA31746@biftekaki.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061028011857.GA31746@biftekaki.lan> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (score=-2.544, required 5, AWL -0.15, BAYES_00 -2.60, DNS_FROM_RFC_ABUSE 0.20, UNPARSEABLE_RELAY 0.00) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: Jerry McAllister , Noah , freebsd-questions@freebsd.org Subject: Re: replacing ^M with emacs X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Oct 2006 08:03:58 -0000 On 2006-10-28 04:18, Tsampros Leonidas 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.