From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master db828f6: Don't rely on defaults in decoding UTF-8 encoded Lisp files Date: Fri, 25 Sep 2015 08:21:59 -0400 Message-ID: References: <20150921165211.20434.28114@vcs.savannah.gnu.org> <83fv27mt7r.fsf@gnu.org> <83wpvfix7i.fsf@gnu.org> <83fv23hr0z.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1443183772 15186 80.91.229.3 (25 Sep 2015 12:22:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Sep 2015 12:22:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 25 14:22:44 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZfS19-0001RZ-T8 for ged-emacs-devel@m.gmane.org; Fri, 25 Sep 2015 14:22:24 +0200 Original-Received: from localhost ([::1]:35534 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfS19-00011A-Aw for ged-emacs-devel@m.gmane.org; Fri, 25 Sep 2015 08:22:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfS0t-00010r-GF for emacs-devel@gnu.org; Fri, 25 Sep 2015 08:22:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfS0s-0000dZ-LY for emacs-devel@gnu.org; Fri, 25 Sep 2015 08:22:07 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:49269) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfS0n-0000aU-6A; Fri, 25 Sep 2015 08:22:01 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CZDQA731xV/2yixEVcgxCEAk7AR4dLBAICgTw6EwEBAQEBAQGBCkEFg10BAQMBIzMjBQsJAhoCGA4CAhQYDSSINwiNfJ0QpBcBAQEBBgIBH4EhihmFBQeCaIFFBbM/gUUjYYFagVkigngBAQE X-IPAS-Result: A0CZDQA731xV/2yixEVcgxCEAk7AR4dLBAICgTw6EwEBAQEBAQGBCkEFg10BAQMBIzMjBQsJAhoCGA4CAhQYDSSINwiNfJ0QpBcBAQEBBgIBH4EhihmFBQeCaIFFBbM/gUUjYYFagVkigngBAQE X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="165823365" Original-Received: from 69-196-162-108.dsl.teksavvy.com (HELO ceviche.home) ([69.196.162.108]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 25 Sep 2015 08:21:59 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 19ED066161; Fri, 25 Sep 2015 08:21:59 -0400 (EDT) In-Reply-To: <83fv23hr0z.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 25 Sep 2015 10:55:24 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:190344 Archived-At: > E.g., try saving a foo.el with the following contents: > > (setq string "=D7=90=E2=80=9C=E2=80=9D") > > using cp1255, then kill the buffer and visit it again. AFAIK saving in this way requires very explicit action on the part of the user. She gets what she asked for. But yes, we should probably make it even harder (i.e. disallow it altogether as long as there's no "coding:cp1255" tag). > So we now agree that at least non-*.el files should have the coding > cookie, yes? Yes, definitely. > Bottom line: we use prefer-utf-8 for *.el files so that the > probability of such catastrophic errors be minimized when the lazy > maintainers couldn't be bothered to add a cookie. No. I pushed for prefer-utf-8 because I want Elisp source code to be declared to use utf-8 encoding. I can imagine a future where we don't even support Elisp files using another coding system (i.e. throw away the load-with-code-conversion machinery). > More generally, I think we should require any text file in the Emacs > repository that includes non-ASCII characters to have an explicit > coding cookie, so that these subtle problems don't lie low because > most Emacs contributors live in UTF-8 locales. My view OTOH is that the future is utf-8 only, and in that future we won't want to have redundant "coding:utf-8" tags everywhere, so we need to find ways to go from here (i.e. "need a coding: tag for any non-ASCII file") to there. I don't have an answer in general, but prefer-utf-8 is a step in that direction, which can be used for some class of files (e.g. Elisp). Stefan