GNU bug report logs - #4816
change of coding system without inquiry

Previous Next

Package: emacs;

Reported by: eisinger <at> informatik.uni-muenchen.de

Date: Tue, 27 Oct 2009 23:10:05 UTC

Severity: minor

Tags: patch

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 4816 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: eisinger <at> informatik.uni-muenchen.de
Cc: 4816 <at> debbugs.gnu.org
Subject: Re: bug#4816: change of coding system without inquiry
Date: Thu, 29 Oct 2009 20:57:12 -0400
> When I edit a non-latin-1 character into a latin-1 file and then save it,
> Emacs saves the file in UTF-8 without inquiry. It omits the dialogue that
> would inform me about the offending character and would offer me to select
> a coding system for saving.
[...]
> If suppression of the dialogue is intended and not a bug: is there
> some variable with which I can specify that I want to get that
> dialogue anyway?

In Emacs-23, the preferred charset has been changed to utf-8, so when
opening a new file, we first try utf-8 (both because it's expected to
be the standard coding-system in GNU/Linux systems nowadays, and
because there are very few files that are encoded with something else
than utf-8 and yet they also happen to be valid utf-8 files).

So when saving a file in a latin-1 locale, both latin-1 and utf-8 can be
used "interchangeably" by Emacs.

There is currently no direct way to ask Emacs to prompt when changing
the coding system (probably mostly because changing it is common when
changing it from us-ascii (as used for empty files or other files
without non-ascii chars) to something else).

Could you explain the context in which this problem showed up?
(e.g. tell us why the coding system used matters, whether or not you've
specified the coding-system in a "-*-coding-*-" cookie and why, etc...)

BTW, in Emacs-23.2, the code has been slightly changed to always obey
the coding cookie in a file, so if you file has a "coding:latin-1"
cookie, then Emacs will not silently save it in any other coding-system.


        Stefan



This bug report was last modified 5 years and 183 days ago.

Previous Next


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