unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: eisinger@informatik.uni-muenchen.de
Cc: 4816@emacsbugs.donarmstrong.com
Subject: bug#4816: change of coding system without inquiry
Date: Thu, 29 Oct 2009 20:57:12 -0400	[thread overview]
Message-ID: <jwvk4ydr9rb.fsf-monnier+emacsbugreports@gnu.org> (raw)
In-Reply-To: <4AE77C59.5060106@informatik.uni-muenchen.de> (Norbert Eisinger's message of "Wed, 28 Oct 2009 00:03:53 +0100")

> 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





  reply	other threads:[~2009-10-30  0:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-27 23:03 bug#4816: change of coding system without inquiry Norbert Eisinger
2009-10-30  0:57 ` Stefan Monnier [this message]
2009-10-30 13:19   ` Norbert Eisinger
2009-10-30 15:02     ` Stefan Monnier
2009-10-30 15:47       ` Eli Zaretskii
2009-10-31 16:32       ` Norbert Eisinger
2009-11-01 18:33       ` Eli Zaretskii
2009-11-02  7:05         ` Stefan Monnier
2019-06-27 17:49       ` Lars Ingebrigtsen
2019-06-27 18:41         ` Eli Zaretskii
2019-11-23 12:55           ` Lars Ingebrigtsen
2016-02-28  6:37 ` Lars Ingebrigtsen
2016-02-28 15:46   ` Eli Zaretskii
2016-02-29  2:35     ` Lars Ingebrigtsen

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=jwvk4ydr9rb.fsf-monnier+emacsbugreports@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=4816@emacsbugs.donarmstrong.com \
    --cc=eisinger@informatik.uni-muenchen.de \
    /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).