From eisinger@informatik.uni-muenchen.de Tue Oct 27 16:03:56 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 27 Oct 2009 23:03:57 +0000 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 ; 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@gnu.org; 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@gnu.org; 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@gnu.org; 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 ) id 1N2v4t-0002mz-9m for bug-gnu-emacs@gnu.org; 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 ; Wed, 28 Oct 2009 00:03:44 +0100 (CET) Message-ID: <4AE77C59.5060106@informatik.uni-muenchen.de> Date: Wed, 28 Oct 2009 00:03:53 +0100 From: Norbert Eisinger Reply-To: eisinger@informatik.uni-muenchen.de User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org 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 ] | =C3=A4 =C3=B6 =C3=BC C-x f i = s o - l a t i n - 1 - u n i x C-x C-s C-a C-k / t m p / l 1 C-h l `---- ~$ file /tmp/l1 /tmp/l1: ISO-8859 text ~$ /usr/bin/emacs -Q /tmp/l1 ,----[ C-h l ] | M-> E u r o s i g n SPC =E2=82=AC SPC i n s e r t e d 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 From monnier@iro.umontreal.ca Thu Oct 29 17:57:20 2009 Received: (at 4816) by emacsbugs.donarmstrong.com; 30 Oct 2009 00:57:20 +0000 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@emacsbugs.donarmstrong.com>; 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 To: eisinger@informatik.uni-muenchen.de Cc: 4816@debbugs.gnu.org Subject: Re: bug#4816: change of coding system without inquiry Message-ID: References: <4AE77C59.5060106@informatik.uni-muenchen.de> Date: Thu, 29 Oct 2009 20:57:12 -0400 In-Reply-To: <4AE77C59.5060106@informatik.uni-muenchen.de> (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 From eisinger@informatik.uni-muenchen.de Fri Oct 30 06:19:43 2009 Received: (at 4816) by emacsbugs.donarmstrong.com; 30 Oct 2009 13:19:43 +0000 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@emacsbugs.donarmstrong.com>; 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@informatik.uni-muenchen.de> Date: Fri, 30 Oct 2009 14:19:52 +0100 From: Norbert Eisinger Reply-To: eisinger@informatik.uni-muenchen.de User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Stefan Monnier CC: 4816@debbugs.gnu.org Subject: Re: bug#4816: change of coding system without inquiry References: <4AE77C59.5060106@informatik.uni-muenchen.de> In-Reply-To: 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, "" in an XML file, "" 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 From monnier@iro.umontreal.ca Fri Oct 30 08:02:56 2009 Received: (at 4816) by emacsbugs.donarmstrong.com; 30 Oct 2009 15:02:57 +0000 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@emacsbugs.donarmstrong.com>; 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 To: eisinger@informatik.uni-muenchen.de Cc: 4816@debbugs.gnu.org Subject: Re: bug#4816: change of coding system without inquiry Message-ID: References: <4AE77C59.5060106@informatik.uni-muenchen.de> <4AEAE7F8.6010609@informatik.uni-muenchen.de> Date: Fri, 30 Oct 2009 11:02:49 -0400 In-Reply-To: <4AEAE7F8.6010609@informatik.uni-muenchen.de> (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, > "" in an XML file, > "" > 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))) From eliz@gnu.org Fri Oct 30 08:47:26 2009 Received: (at 4816) by emacsbugs.donarmstrong.com; 30 Oct 2009 15:47:27 +0000 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@emacsbugs.donarmstrong.com>; 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@a-mtaout22.012.net.il> for 4816@emacsbugs.donarmstrong.com; 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@a-mtaout22.012.net.il>; Fri, 30 Oct 2009 17:47:17 +0200 (IST) Date: Fri, 30 Oct 2009 17:47:16 +0200 From: Eli Zaretskii Subject: Re: bug#4816: change of coding system without inquiry In-reply-to: X-012-Sender: halo1@inter.net.il To: Stefan Monnier , 4816@debbugs.gnu.org Cc: eisinger@informatik.uni-muenchen.de Reply-to: Eli Zaretskii Message-id: <83my38evej.fsf@gnu.org> References: <4AE77C59.5060106@informatik.uni-muenchen.de> <4AEAE7F8.6010609@informatik.uni-muenchen.de> > From: Stefan Monnier > Date: Fri, 30 Oct 2009 11:02:49 -0400 > Cc: 4816@emacsbugs.donarmstrong.com > > + (eq coding-system buffer-file-coding-system) This should probably use coding-system-equal. From eisinger@informatik.uni-muenchen.de Sat Oct 31 09:33:08 2009 Received: (at 4816) by emacsbugs.donarmstrong.com; 31 Oct 2009 16:33:09 +0000 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@emacsbugs.donarmstrong.com>; 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@informatik.uni-muenchen.de> Date: Sat, 31 Oct 2009 17:32:56 +0100 From: Norbert Eisinger Reply-To: eisinger@informatik.uni-muenchen.de User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Stefan Monnier CC: 4816@debbugs.gnu.org Subject: Re: bug#4816: change of coding system without inquiry References: <4AE77C59.5060106@informatik.uni-muenchen.de> <4AEAE7F8.6010609@informatik.uni-muenchen.de> In-Reply-To: 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) From eliz@gnu.org Sun Nov 1 10:34:08 2009 Received: (at 4816) by emacsbugs.donarmstrong.com; 1 Nov 2009 18:34:08 +0000 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@emacsbugs.donarmstrong.com>; 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@a-mtaout22.012.net.il> for 4816@emacsbugs.donarmstrong.com; 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@a-mtaout22.012.net.il>; Sun, 01 Nov 2009 20:33:36 +0200 (IST) Date: Sun, 01 Nov 2009 20:33:38 +0200 From: Eli Zaretskii Subject: Re: bug#4816: change of coding system without inquiry In-reply-to: X-012-Sender: halo1@inter.net.il To: Stefan Monnier , 4816@debbugs.gnu.org Cc: eisinger@informatik.uni-muenchen.de Reply-to: Eli Zaretskii Message-id: <83fx8yccxp.fsf@gnu.org> References: <4AE77C59.5060106@informatik.uni-muenchen.de> <4AEAE7F8.6010609@informatik.uni-muenchen.de> > From: Stefan Monnier > Date: Fri, 30 Oct 2009 11:02:49 -0400 > Cc: 4816@emacsbugs.donarmstrong.com > > 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. From monnier@iro.umontreal.ca Sun Nov 1 23:05:50 2009 Received: (at 4816) by emacsbugs.donarmstrong.com; 2 Nov 2009 07:05:50 +0000 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@emacsbugs.donarmstrong.com>; 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 To: Eli Zaretskii Cc: 4816@debbugs.gnu.org, eisinger@informatik.uni-muenchen.de Subject: Re: bug#4816: change of coding system without inquiry Message-ID: References: <4AE77C59.5060106@informatik.uni-muenchen.de> <4AEAE7F8.6010609@informatik.uni-muenchen.de> <83fx8yccxp.fsf@gnu.org> Date: Mon, 02 Nov 2009 02:05:41 -0500 In-Reply-To: <83fx8yccxp.fsf@gnu.org> (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 From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 27 18:15:03 2010 Received: (at control) by debbugs.gnu.org; 27 Jan 2010 23:15:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NaH6E-0002Bg-Fa for submit@debbugs.gnu.org; Wed, 27 Jan 2010 18:15:02 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NaH6D-0002BL-2V for control@debbugs.gnu.org; Wed, 27 Jan 2010 18:15:01 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1NaH69-0000Wv-8u; Wed, 27 Jan 2010 18:14:57 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19296.51441.209320.592328@fencepost.gnu.org> Date: Wed, 27 Jan 2010 18:14:57 -0500 From: Glenn Morris To: control Subject: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: green X-Ran: zo'*iB'qaD@E7lvk:%ud#li0vS`>9n1#8k6lXA9o%H<]pe)MoMi?tf2?x{Mj'@:O'2741; X-Debbugs-No-Ack: yes X-Spam-Score: -4.9 (----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.9 (----) reassign 4814 emacs,w32 tags 4816 patch moreinfo merge 4789 4881 severity 4789 minor severity 4882 minor From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 25 18:02:44 2015 Received: (at control) by debbugs.gnu.org; 25 Dec 2015 23:02:44 +0000 Received: from localhost ([127.0.0.1]:35865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aCbNk-0004gX-2a for submit@debbugs.gnu.org; Fri, 25 Dec 2015 18:02:44 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:42862) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aCbNh-0004gP-Ri for control@debbugs.gnu.org; Fri, 25 Dec 2015 18:02:42 -0500 Received: from 2.150.58.24.tmi.telenormobil.no ([2.150.58.24] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aCbNK-0006AS-7W for control@debbugs.gnu.org; Sat, 26 Dec 2015 00:02:18 +0100 Date: Sat, 26 Dec 2015 00:02:17 +0100 Message-Id: <87mvsyt9mu.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #4816 X-MailScanner-ID: 1aCbNK-0006AS-7W X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1451689340.49203@08E0kLJrT54yJLqHEqiraQ X-Spam-Status: No X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) tags 4816 - moreinfo From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 28 01:37:44 2016 Received: (at 4816) by debbugs.gnu.org; 28 Feb 2016 06:37:44 +0000 Received: from localhost ([127.0.0.1]:49471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZuzA-0005pz-LL for submit@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 ) id 1aZuz8-0005pr-Ns for 4816@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 ) id 1aZuyj-0004ok-JM; Sun, 28 Feb 2016 07:37:18 +0100 From: Lars Ingebrigtsen To: Norbert Eisinger Subject: Re: bug#4816: change of coding system without inquiry References: <4AE77C59.5060106@informatik.uni-muenchen.de> Date: Sun, 28 Feb 2016 17:37:13 +1100 In-Reply-To: <4AE77C59.5060106@informatik.uni-muenchen.de> (Norbert Eisinger's message of "Wed, 28 Oct 2009 00:03:53 +0100") Message-ID: <8737sds5ly.fsf@gnus.org> 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@gnus.org MailScanner-NULL-Check: 1457246238.44659@sGrHlIMyeyvsC2R45D+sjA X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 4816 Cc: 4816@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Norbert Eisinger 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 28 01:37:55 2016 Received: (at control) by debbugs.gnu.org; 28 Feb 2016 06:37:55 +0000 Received: from localhost ([127.0.0.1]:49474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZuzK-0005qN-T8 for submit@debbugs.gnu.org; Sun, 28 Feb 2016 01:37:55 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:57512) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZuzI-0005qF-Sk for control@debbugs.gnu.org; Sun, 28 Feb 2016 01:37:53 -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 ) id 1aZuys-0004ot-HI for control@debbugs.gnu.org; Sun, 28 Feb 2016 07:37:27 +0100 Date: Sun, 28 Feb 2016 17:37:22 +1100 Message-Id: <871t7xs5lp.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #4816 X-MailScanner-ID: 1aZuys-0004ot-HI X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1457246248.52016@2O7/ig/HTMP+bM8fW7Qtag X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) close 4816 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 28 10:47:14 2016 Received: (at 4816) by debbugs.gnu.org; 28 Feb 2016 15:47:14 +0000 Received: from localhost ([127.0.0.1]:50886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aa3Yw-0006Ac-Cn for submit@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 ) id 1aa3Yu-0006AQ-W9 for 4816@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 ) id 1aa3Yl-0007rZ-OR for 4816@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-reply-to: <8737sds5ly.fsf@gnus.org> (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@informatik.uni-muenchen.de> <8737sds5ly.fsf@gnus.org> 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@informatik.uni-muenchen.de, 4816@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Lars Ingebrigtsen > Date: Sun, 28 Feb 2016 17:37:13 +1100 > Cc: 4816@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. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 28 21:35:48 2016 Received: (at 4816) by debbugs.gnu.org; 29 Feb 2016 02:35:48 +0000 Received: from localhost ([127.0.0.1]:51159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aaDgZ-0008DS-Va for submit@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 ) id 1aaDgY-0008DK-Lf for 4816@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 ) id 1aaDgB-000864-Ra; Mon, 29 Feb 2016 03:35:24 +0100 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#4816: change of coding system without inquiry References: <4AE77C59.5060106@informatik.uni-muenchen.de> <8737sds5ly.fsf@gnus.org> <83ziukalco.fsf@gnu.org> Date: Mon, 29 Feb 2016 13:35:19 +1100 In-Reply-To: <83ziukalco.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 28 Feb 2016 17:46:47 +0200") Message-ID: <87mvqk2qhk.fsf@gnus.org> 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@gnus.org MailScanner-NULL-Check: 1457318124.84538@yeEwrm15+eLUkuXpNi50ow X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 4816 Cc: eisinger@informatik.uni-muenchen.de, 4816@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii 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 From unknown Fri Aug 15 21:26:51 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: Did not alter fixed versions and reopened. Date: Mon, 29 Feb 2016 02:36:02 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # Did not alter fixed versions and reopened. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 27 13:49:41 2019 Received: (at 4816) by debbugs.gnu.org; 27 Jun 2019 17:49:41 +0000 Received: from localhost ([127.0.0.1]:39530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgYWj-0004Mb-1L for submit@debbugs.gnu.org; Thu, 27 Jun 2019 13:49:41 -0400 Received: from quimby.gnus.org ([80.91.231.51]:46196) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgYWg-0004MQ-8Q for 4816@debbugs.gnu.org; Thu, 27 Jun 2019 13:49:39 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hgYWb-0008Gv-Tv; Thu, 27 Jun 2019 19:49:36 +0200 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#4816: change of coding system without inquiry References: <4AE77C59.5060106@informatik.uni-muenchen.de> <4AEAE7F8.6010609@informatik.uni-muenchen.de> Date: Thu, 27 Jun 2019 19:49:33 +0200 In-Reply-To: (Stefan Monnier's message of "Fri, 30 Oct 2009 11:02:49 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: (Bug report about Latin-1 files becoming UTF-8.) Stefan Monnier writes: > + (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 th [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 4816 Cc: Eli Zaretskii , eisinger@informatik.uni-muenchen.de, 4816@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) (Bug report about Latin-1 files becoming UTF-8.) Stefan Monnier writes: > + (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)) Eli Zaretskii writes: > 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. Perhaps it's time to make a decision now -- to not add a change like this? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 27 14:42:31 2019 Received: (at 4816) by debbugs.gnu.org; 27 Jun 2019 18:42:31 +0000 Received: from localhost ([127.0.0.1]:39660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgZLq-000422-HB for submit@debbugs.gnu.org; Thu, 27 Jun 2019 14:42:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgZLn-00041l-H2 for 4816@debbugs.gnu.org; Thu, 27 Jun 2019 14:42:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hgZLY-0000LK-6C; Thu, 27 Jun 2019 14:42:13 -0400 Received: from [176.228.60.248] (port=4031 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hgZLW-0001KA-SO; Thu, 27 Jun 2019 14:42:12 -0400 Date: Thu, 27 Jun 2019 21:41:48 +0300 Message-Id: <83mui2j2fn.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-reply-to: (message from Lars Ingebrigtsen on Thu, 27 Jun 2019 19:49:33 +0200) Subject: Re: bug#4816: change of coding system without inquiry References: <4AE77C59.5060106@informatik.uni-muenchen.de> <4AEAE7F8.6010609@informatik.uni-muenchen.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 4816 Cc: eisinger@informatik.uni-muenchen.de, monnier@iro.umontreal.ca, 4816@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Cc: eisinger@informatik.uni-muenchen.de, 4816@debbugs.gnu.org, Eli Zaretskii > Date: Thu, 27 Jun 2019 19:49:33 +0200 > > > 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. > > Perhaps it's time to make a decision now -- to not add a change like this? I'm still not convinced we need this. But if people think otherwise, we could have an opt-in feature to ask such questions. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 23 07:55:19 2019 Received: (at 4816) by debbugs.gnu.org; 23 Nov 2019 12:55:19 +0000 Received: from localhost ([127.0.0.1]:55910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iYUwX-0006Fo-8f for submit@debbugs.gnu.org; Sat, 23 Nov 2019 07:55:19 -0500 Received: from quimby.gnus.org ([95.216.78.240]:35594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iYUwS-0006FK-AJ for 4816@debbugs.gnu.org; Sat, 23 Nov 2019 07:55:15 -0500 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iYUwH-0005QC-Cb; Sat, 23 Nov 2019 13:55:04 +0100 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#4816: change of coding system without inquiry References: <4AE77C59.5060106@informatik.uni-muenchen.de> <4AEAE7F8.6010609@informatik.uni-muenchen.de> <83mui2j2fn.fsf@gnu.org> Date: Sat, 23 Nov 2019 13:55:00 +0100 In-Reply-To: <83mui2j2fn.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 27 Jun 2019 21:41:48 +0300") Message-ID: <87r21yoiqj.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: >> > 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 tha [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: gnu.org] -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 4816 Cc: eisinger@informatik.uni-muenchen.de, monnier@iro.umontreal.ca, 4816@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> > 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. >> >> Perhaps it's time to make a decision now -- to not add a change like this? > > I'm still not convinced we need this. But if people think otherwise, > we could have an opt-in feature to ask such questions. There was no response to this, so I'm guessing there wasn't much enthusiasm for adding prompting like this, so I'm re-closing this bug report. And as you say: > 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. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 23 07:55:26 2019 Received: (at control) by debbugs.gnu.org; 23 Nov 2019 12:55:26 +0000 Received: from localhost ([127.0.0.1]:55913 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iYUwf-0006G9-Rs for submit@debbugs.gnu.org; Sat, 23 Nov 2019 07:55:26 -0500 Received: from quimby.gnus.org ([95.216.78.240]:35608) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iYUwX-0006FW-8D for control@debbugs.gnu.org; Sat, 23 Nov 2019 07:55:19 -0500 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iYUwP-0005QM-M5 for control@debbugs.gnu.org; Sat, 23 Nov 2019 13:55:11 +0100 Date: Sat, 23 Nov 2019 13:55:08 +0100 Message-Id: <87pnhioiqb.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #4816 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 4816 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 4816 quit From unknown Fri Aug 15 21:26:51 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 22 Dec 2019 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator