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.

Full log


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.
> 


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.