From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.bugs Subject: Re: decode_eol and inconsistent EOL Date: 26 Apr 2002 09:00:20 -0400 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <5l662eipi3.fsf@rum.cs.yale.edu> References: <1438-Thu25Apr2002222156+0300-eliz@is.elta.co.il> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1019880390 22297 127.0.0.1 (27 Apr 2002 04:06:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 27 Apr 2002 04:06:30 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 171JTh-0005nW-00 for ; Sat, 27 Apr 2002 06:06:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 171JTn-0004vl-00; Sat, 27 Apr 2002 00:06:35 -0400 Original-Received: from delysid.gnu.org ([158.121.106.20]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 171JJK-0003qY-00; Fri, 26 Apr 2002 23:55:47 -0400 Original-Received: from dimail.epfl.ch ([128.178.79.31]) by delysid.gnu.org with esmtp (Exim 3.34 #2) id 171I1t-0006n9-00 for ; Fri, 26 Apr 2002 22:33:41 -0400 Original-Received: from dinews.epfl.ch (news@disunds1 [128.178.79.23]) by dimail.epfl.ch (8.8.X/EPFL-8.1g) with SMTP id EAA16001 for ; Sat, 27 Apr 2002 04:33:37 +0200 (MET DST) Original-To: gnu-emacs-bug@gnu.org Original-Newsgroups: gnu.emacs.bug Original-Lines: 22 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50 X-Original-NNTP-Posting-Host: rum.cs.yale.edu X-Original-Trace: 26 Apr 2002 09:00:20 -0400, rum.cs.yale.edu Original-Path: rum.cs.yale.edu!rum.cs.yale.edu Original-NNTP-Posting-Host: liasun13.epfl.ch X-Original-NNTP-Posting-Host: liasun13.epfl.ch Original-X-Trace: 27 Apr 2002 04:33:35 +0100, liasun13.epfl.ch Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:980 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:980 >> I'd like to see a cleverer setting of the eol_type. If almost all of >> the lines have a particular eol style, use that instead of falling back >> to CODING_EOL_LF after a single bad line. > That kind of heuristic is bound to trip some people, I think. It's > difficult to set a threshold that will suit everyone. It's also > difficult for users to set such a threshold, if we give them an > option. > Can't your problem be solved with "C-x RET c dos RET" before the > command that gives you the trouble? I think all that we really care about is that the load+save trip is safe and that the content of the Emacs buffer looks "as right as possible". In Stephen's case, clearly CRCRLF should be consider as CR+eol and there does not need to be any heuristic for that. It's perfectly safe and can only be the right choice for the internal representation. I.e. if all LF are preceded by a CR we should use "dos-eol" whether or not those CRs are sometimes preceded by other CRs. Stefan