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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: eisinger@HIDDEN; Keywords: patch; dated Tue, 27 Oct 2009 23:10:05 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs@HIDDEN> to internal_control <at> debbugs.gnu.org. Full text available.

Message received at 4816 <at> debbugs.gnu.org:


Received: (at 4816) by debbugs.gnu.org; 29 Feb 2016 02:35:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 28 21:35:48 2016
Received: from localhost ([127.0.0.1]:51159 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aaDgZ-0008DS-Va
	for submit <at> debbugs.gnu.org; Sun, 28 Feb 2016 21:35:48 -0500
Received: from hermes.netfonds.no ([80.91.224.195]:56169)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <larsi@HIDDEN>) id 1aaDgY-0008DK-Lf
 for 4816 <at> debbugs.gnu.org; Sun, 28 Feb 2016 21:35:46 -0500
Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161]
 helo=mouse)
 by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.72) (envelope-from <larsi@HIDDEN>)
 id 1aaDgB-000864-Ra; Mon, 29 Feb 2016 03:35:24 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#4816: change of coding system without inquiry
References: <4AE77C59.5060106@HIDDEN>
 <8737sds5ly.fsf@HIDDEN> <83ziukalco.fsf@HIDDEN>
Date: Mon, 29 Feb 2016 13:35:19 +1100
In-Reply-To: <83ziukalco.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 28 Feb
 2016 17:46:47 +0200")
Message-ID: <87mvqk2qhk.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-MailScanner-ID: 1aaDgB-000864-Ra
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi@HIDDEN
MailScanner-NULL-Check: 1457318124.84538@yeEwrm15+eLUkuXpNi50ow
X-Spam-Status: No
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 4816
Cc: eisinger@HIDDEN, 4816 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Eli Zaretskii <eliz@HIDDEN> writes:

> Actually, I very much doubt that.  We still silently use the preferred
> encoding if the original one doesn't fit.
>
> This is a rare use case.  It's possible that just saying
>
>   (prefer-coding-system 'latin-1)
>
> is all that's needed to get the required prompt back.
>
> I think we should also welcome a patch to provide a user option that
> will always force the prompt.

Ok; reopening.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#4816; Package emacs. Full text available.

Message received at 4816 <at> debbugs.gnu.org:


Received: (at 4816) by debbugs.gnu.org; 28 Feb 2016 15:47:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 28 10:47:14 2016
Received: from localhost ([127.0.0.1]:50886 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aa3Yw-0006Ac-Cn
	for submit <at> debbugs.gnu.org; Sun, 28 Feb 2016 10:47:14 -0500
Received: from eggs.gnu.org ([208.118.235.92]:49832)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <eliz@HIDDEN>) id 1aa3Yu-0006AQ-W9
 for 4816 <at> debbugs.gnu.org; Sun, 28 Feb 2016 10:47:13 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1aa3Yl-0007rZ-OR
 for 4816 <at> debbugs.gnu.org; Sun, 28 Feb 2016 10:47:07 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37605)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1aa3Yl-0007rL-Kp; Sun, 28 Feb 2016 10:47:03 -0500
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3216
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1aa3Yk-0004ki-VT; Sun, 28 Feb 2016 10:47:03 -0500
Date: Sun, 28 Feb 2016 17:46:47 +0200
Message-Id: <83ziukalco.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
In-reply-to: <8737sds5ly.fsf@HIDDEN> (message from Lars Ingebrigtsen on Sun, 
 28 Feb 2016 17:37:13 +1100)
Subject: Re: bug#4816: change of coding system without inquiry
References: <4AE77C59.5060106@HIDDEN>
 <8737sds5ly.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 4816
Cc: eisinger@HIDDEN, 4816 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Lars Ingebrigtsen <larsi@HIDDEN>
> Date: Sun, 28 Feb 2016 17:37:13 +1100
> Cc: 4816 <at> debbugs.gnu.org
> 
> I think this has probably been fixed in the intervening years

Actually, I very much doubt that.  We still silently use the preferred
encoding if the original one doesn't fit.

This is a rare use case.  It's possible that just saying

  (prefer-coding-system 'latin-1)

is all that's needed to get the required prompt back.

I think we should also welcome a patch to provide a user option that
will always force the prompt.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#4816; Package emacs. Full text available.
bug closed, send any further explanations to 4816 <at> debbugs.gnu.org and eisinger@HIDDEN Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 4816 <at> debbugs.gnu.org:


Received: (at 4816) by debbugs.gnu.org; 28 Feb 2016 06:37:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 28 01:37:44 2016
Received: from localhost ([127.0.0.1]:49471 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aZuzA-0005pz-LL
	for submit <at> debbugs.gnu.org; Sun, 28 Feb 2016 01:37:44 -0500
Received: from hermes.netfonds.no ([80.91.224.195]:57498)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <larsi@HIDDEN>) id 1aZuz8-0005pr-Ns
 for 4816 <at> debbugs.gnu.org; Sun, 28 Feb 2016 01:37:43 -0500
Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161]
 helo=mouse)
 by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.72) (envelope-from <larsi@HIDDEN>)
 id 1aZuyj-0004ok-JM; Sun, 28 Feb 2016 07:37:18 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Norbert Eisinger <eisinger@HIDDEN>
Subject: Re: bug#4816: change of coding system without inquiry
References: <4AE77C59.5060106@HIDDEN>
Date: Sun, 28 Feb 2016 17:37:13 +1100
In-Reply-To: <4AE77C59.5060106@HIDDEN> (Norbert Eisinger's
 message of "Wed, 28 Oct 2009 00:03:53 +0100")
Message-ID: <8737sds5ly.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-MailScanner-ID: 1aZuyj-0004ok-JM
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi@HIDDEN
MailScanner-NULL-Check: 1457246238.44659@sGrHlIMyeyvsC2R45D+sjA
X-Spam-Status: No
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 4816
Cc: 4816 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Norbert Eisinger <eisinger@HIDDEN> writes:

> 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.
>
> Below is a description for Emacs 22.2 (Ubuntu). Other people could
> reproduce the behavior in Emacs 22.1 (Ubuntu) and 23.1.

I think this has probably been fixed in the intervening years, so I'm
closing this bug report.  Please reopen if this is still an issue.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#4816; Package emacs. Full text available.
Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) moreinfo and patch. Request was from Glenn Morris <rgm@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 4816@HIDDEN:


Received: (at 4816) by emacsbugs.donarmstrong.com; 2 Nov 2009 07:05:50 +0000
From monnier@HIDDEN Sun Nov  1 23:05:50 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.8 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.181])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nA275mOl010565
	for <4816@HIDDEN>; Sun, 1 Nov 2009 23:05:49 -0800
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AsgEAPMS7kpFpYlL/2dsb2JhbACBT9dqhDkEiGY
X-IronPort-AV: E=Sophos;i="4.44,664,1249272000"; 
   d="scan'208";a="48519636"
Received: from 69-165-137-75.dsl.teksavvy.com (HELO ceviche.home) ([69.165.137.75])
  by ironport2-out.pppoe.ca with ESMTP; 02 Nov 2009 02:05:42 -0500
Received: by ceviche.home (Postfix, from userid 20848)
	id 6B16870040; Mon,  2 Nov 2009 02:05:41 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 4816 <at> debbugs.gnu.org, eisinger@HIDDEN
Subject: Re: bug#4816: change of coding system without inquiry
Message-ID: <jwvocnlmmqt.fsf-monnier+emacsbugreports@HIDDEN>
References: <4AE77C59.5060106@HIDDEN>
	<jwvk4ydr9rb.fsf-monnier+emacsbugreports@HIDDEN>
	<4AEAE7F8.6010609@HIDDEN>
	<jwvr5sl9c7g.fsf-monnier+emacsbugreports@HIDDEN>
	<83fx8yccxp.fsf@HIDDEN>
Date: Mon, 02 Nov 2009 02:05:41 -0500
In-Reply-To: <83fx8yccxp.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 01 Nov
	2009 20:33:38 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

>> I think you're right that we should at least do a y-or-n-p prompt
>> when changing the buffer-file-coding-system, unless the change is to
>> a "superset coding system" (like from us-ascii to latin-1).

> FWIW, in the past users explicitly expressed annoyance by these
> questions.  The request was to use the "native" encoding silently.
> By introducing back this question, we are restoring that annoyance.

IIRC, the annoyance was only when saving a formerly us-ascii file
(typical example: an empty or not-yet-existing file).
But, yes, I know this is delicate.


        Stefan



Acknowledgement sent to Stefan Monnier <monnier@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4816; Package emacs. Full text available.

Message received at 4816@HIDDEN:


Received: (at 4816) by emacsbugs.donarmstrong.com; 1 Nov 2009 18:34:08 +0000
From eliz@HIDDEN Sun Nov  1 10:34:08 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.9 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mtaout22.012.net.il (mtaout22.012.net.il [80.179.55.172])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nA1IY6GF016217
	for <4816@HIDDEN>; Sun, 1 Nov 2009 10:34:07 -0800
Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0KSG007000R0CP00@HIDDEN> for 4816@HIDDEN; Sun, 01 Nov 2009 20:33:39 +0200 (IST)
Received: from HOME-C4E4A596F7 ([87.70.37.193]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KSG005G60VZHD80@HIDDEN>; Sun, 01 Nov 2009 20:33:36 +0200 (IST)
Date: Sun, 01 Nov 2009 20:33:38 +0200
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#4816: change of coding system without inquiry
In-reply-to: <jwvr5sl9c7g.fsf-monnier+emacsbugreports@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Stefan Monnier <monnier@HIDDEN>, 4816 <at> debbugs.gnu.org
Cc: eisinger@HIDDEN
Reply-to: Eli Zaretskii <eliz@HIDDEN>
Message-id: <83fx8yccxp.fsf@HIDDEN>
References: <4AE77C59.5060106@HIDDEN> <jwvk4ydr9rb.fsf-monnier+emacsbugreports@HIDDEN> <4AEAE7F8.6010609@HIDDEN> <jwvr5sl9c7g.fsf-monnier+emacsbugreports@HIDDEN>

> From: Stefan Monnier <monnier@HIDDEN>
> Date: Fri, 30 Oct 2009 11:02:49 -0400
> Cc: 4816@HIDDEN
> 
> I think you're right that we should at least do a y-or-n-p prompt
> when changing the buffer-file-coding-system, unless the change is to
> a "superset coding system" (like from us-ascii to latin-1).

FWIW, in the past users explicitly expressed annoyance by these
questions.  The request was to use the "native" encoding silently.  By
introducing back this question, we are restoring that annoyance.




Acknowledgement sent to Eli Zaretskii <eliz@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4816; Package emacs. Full text available.

Message received at 4816@HIDDEN:


Received: (at 4816) by emacsbugs.donarmstrong.com; 31 Oct 2009 16:33:09 +0000
From eisinger@HIDDEN Sat Oct 31 09:33:08 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.0 required=4.0 tests=AWL,HAS_BUG_NUMBER,
	MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from acheron.ifi.lmu.de (acheron.ifi.lmu.de [129.187.214.135])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9VGX5PM032283
	for <4816@HIDDEN>; Sat, 31 Oct 2009 09:33:08 -0700
Received: from [10.153.74.162] (koro.pms.ifi.lmu.de [141.84.9.33])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: eisinger)
	by acheron.ifi.lmu.de (Postfix) with ESMTP id D081C94A1BA;
	Sat, 31 Oct 2009 17:33:03 +0100 (CET)
Message-ID: <4AEC66B8.6000909@HIDDEN>
Date: Sat, 31 Oct 2009 17:32:56 +0100
From: Norbert Eisinger <eisinger@HIDDEN>
Reply-To: eisinger@HIDDEN
User-Agent: Thunderbird 2.0.0.23 (X11/20090817)
MIME-Version: 1.0
To: Stefan Monnier <monnier@HIDDEN>
CC: 4816 <at> debbugs.gnu.org
Subject: Re: bug#4816: change of coding system without inquiry
References: <4AE77C59.5060106@HIDDEN>	<jwvk4ydr9rb.fsf-monnier+emacsbugreports@HIDDEN>	<4AEAE7F8.6010609@HIDDEN> <jwvr5sl9c7g.fsf-monnier+emacsbugreports@HIDDEN>
In-Reply-To: <jwvr5sl9c7g.fsf-monnier+emacsbugreports@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Stefan Monnier wrote:
>
> I think you're right that we should at
> least do a y-or-n-p prompt when changing the buffer-file-coding-system,=

> unless the change is to a "superset coding system" (like from us-ascii
> to latin-1).

I understand the tightrope walk. When you ask users about technical stuff=
,
they feel bothered if it does not make any difference to them. When you
don't ask them, they feel patronized if it does make a difference.

The superset strategy is probably a reasonable compromise. I believe
that something like the following might still go wrong, but this
is a construed example and I did not test it:

File announcement.tex contains
   \include{config.tex}
   ... \LECTURER ...
   % only ASCII characters in this file

Latin-1 encoded file config.tex contains
   \usepackage[latin1]{inputenc}
   \newcommand{\LECTURER}{Fran=E7ois}

Later someone edits announcement.tex, adds the letter =E7 to it and saves=
 it,
thus changing the coding system from ascii to the superset utf-8. After t=
hat
the two occurrences of =E7 are differently encoded.

But, again, this is an unusual case. In normal cases we should be OK with=

the superset strategy.



> There is currently no direct way to ask Emacs to prompt when changing
> the coding system

Setting select-safe-coding-system-accept-default-p to
(function (lambda (coding-system) nil))
would not have this effect in the case we are discussing, would it?



> Can you try the patch below to see if it gives you the behavior you wan=
t?

I could not apply the patch, but I am at the limit of my knowledge.
Should I have gunzipped the file first?
Below is a description of what I did.

Best regards,
Norbert


=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
Local timezone: +0100

Emacs version:
GNU Emacs 22.2.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 200=
8-09-05 on vernadsky, modified by Ubuntu

$ locate mule-cmds
/usr/share/emacs/22.2/lisp/international/mule-cmds.el.gz
/usr/share/emacs/22.2/lisp/international/mule-cmds.elc
/usr/share/xemacs-21.4.21/lisp/mule/mule-cmds.elc

$ ls -l /usr/share/emacs/22.2/lisp/international/mule-cmds.*
-rw-r--r-- 1 root root  79042 2008-09-05 23:28 mule-cmds.elc
-rw-r--r-- 1 root root  30300 2008-01-10 13:15 mule-cmds.el.gz

$ cd /usr/share/emacs/22.2/lisp/international

$ /usr/bin/emacs -Q &
  copy&paste the patch into buffer *scratch*
  menu Tools -> Apply Patch -> To a File
  select buffer *scratch* and file mule-cmds.el

,----[ *scratch* ]
|
| =3D=3D=3D modified file 'lisp/international/mule-cmds.el'
| --- lisp/international/mule-cmds.el	2009-10-24 18:33:25 +0000
| +++ lisp/international/mule-cmds.el	2009-10-30 15:01:02 +0000
| @@ -979,6 +979,17 @@
|  	(if safe
|  	    (setq coding-system (car safe))))
|
| +      (unless (or (local-variable-p 'buffer-file-coding-system)
| +                  (eq coding-system buffer-file-coding-system)
| +                  ;; We'd rather only bother the user if the coding-sy=
stem
| +                  ;; change would cause the file's content to change, =
so we'd
| +                  ;; want to check whether the new coding-system is a =
superset
| +                  ;; of the previous one.
| +                  (memq buffer-file-coding-system '(nil undecided us-a=
scii))
| +                  (y-or-n-p (format "Change encoding from %s to %s? "
| +                                    buffer-file-coding-system coding-s=
ystem)))
| +        (setq coding-system nil))
| +
|        ;; If all the defaults failed, ask a user.
|        (when (not coding-system)
|  	(setq coding-system (select-safe-coding-system-interactively
| @@ -1024,6 +1035,7 @@
|  %s specified by file contents.  Really save (else edit coding cookies =
\
|  and try again)? " coding-system auto-cs))
|  	      (error "Save aborted"))))
| +
|        (when (and tick (/=3D tick (buffer-chars-modified-tick)))
|  	(error "Cancelled because the buffer was modified"))
|        coding-system)))
|
`----

,----[ *Messages* ]
| ("/usr/bin/emacs" "-Q")
| For information about GNU Emacs and the GNU system, type C-h C-a.
| Mark set
| Loading ediff...done
| Is the patch already in a buffer? (y or n)
| Making completion list...
| Loading help-mode...done
| Applying patch ... done
| ediff-patch-file-internal: Patch appears to have failed
`----

,----[ *ediff-message* ]
| Patch program has failed due to a bad patch file,
| it couldn't apply all hunks, OR
| it couldn't create the backup for the file being patched.
|
| The former could be caused by a corrupt patch file or because the "patc=
h"
| program doesn't understand the format of the patch file in use.
|
| The second problem might be due to an incompatibility among these setti=
ngs:
|     ediff-patch-program    =3D "patch"             ediff-patch-options =
   =3D "-f"
|     ediff-backup-extension =3D ".orig"             ediff-backup-specs  =
   =3D "-z.orig -b"
|
| See Ediff on-line manual for more details on these variables.
| In particular, check the documentation for `ediff-backup-specs'.
|
| In any of the above cases, Ediff doesn't compare files automatically.
| However, if the patch was applied partially and the backup file was cre=
ated,
| you can still examine the changes via M-x ediff-files
`----

,----[ mule-cmds.el.rej ]
| ***************
| *** 979,984 ****
|   	(if safe
|   	    (setq coding-system (car safe))))
|
|         ;; If all the defaults failed, ask a user.
|         (when (not coding-system)
|   	(setq coding-system (select-safe-coding-system-interactively
| --- 979,995 ----
|   	(if safe
|   	    (setq coding-system (car safe))))
|
| +       (unless (or (local-variable-p 'buffer-file-coding-system)
| +                   (eq coding-system buffer-file-coding-system)
| +                   ;; We'd rather only bother the user if the coding-s=
ystem
| +                   ;; change would cause the file's content to change,=
 so we'd
| +                   ;; want to check whether the new coding-system is a=
 superset
| +                   ;; of the previous one.
| +                   (memq buffer-file-coding-system '(nil undecided us-=
ascii))
| +                   (y-or-n-p (format "Change encoding from %s to %s? "=

| +                                     buffer-file-coding-system coding-=
system)))
| +         (setq coding-system nil))
| +
|         ;; If all the defaults failed, ask a user.
|         (when (not coding-system)
|   	(setq coding-system (select-safe-coding-system-interactively
| ***************
| *** 1024,1029 ****
|   %s specified by file contents.  Really save (else edit coding cookies=
 \
|   and try again)? " coding-system auto-cs))
|   	      (error "Save aborted"))))
|         (when (and tick (/=3D tick (buffer-chars-modified-tick)))
|   	(error "Cancelled because the buffer was modified"))
|         coding-system)))
| --- 1035,1041 ----
|   %s specified by file contents.  Really save (else edit coding cookies=
 \
|   and try again)? " coding-system auto-cs))
|   	      (error "Save aborted"))))
| +
|         (when (and tick (/=3D tick (buffer-chars-modified-tick)))
|   	(error "Cancelled because the buffer was modified"))
|         coding-system)))
|
`----

$ ls -l mule-cmds*
-rw-r--r-- 1 root root 30300 2009-10-31 15:26 mule-cmds.el
-rw-r--r-- 1 root root 79042 2008-09-05 23:28 mule-cmds.elc
-rw-r--r-- 1 root root 30300 2008-01-10 13:15 mule-cmds.el.orig
-rw-r--r-- 1 root root  1797 2009-10-31 15:26 mule-cmds.el.rej

$ diff mule-cmds.el.orig mule-cmds.el
$ ### files do not differ

$ ### lines 978 to 990 of a gunzipped safety copy made before
$ ### line number 986 seems to be the line numbered 979 in the patch
$ head -n 990 /tmp/mule-cmds-safety-copy.el | tail -n -13
        ;; Classify the defaults into safe, rejected, and unsafe.
        (dolist (elt default-coding-system)
          (if (memq (cdr elt) codings)
              (if (and (functionp accept-default-p)
                       (not (funcall accept-default-p (cdr elt))))
                  (push (car elt) rejected)
                (push (car elt) safe))
            (push (car elt) unsafe)))
        (if safe
            (setq coding-system (car safe))))

      ;; If all the defaults failed, ask a user.
      (when (not coding-system)



















Acknowledgement sent to eisinger@HIDDEN:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4816; Package emacs. Full text available.

Message received at 4816@HIDDEN:


Received: (at 4816) by emacsbugs.donarmstrong.com; 30 Oct 2009 15:47:27 +0000
From eliz@HIDDEN Fri Oct 30 08:47:26 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.9 required=4.0 tests=AWL,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mtaout22.012.net.il (mtaout22.012.net.il [80.179.55.172])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9UFlO4V010939
	for <4816@HIDDEN>; Fri, 30 Oct 2009 08:47:26 -0700
Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0KSC00H003SYEX00@HIDDEN> for 4816@HIDDEN; Fri, 30 Oct 2009 17:47:17 +0200 (IST)
Received: from HOME-C4E4A596F7 ([84.228.131.95]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KSC00E5O3UTU880@HIDDEN>; Fri, 30 Oct 2009 17:47:17 +0200 (IST)
Date: Fri, 30 Oct 2009 17:47:16 +0200
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#4816: change of coding system without inquiry
In-reply-to: <jwvr5sl9c7g.fsf-monnier+emacsbugreports@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Stefan Monnier <monnier@HIDDEN>, 4816 <at> debbugs.gnu.org
Cc: eisinger@HIDDEN
Reply-to: Eli Zaretskii <eliz@HIDDEN>
Message-id: <83my38evej.fsf@HIDDEN>
References: <4AE77C59.5060106@HIDDEN> <jwvk4ydr9rb.fsf-monnier+emacsbugreports@HIDDEN> <4AEAE7F8.6010609@HIDDEN> <jwvr5sl9c7g.fsf-monnier+emacsbugreports@HIDDEN>

> From: Stefan Monnier <monnier@HIDDEN>
> Date: Fri, 30 Oct 2009 11:02:49 -0400
> Cc: 4816@HIDDEN
> 
> +                  (eq coding-system buffer-file-coding-system)

This should probably use coding-system-equal.



Acknowledgement sent to Eli Zaretskii <eliz@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4816; Package emacs. Full text available.

Message received at 4816@HIDDEN:


Received: (at 4816) by emacsbugs.donarmstrong.com; 30 Oct 2009 15:02:57 +0000
From monnier@HIDDEN Fri Oct 30 08:02:56 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-3.2 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER,
	MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.183])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9UF2tug005750
	for <4816@HIDDEN>; Fri, 30 Oct 2009 08:02:56 -0700
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AhAFAASd6kpLd/xb/2dsb2JhbACBUOBNhD0EgWKHAQ
X-IronPort-AV: E=Sophos;i="4.44,653,1249272000"; 
   d="scan'208";a="48423740"
Received: from 75-119-252-91.dsl.teksavvy.com (HELO pastel.home) ([75.119.252.91])
  by ironport2-out.pppoe.ca with ESMTP; 30 Oct 2009 11:02:49 -0400
Received: by pastel.home (Postfix, from userid 20848)
	id 05BAA80C9; Fri, 30 Oct 2009 11:02:49 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: eisinger@HIDDEN
Cc: 4816 <at> debbugs.gnu.org
Subject: Re: bug#4816: change of coding system without inquiry
Message-ID: <jwvr5sl9c7g.fsf-monnier+emacsbugreports@HIDDEN>
References: <4AE77C59.5060106@HIDDEN>
	<jwvk4ydr9rb.fsf-monnier+emacsbugreports@HIDDEN>
	<4AEAE7F8.6010609@HIDDEN>
Date: Fri, 30 Oct 2009 11:02:49 -0400
In-Reply-To: <4AEAE7F8.6010609@HIDDEN> (Norbert Eisinger's
	message of "Fri, 30 Oct 2009 14:19:52 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

> Our computer environment has for years been a SuSE distribution
> of Linux with latin-1 locale. Recently it was replaced by a
> Kubuntu distribution with utf-8 locale.

Fairly common situation.

> Over the years we have accumulated a large number of latin-1 files
> that were created and edited by people who are no longer in the group
> and who used whichever editors they liked. Some files may contain as
> part of their text content information about the coding system:
> "\usepackage[latin1]{inputenc}" in a LaTeX file,
> "<?xml version='1.0' encoding='iso-8859-1'?>" in an XML file,
> "<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>"
> in an HTML file. Probably there are similar examples for other formats.

Those xml/latex statement should be understood by Emacs as coding
cookies, so the files that contain those statements should be handled
properly with Emacs-23.2.

> Depending on the format the files may also contain some form of
> include mechanism that refers to a different file whose text
> content contains such coding information.

Yes, this is a more problematic case, because fundamentally there is
a coding-cookie, but Emacs doesn't know it because it's in another file.

> I don't know how frequent our situation is, but I guess that
> it is not uncommon in university environments in countries
> whose language needed one of the ISO-latin extensions of ASCII.

That was helpful, thank you.  I think you're right that we should at
least do a y-or-n-p prompt when changing the buffer-file-coding-system,
unless the change is to a "superset coding system" (like from us-ascii
to latin-1).

Can you try the patch below to see if it gives you the behavior you want?


        Stefan


=== modified file 'lisp/international/mule-cmds.el'
--- lisp/international/mule-cmds.el	2009-10-24 18:33:25 +0000
+++ lisp/international/mule-cmds.el	2009-10-30 15:01:02 +0000
@@ -979,6 +979,17 @@
 	(if safe
 	    (setq coding-system (car safe))))
 
+      (unless (or (local-variable-p 'buffer-file-coding-system)
+                  (eq coding-system buffer-file-coding-system)
+                  ;; We'd rather only bother the user if the coding-system
+                  ;; change would cause the file's content to change, so we'd
+                  ;; want to check whether the new coding-system is a superset
+                  ;; of the previous one.
+                  (memq buffer-file-coding-system '(nil undecided us-ascii))
+                  (y-or-n-p (format "Change encoding from %s to %s? "
+                                    buffer-file-coding-system coding-system)))
+        (setq coding-system nil))
+
       ;; If all the defaults failed, ask a user.
       (when (not coding-system)
 	(setq coding-system (select-safe-coding-system-interactively
@@ -1024,6 +1035,7 @@
 %s specified by file contents.  Really save (else edit coding cookies \
 and try again)? " coding-system auto-cs))
 	      (error "Save aborted"))))
+
       (when (and tick (/= tick (buffer-chars-modified-tick)))
 	(error "Cancelled because the buffer was modified"))
       coding-system)))




Acknowledgement sent to Stefan Monnier <monnier@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4816; Package emacs. Full text available.

Message received at 4816@HIDDEN:


Received: (at 4816) by emacsbugs.donarmstrong.com; 30 Oct 2009 13:19:43 +0000
From eisinger@HIDDEN Fri Oct 30 06:19:43 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-1.4 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from acheron.ifi.lmu.de (acheron.ifi.lmu.de [129.187.214.135])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9UDJell027206
	for <4816@HIDDEN>; Fri, 30 Oct 2009 06:19:43 -0700
Received: from [10.153.74.162] (koro.pms.ifi.lmu.de [141.84.9.33])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: eisinger)
	by acheron.ifi.lmu.de (Postfix) with ESMTP id 72AFE94A262;
	Fri, 30 Oct 2009 14:19:39 +0100 (CET)
Message-ID: <4AEAE7F8.6010609@HIDDEN>
Date: Fri, 30 Oct 2009 14:19:52 +0100
From: Norbert Eisinger <eisinger@HIDDEN>
Reply-To: eisinger@HIDDEN
User-Agent: Thunderbird 2.0.0.23 (X11/20090817)
MIME-Version: 1.0
To: Stefan Monnier <monnier@HIDDEN>
CC: 4816 <at> debbugs.gnu.org
Subject: Re: bug#4816: change of coding system without inquiry
References: <4AE77C59.5060106@HIDDEN> <jwvk4ydr9rb.fsf-monnier+emacsbugreports@HIDDEN>
In-Reply-To: <jwvk4ydr9rb.fsf-monnier+emacsbugreports@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Stefan Monnier wrote:
> 
> 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...)

Cher Stefan,

we are a group in the computer science department of a German
university. The group consists of a full professor and an
assistant professor and 10 to 15 young scientists with research
duties or teaching duties or both. The young scientists typically
stay in the group for 3 or 4 years.

Our computer environment has for years been a SuSE distribution
of Linux with latin-1 locale. Recently it was replaced by a
Kubuntu distribution with utf-8 locale.

Over the years we have accumulated a large number of latin-1 files
that were created and edited by people who are no longer in the group
and who used whichever editors they liked. Some files may contain as
part of their text content information about the coding system:
"\usepackage[latin1]{inputenc}" in a LaTeX file,
"<?xml version='1.0' encoding='iso-8859-1'?>" in an XML file,
"<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>"
in an HTML file. Probably there are similar examples for other formats.
Depending on the format the files may also contain some form of
include mechanism that refers to a different file whose text
content contains such coding information.

The old files are still being used and edited. Sometimes people
have to make just minor modifications to an old file and do not
expect major consequences. However, if a minor modification
results in a change of the coding system, then the text content
of this file and possibly of included files may have to be adapted
in order to keep it consistent with the new actual coding system.
The colleagues are capable of repairing such inconsistencies, but
they may not notice them if the coding system changes silently.
This is why I am looking for a way to enforce a prompt whenever
the coding system is about to be changed.

In our situation there are not very few but very many files
encoded with something else than utf-8, and almost all of them
contain non-US-ASCII characters. Moreover, we never know by
which editors the files were created and subsequently edited.
Most of them do not contain "-*-coding-*-" cookies. Therefore
the new Emacs-23.2 behavior would probably not cover our case.

I don't know how frequent our situation is, but I guess that
it is not uncommon in university environments in countries
whose language needed one of the ISO-latin extensions of ASCII.


Thanks for your time and effort.

Norbert




Acknowledgement sent to eisinger@HIDDEN:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4816; Package emacs. Full text available.

Message received at 4816@HIDDEN:


Received: (at 4816) by emacsbugs.donarmstrong.com; 30 Oct 2009 00:57:20 +0000
From monnier@HIDDEN Thu Oct 29 17:57:20 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-3.3 required=4.0 tests=AWL,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.181])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9U0vI2k010910
	for <4816@HIDDEN>; Thu, 29 Oct 2009 17:57:20 -0700
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Aq4EALrW6UpLd/xb/2dsb2JhbACBT908hD0EiFY
X-IronPort-AV: E=Sophos;i="4.44,649,1249272000"; 
   d="scan'208";a="48397578"
Received: from 75-119-252-91.dsl.teksavvy.com (HELO ceviche.home) ([75.119.252.91])
  by ironport2-out.pppoe.ca with ESMTP; 29 Oct 2009 20:57:12 -0400
Received: by ceviche.home (Postfix, from userid 20848)
	id 98932B44D0; Thu, 29 Oct 2009 20:57:12 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: eisinger@HIDDEN
Cc: 4816 <at> debbugs.gnu.org
Subject: Re: bug#4816: change of coding system without inquiry
Message-ID: <jwvk4ydr9rb.fsf-monnier+emacsbugreports@HIDDEN>
References: <4AE77C59.5060106@HIDDEN>
Date: Thu, 29 Oct 2009 20:57:12 -0400
In-Reply-To: <4AE77C59.5060106@HIDDEN> (Norbert Eisinger's
	message of "Wed, 28 Oct 2009 00:03:53 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

> 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



Acknowledgement sent to Stefan Monnier <monnier@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4816; Package emacs. Full text available.

Message received at submit@HIDDEN:


Received: (at submit) by emacsbugs.donarmstrong.com; 27 Oct 2009 23:03:57 +0000
From eisinger@HIDDEN Tue Oct 27 16:03:56 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no
	version=3.2.5-bugs.debian.org_2005_01_02
Received: from lists.gnu.org (lists.gnu.org [199.232.76.165])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9RN3sJO007846
	for <submit@HIDDEN>; Tue, 27 Oct 2009 16:03:56 -0700
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1N2v50-0005hU-9v
	for bug-gnu-emacs@HIDDEN; Tue, 27 Oct 2009 19:03:54 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1N2v4u-0005gc-Bu
	for bug-gnu-emacs@HIDDEN; Tue, 27 Oct 2009 19:03:53 -0400
Received: from [199.232.76.173] (port=58056 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43)
	id 1N2v4u-0005gU-3B
	for bug-gnu-emacs@HIDDEN; Tue, 27 Oct 2009 19:03:48 -0400
Received: from acheron.ifi.lmu.de ([129.187.214.135]:46450)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <eisinger@HIDDEN>)
	id 1N2v4t-0002mz-9m
	for bug-gnu-emacs@HIDDEN; Tue, 27 Oct 2009 19:03:47 -0400
Received: from [10.153.74.162] (koro.pms.ifi.lmu.de [141.84.9.33])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: eisinger)
	by acheron.ifi.lmu.de (Postfix) with ESMTP id B280D94A1FC
	for <bug-gnu-emacs@HIDDEN>; Wed, 28 Oct 2009 00:03:44 +0100 (CET)
Message-ID: <4AE77C59.5060106@HIDDEN>
Date: Wed, 28 Oct 2009 00:03:53 +0100
From: Norbert Eisinger <eisinger@HIDDEN>
Reply-To: eisinger@HIDDEN
User-Agent: Thunderbird 2.0.0.23 (X11/20090817)
MIME-Version: 1.0
To: bug-gnu-emacs@HIDDEN
Subject: change of coding system without inquiry
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)


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 selec=
t
a coding system for saving.

Below is a description for Emacs 22.2 (Ubuntu). Other people could
reproduce the behavior in Emacs 22.1 (Ubuntu) and 23.1.

I do get the dialogue when I change the second Emacs invocation below to
~$ env LC_CTYPE=3DC /usr/bin/emacs -Q /tmp/l1


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?

Norbert Eisinger



=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

~$ /usr/bin/emacs -Q

,----[ C-h l ]
| <help-echo> <help-echo> =C3=A4 =C3=B6 =C3=BC <return> C-x <return> f i =
s o - l a t i n - 1 - u n i x <return> C-x C-s C-a C-k / t m p / l 1 <ret=
urn> C-h l
`----

~$ file /tmp/l1
/tmp/l1: ISO-8859 text

~$ /usr/bin/emacs -Q /tmp/l1

,----[ C-h l ]
| <help-echo> M-> E u r o s i g n SPC =E2=82=AC SPC i n s e r t e d <retu=
rn> C-x C-s C-h l
`----

,----[ *Messages* ]
| ("/usr/bin/emacs" "-Q" "/tmp/l1")
| For information about GNU Emacs and the GNU system, type C-h C-a.
| Mark set
| Wrote /tmp/l1
`----

,----
| In GNU Emacs 22.2.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
|  of 2008-09-05 on vernadsky, modified by Ubuntu
| Windowing system distributor `The X.Org Foundation', version 11.0.10600=
000
| configured using `configure  '--build=3Di486-linux-gnu' '--host=3Di486-=
linux-gnu' '--prefix=3D/usr' '--sharedstatedir=3D/var/lib' '--libexecdir=3D=
/usr/lib' '--localstatedir=3D/var' '--infodir=3D/usr/share/info' '--mandi=
r=3D/usr/share/man' '--with-pop=3Dyes' '--enable-locallisppath=3D/etc/ema=
cs22:/etc/emacs:/usr/local/share/emacs/22.2/site-lisp:/usr/local/share/em=
acs/site-lisp:/usr/share/emacs/22.2/site-lisp:/usr/share/emacs/site-lisp:=
/usr/share/emacs/22.2/leim' '--with-x=3Dyes' '--with-x-toolkit=3Dathena'
'--with-toolkit-scroll-bars' 'build_alias=3Di486-linux-gnu' 'host_alias=3D=
i486-linux-gnu' 'CFLAGS=3D-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=3D5000 -g -O=
2' 'LDFLAGS=3D-g -Wl,--as-needed' 'CPPFLAGS=3D''
|
| Important settings:
|   value of $LC_ALL:
|   value of $LC_COLLATE: nil
|   value of $LC_CTYPE: de_DE.utf8
|   value of $LC_MESSAGES: nil
|   value of $LC_MONETARY: nil
|   value of $LC_NUMERIC: nil
|   value of $LC_TIME: de_DE.utf8
|   value of $LANG: en_US.UTF-8
|   locale-coding-system: utf-8
|   default-enable-multibyte-characters: t
|
| Major mode: Fundamental
|
| Minor modes in effect:
|   tooltip-mode: t
|   tool-bar-mode: t
|   mouse-wheel-mode: t
|   menu-bar-mode: t
|   file-name-shadow-mode: t
|   global-font-lock-mode: t
|   font-lock-mode: t
|   blink-cursor-mode: t
|   unify-8859-on-encoding-mode: t
|   utf-translate-cjk-mode: t
|   auto-compression-mode: t
|   line-number-mode: t
|   transient-mark-mode: identity
`----

~$ file /tmp/l1
/tmp/l1: UTF-8 Unicode text

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D







Acknowledgement sent to eisinger@HIDDEN:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Report forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4816; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 29 Feb 2016 02:45:01 UTC

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