From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: mac/dos/unix newline conversion without specify from Date: Fri, 7 Dec 2007 10:03:20 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <9fce01a5-ed79-4981-8b02-29e335b694cd@d21g2000prf.googlegroups.com> <168cd816-9fd4-49e8-a2a6-fe2ff6cf69a0@s36g2000prg.googlegroups.com> <85zlwptc5l.fsf@lola.goethe.zz> <17f871e1-56be-4269-8e44-9fb2652b02f6@a35g2000prf.googlegroups.com> <85prxlt8g0.fsf@lola.goethe.zz> <1eb0de3a-9c0f-4488-b05a-1ef36df87871@d4g2000prg.googlegroups.com> <85hcixt6ld.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1197052933 27107 80.91.229.12 (7 Dec 2007 18:42:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Dec 2007 18:42:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 07 19:42:21 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J0i9T-0001hD-1W for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Dec 2007 19:42:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0i9C-00031V-54 for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Dec 2007 13:42:02 -0500 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newsfeed.stanford.edu!postnews.google.com!t1g2000pra.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 51 Original-NNTP-Posting-Host: 69.236.121.223 Original-X-Trace: posting.google.com 1197050600 11118 127.0.0.1 (7 Dec 2007 18:03:20 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 7 Dec 2007 18:03:20 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t1g2000pra.googlegroups.com; posting-host=69.236.121.223; posting-account=qPxGtQkAAADb6PWdLGiWVucht1ZDR6fn User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/523.12 (KHTML, like Gecko) Version/3.0.4 Safari/523.12, gzip(gfe), gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:154492 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49923 Archived-At: David Kastrup wrote: <> Thanks for finding the cause. Anyhow, for what's worth, i think this is still something emacs (in particular Mac versions) should fixup. Basically, the scenario is that a user opens mac classic html files, work on it, save it, then next time he opens the files shows ^M. (this actually happens to me a lot since i work on a server with non-professional coders and they use BBEdit that is still set to CR as newline) In contrast, i open the same file (with CR as eol but a LF at the end) in Xcode, TextWrangler, TextEdit, all opens correctly and indicate as Mac files. * perhaps require-final-newline should insert the right EOL char based on the encoding. * perhaps emacs file opening routine should be more smart. (i.e. not using the last EOL, or check more lines, to determine the EOL char) (note: this post contains the french double quote char "<<>>" (unicode 00AB 00BB). Google groups may have botched it to <<>> or omitted it) Xah xah@xahlee.org $B-t(B http://xahlee.org/ On Dec 5, 9:05 am, David Kastrup wrote: > Xah Lee writes: > > Xah Lee wrote: > > < > Then start emacs with -q, open the file. It doesn't interprete the > > file as a mac os classic file but instead display newline char as ^M.>> > > > David Kastrup wrote: > > << > > It does switch to Mac endings here in this case. Just tried it. > > > mm... interesting. Here's a sample file for what's worth: > >http://xahlee.org/emacs/x-unixmacdos-eol/x1mac > > That's because html-mode sets require-final-newline to t. If you reset > it to nil and then save, you get the file saved without a final > (non-Macish-looking) LF character, and it gets recognized correctly when > loading it again. > > -- > David Kastrup, Kriemhildstr. 15, 44793 Bochum