From: David Reitter <david.reitter@gmail.com>
To: 6338@debbugs.gnu.org
Cc: bugs@aquamacs.org
Subject: bug#6338: 23.2; line-encoding not recognized in short files
Date: Wed, 2 Jun 2010 22:17:49 -0400 [thread overview]
Message-ID: <C65A53DC-ACA3-41CB-A028-D5F28B2399D7@gmail.com> (raw)
In-Reply-To: 23CF8B21-1737-4F4F-AAFC-08C06AC24794@gmail.com
[-- Attachment #1: Type: text/plain, Size: 810 bytes --]
X-Debbugs-CC: francesco.dellapietra@gmail.com
X-Debbugs-CC: bugs@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".)
[-- Attachment #2: foo9.tex --]
[-- Type: application/octet-stream, Size: 444 bytes --]
\documentclass[a4paper,10pt]{article}\r\r\usepackage[mac]{inputenc}\r\usepackage[italian]{babel}\r \r[\usepackage[intlimits]{amsmath} \r\usepackage{amsthm,booktabs} \r\reversemarginpar\r\usepackage{amsfonts} \r\usepackage{amssymb,color,comment}\r\usepackage[top=2cm, bottom=1cm, left=1cm, right=1cm] {geometry}\r\begin{document}\r\pagestyle{empty}\r\twocolumn\r\begin{center}\r\textbf{\Large \sc Analisi Matematica}\r\end{center}\r\r% Due Date: June 1st!\r\r
[-- Attachment #3: Type: text/plain, Size: 2069 bytes --]
Begin forwarded message:
> From: Francesco Della Pietra <francesco.dellapietra@gmail.com>
> Date: June 2, 2010 9:41:38 AM EDT
> To: Bug reports for Aquamacs Emacs <aquamacs-bugs@aquamacs.org>
> Subject: Re: [Aquamacs-bugs] 23.2; files saved in wrong line end format
> Reply-To: Bug reports for Aquamacs Emacs <aquamacs-bugs@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.
>
next parent reply other threads:[~2010-06-03 2:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <23CF8B21-1737-4F4F-AAFC-08C06AC24794@gmail.com>
2010-06-03 2:17 ` David Reitter [this message]
2016-08-26 2:38 ` bug#6338: 23.2; line-encoding not recognized in short files npostavs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C65A53DC-ACA3-41CB-A028-D5F28B2399D7@gmail.com \
--to=david.reitter@gmail.com \
--cc=6338@debbugs.gnu.org \
--cc=bugs@aquamacs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).