From owner-freebsd-questions@FreeBSD.ORG Mon Oct 30 08:25:24 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 10AFC16A40F for ; Mon, 30 Oct 2006 08:25:24 +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 243F143D45 for ; Mon, 30 Oct 2006 08:25:22 +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 k9U8P2U5029415 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 30 Oct 2006 10:25:09 +0200 Received: from gothmog.pc (gothmog [127.0.0.1]) by gothmog.pc (8.13.8/8.13.8) with ESMTP id k9U8Paj9016221; Mon, 30 Oct 2006 10:25:37 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.pc (8.13.8/8.13.8/Submit) id k9U8PaZW016220; Mon, 30 Oct 2006 10:25:36 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Mon, 30 Oct 2006 10:25:36 +0200 From: Giorgos Keramidas To: Tsampros Leonidas Message-ID: <20061030082536.GA16208@gothmog.pc> References: <45425D61.6030209@enabled.com> <20061027213034.GD98266@gizmo.acns.msu.edu> <20061028011857.GA31746@biftekaki.lan> <20061030080357.GA15874@gothmog.pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061030080357.GA15874@gothmog.pc> 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:25:24 -0000 On 2006-10-30 10:03, Giorgos Keramidas wrote: > 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. Oops... Apparently, I have `inhibit-eol-conversion' modified locally. This is what makes Emacs avoid EOL conversion when `set-buffer-file-coding-system' is called. Sorry for the confusion.