From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.help Subject: Re: Changing file end-of-line style Date: Mon, 05 Nov 2012 19:28:13 +0530 Message-ID: <87pq3sgnii.fsf@gmail.com> References: <20121105115709.GB10005@kuru.dyndns-at-home.com> <87sj8o5h9s.fsf@gmail.com> <20121105132410.GG10005@kuru.dyndns-at-home.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1352123792 20230 80.91.229.3 (5 Nov 2012 13:56:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 Nov 2012 13:56:32 +0000 (UTC) Cc: Emacs help To: Suvayu Ali Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 05 14:56:41 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TVNAO-00063W-Ud for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Nov 2012 14:56:41 +0100 Original-Received: from localhost ([::1]:49508 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVNAG-0005h1-4p for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Nov 2012 08:56:32 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVNA2-0005ge-2Y for help-gnu-emacs@gnu.org; Mon, 05 Nov 2012 08:56:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TVN9w-0003eH-9N for help-gnu-emacs@gnu.org; Mon, 05 Nov 2012 08:56:17 -0500 Original-Received: from mail-pb0-f41.google.com ([209.85.160.41]:53946) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVN9w-0003dt-3N for help-gnu-emacs@gnu.org; Mon, 05 Nov 2012 08:56:12 -0500 Original-Received: by mail-pb0-f41.google.com with SMTP id rq2so4174725pbb.0 for ; Mon, 05 Nov 2012 05:56:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=waMhxV1nnIOqSZ85nmY9WgHvcg9N9yjER72tOREiEiQ=; b=wRLL47bktlyjPvJEhjqM+kPyFZajZOLwduvw+RfZHXe+8TGan8s3QlR/Jcz/yMs/Rh 6nIsf3jm/2Nf8c/0dhH0w+swhKNrgoLcrvxRZcpoWApAVErLExNdZRgw+YYdD9NFT35G loOO3tAM9kmZikE7o07+zqjVXvT4LObqDa8vQ4Ci0Ru4p3RPqtBn4pxZycG8ldImehRx PWRaryajdLBVfBPZGuAMT39nO00IoU50XZ82x2m6LjUu4nnSVBlrQpglg4cF85Fq0SDo veHUrSyHZG6Vt6jCrK6EVrlEm9XrBxRZqW3/5Vbx/PdYl+e4isFVM15BFsmPRZWPnQ4B 0QWQ== Original-Received: by 10.68.219.5 with SMTP id pk5mr30790343pbc.124.1352123771249; Mon, 05 Nov 2012 05:56:11 -0800 (PST) Original-Received: from debian-6.05 ([101.63.245.153]) by mx.google.com with ESMTPS id t7sm2941862pax.14.2012.11.05.05.56.08 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Nov 2012 05:56:10 -0800 (PST) In-Reply-To: <20121105132410.GG10005@kuru.dyndns-at-home.com> (Suvayu Ali's message of "Mon, 5 Nov 2012 14:24:10 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.160.41 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:87536 Archived-At: Suvayu Ali writes: > Hi Jambunathan, > > On Mon, Nov 05, 2012 at 06:38:31PM +0530, Jambunathan K wrote: >> Suvayu Ali writes: >> >> > Hi, >> > >> > I sometimes have to deal with files created on Windows or Mac OSX. When >> > using emacs with X windows, I can click on the `(Mac)' or `(MS-DOS)' >> > marker on the bottom left corner of the frame to switch to whichever >> > style I want at the moment. >> > >> > How do I do this when running emacs as `emacs -nw'? I tried looking for >> > end-of-line with apropos, but could not find anything that seemed >> > relevant. Any ideas? >> >> From (info "(emacs) Text and Binary") >> >> ,---- >> | To visit a file and specify whether it uses DOS-style or Unix-style >> | end-of-line, specify a coding system (*note Text Coding::). For >> | example, `C-x c unix C-x C-f foobar.txt' visits the file >> | `foobar.txt' without converting the EOLs; if some line ends with a >> | carriage-return linefeed pair, Emacs will display `^M' at the end of >> | that line. Similarly, you can direct Emacs to save a buffer in a >> | specified EOL format with the `C-x f' command. For example, to >> | save a buffer with Unix EOL format, type `C-x f unix C-x >> | C-s'. If you visit a file with DOS EOL conversion, then save it with >> | Unix EOL format, that effectively converts the file to Unix EOL style, >> | like `dos2unix'. >> `---- >> > > This works great! I have a question though. I was aware of the > set-buffer-file-coding-system command; when I tried it I was prompted > with utf-8[1] which did not seem to do anything. What confuses me is > this prompt along with separate markers on the modeline for charset and > line ending style[2] led me to believe the coding system of the file is > the charset (as in the characters used in the text) it is using, whereas > line endings are set by something else. > > From your answer it seems that is not the case. Does that mean there > can be several coding system associated to a buffer? Am I talking > gibberish or does my question make any sense? > Footnotes: > > [1] I use utf-8 for all text files. > > [2] There is a U for files with UTF-8 characters and DOS for files with > DOS style line endings at separate places on the bottom left of the > modeline. At C-x C-m f prompt, you can choose utf-8-unix, utf-8-dos, utf-8-mac apart from other options that start with utf-8. The two things - encoding and what constitues a eol character - are orthogonal to each other. Frankly, I don't know any more that what the manual suggests.