GNU bug report logs - #6338
23.2; line-encoding not recognized in short files

Previous Next

Package: emacs;

Reported by: David Reitter <david.reitter <at> gmail.com>

Date: Thu, 3 Jun 2010 02:19:01 UTC

Severity: normal

Tags: fixed

Found in versions 24.2, 23.2

Fixed in version 24.3

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6338 in the body.
You can then email your comments to 6338 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bugs <at> aquamacs.org, bug-gnu-emacs <at> gnu.org:
bug#6338; Package emacs. (Thu, 03 Jun 2010 02:19:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to David Reitter <david.reitter <at> gmail.com>:
New bug report received and forwarded. Copy sent to bugs <at> aquamacs.org, bug-gnu-emacs <at> gnu.org. (Thu, 03 Jun 2010 02:19:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: David Reitter <david.reitter <at> gmail.com>
To: Bug-Gnu-Emacs <bug-gnu-emacs <at> gnu.org>
Subject: 23.2;  line-encoding not recognized in short files
Date: Wed, 2 Jun 2010 22:17:49 -0400
[Message part 1 (text/plain, inline)]
X-Debbugs-CC: francesco.dellapietra <at> gmail.com
X-Debbugs-CC: bugs <at> aquamacs.org

Emacs fails to recognize the encoding of a relatively short file with Mac-like line endings (attached).   I think that this is the main problem.  This I have reproduced in a 23-based Emacs.  If the file is made longer (with more LaTeX code), line-endings seem to be recognized correctly.

The user's report is below; you can see that he is surprised by Emacs trying to be smart and guessing the encoding from \usepackage[mac]{inputenv} in his LaTeX file.  Note that it only guesses this when the file is re-loaded - not upon the first save.  That is part of why this is surprising "by design".  (Then, the LaTeX-aware encoding guesser seems to ignore the actual line-endings of the file being loaded and goes for "Mac".)


[foo9.tex (application/octet-stream, attachment)]
[Message part 3 (text/plain, inline)]
Begin forwarded message:

> From: Francesco Della Pietra <francesco.dellapietra <at> gmail.com>
> Date: June 2, 2010 9:41:38 AM EDT
> To: Bug reports for Aquamacs Emacs <aquamacs-bugs <at> aquamacs.org>
> Subject: Re: [Aquamacs-bugs] 23.2; files saved in wrong line end format
> Reply-To: Bug reports for Aquamacs Emacs <aquamacs-bugs <at> aquamacs.org>
> 
> Yes,
> but this does not happen with your file. After some tests, the minimal text where i find this problem is the following, with these (minimal) instructions:
> 
> - start without customizations
> -command-N
> -enter exactly these lines:
> 
> \documentclass[a4paper,10pt]{article}
> 
> \usepackage[mac]{inputenc}
> \usepackage[italian]{babel}
> \usepackage[intlimits]{amsmath} 
> \usepackage{amsthm,booktabs} 
> \reversemarginpar
> \usepackage{amsfonts}     
> \usepackage{amssymb,color,comment}
> \usepackage[top=2cm, bottom=1cm, left=1cm, right=1cm]  {geometry}
> \begin{document}
> \pagestyle{empty}
> \twocolumn
> \begin{center}
> \textbf{\Large \sc Analisi Matematica}
> \end{center}
> 
> -C-x C-s foo.tex
> -Command-W
> -C-x C-f foo.tex
> 
> (it appears OK)
> 
> - Now modify something, for example give an empty space between lines:
> 
> \documentclass[a4paper,10pt]{article}
> 
> \usepackage[mac]{inputenc}
> \usepackage[italian]{babel}
> 
> \usepackage[intlimits]{amsmath} 
> \usepackage{amsthm,booktabs} 
> \reversemarginpar
> \usepackage{amsfonts}     
> \usepackage{amssymb,color,comment}
> \usepackage[top=2cm, bottom=1cm, left=1cm, right=1cm]  {geometry}
> \begin{document}
> \pagestyle{empty}
> \twocolumn
> \begin{center}
> \textbf{\Large \sc Analisi Matematica}
> \end{center}
> 
> -C-x C-s
> -Command-W
> -C-x C-f foo.tex
> 
> Now appears
> 
> \documentclass[a4paper,10pt]{article}^M^M\usepackage[mac]{inputenc}^M\usepackage[italian]{babel}^M^M\usepackage[intlimits]{amsmath} 
> ^M\usepackage{amsthm,booktabs}^M\reversemarginpar^M\usepackage{amsfonts} ...
> and so on.
> 
> 
> 
> Thanks for the time you spent on my problem.
> 


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#6338; Package emacs. (Fri, 26 Aug 2016 02:39:02 GMT) Full text and rfc822 format available.

Message #8 received at 6338 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: David Reitter <david.reitter <at> gmail.com>
Cc: bugs <at> aquamacs.org, 6338 <at> debbugs.gnu.org
Subject: Re: bug#6338: 23.2;  line-encoding not recognized in short files
Date: Thu, 25 Aug 2016 22:38:56 -0400
found 6338 24.2
tags 6338 fixed
close 6338 24.3
quit

David Reitter <david.reitter <at> gmail.com> writes:

> Emacs fails to recognize the encoding of a relatively short file with
> Mac-like line endings (attached).  I think that this is the main
> problem.  This I have reproduced in a 23-based Emacs.  If the file is
> made longer (with more LaTeX code), line-endings seem to be recognized
> correctly.
>

Opening that file with Emacs up to version 24.2 results in a single line
containing ^M in the buffer.  In Emacs 24.3 and up the Mac line endings
are recognized correctly, so I'm closing this as fixed.




bug Marked as found in versions 24.2. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Fri, 26 Aug 2016 02:39:02 GMT) Full text and rfc822 format available.

Added tag(s) fixed. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Fri, 26 Aug 2016 02:39:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 24.3, send any further explanations to 6338 <at> debbugs.gnu.org and David Reitter <david.reitter <at> gmail.com> Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Fri, 26 Aug 2016 02:39:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 23 Sep 2016 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 274 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.