From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Suvayu Ali Newsgroups: gmane.emacs.help Subject: Re: Changing file end-of-line style Date: Mon, 5 Nov 2012 14:24:10 +0100 Message-ID: <20121105132410.GG10005@kuru.dyndns-at-home.com> References: <20121105115709.GB10005@kuru.dyndns-at-home.com> <87sj8o5h9s.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1352121872 2723 80.91.229.3 (5 Nov 2012 13:24:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 Nov 2012 13:24:32 +0000 (UTC) Cc: Emacs help To: Jambunathan K Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 05 14:24: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 1TVMfM-00023k-8Q for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Nov 2012 14:24:36 +0100 Original-Received: from localhost ([::1]:45666 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVMfD-0001iS-86 for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Nov 2012 08:24:27 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVMf7-0001bU-45 for help-gnu-emacs@gnu.org; Mon, 05 Nov 2012 08:24:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TVMf1-0001mk-4A for help-gnu-emacs@gnu.org; Mon, 05 Nov 2012 08:24:20 -0500 Original-Received: from mail-ee0-f41.google.com ([74.125.83.41]:55403) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVMf0-0001mg-SQ for help-gnu-emacs@gnu.org; Mon, 05 Nov 2012 08:24:15 -0500 Original-Received: by mail-ee0-f41.google.com with SMTP id c4so3525039eek.0 for ; Mon, 05 Nov 2012 05:24:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=5S4gaRkrNFjf7S7/+9q8DuymZsZYCSoUlr5qTMhf22w=; b=sr7ROFtOmxllR05NIdPYvN/0JSQgN+pmjU9g66Ehuzj5ZCJQiobc6UGa/2WiVfv7A5 oaneabxPzJ43AeiIWWhaaiCcjOcg2zHjhlzQ+TL5L7oKE5c8UCr0lU2geuco5bOkNI4I sl7gbav530YM27C0cfbVTay8wl5v3vC45qHIH6lUQwO9cCXVoVncWR8Y4XuCrBg8kJyi WUPisua7KzPkWx5HC4wFMFticEFoKnEMvjQEFMLYcpBDdkYlZRvQ8TwNa1e76JlGHTRn 7BB9QxdkRSLjvcY5KDJCbU0kb6OQj1OZeYAufr+fmXkCbaXHM1XSpySSKT6bQlPbCczM fbnw== Original-Received: by 10.14.214.133 with SMTP id c5mr36747273eep.8.1352121854187; Mon, 05 Nov 2012 05:24:14 -0800 (PST) Original-Received: from kuru.dyndns-at-home.com (pb-d-128-141-52-183.cern.ch. [128.141.52.183]) by mx.google.com with ESMTPS id g5sm48112866eem.4.2012.11.05.05.24.12 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Nov 2012 05:24:13 -0800 (PST) Content-Disposition: inline In-Reply-To: <87sj8o5h9s.fsf@gmail.com> User-Agent: Mutt/1.5.21 (2011-07-01) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 74.125.83.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:87535 Archived-At: 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? Thanks, 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. -- Suvayu Open source is the future. It sets us free.