From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#22436: read-coding-system uses wrong default when called from write-file Date: Sat, 23 Jan 2016 15:09:39 +0200 Message-ID: <83a8nw5tnw.fsf@gnu.org> References: <83zivx5mwu.fsf@gnu.org> <83vb6k6dqi.fsf@gnu.org> <83h9i45y6o.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1453554625 23622 80.91.229.3 (23 Jan 2016 13:10:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Jan 2016 13:10:25 +0000 (UTC) Cc: 22436@debbugs.gnu.org To: Richard Copley Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 23 14:10:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1aMxxF-0004lt-PW for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jan 2016 14:10:13 +0100 Original-Received: from localhost ([::1]:57272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMxxC-0003W6-0z for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jan 2016 08:10:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMxx8-0003Vp-RQ for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2016 08:10:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMxx4-0002a4-En for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2016 08:10:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41934) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMxx4-0002Zo-C4 for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2016 08:10:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aMxx4-0002Bm-9C for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2016 08:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jan 2016 13:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22436 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22436-submit@debbugs.gnu.org id=B22436.14535545768373 (code B ref 22436); Sat, 23 Jan 2016 13:10:02 +0000 Original-Received: (at 22436) by debbugs.gnu.org; 23 Jan 2016 13:09:36 +0000 Original-Received: from localhost ([127.0.0.1]:58386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMxwe-0002Ax-JY for submit@debbugs.gnu.org; Sat, 23 Jan 2016 08:09:36 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37180) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMxwd-0002Aj-0I for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 08:09:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMxwP-0002NH-J3 for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 08:09:29 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMxwP-0002ND-FE; Sat, 23 Jan 2016 08:09:21 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2203 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aMxwN-0001B1-MU; Sat, 23 Jan 2016 08:09:20 -0500 In-reply-to: (message from Richard Copley on Sat, 23 Jan 2016 11:53:13 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111886 Archived-At: > From: Richard Copley > Date: Sat, 23 Jan 2016 11:53:13 +0000 > Cc: 22436@debbugs.gnu.org > > Thanks for explaining that. I imagined Emacs would use a > heuristic based on the contents of the file. There is indeed a heuristic, but it's not very smart, and only works well when the encoding is blatantly clear. This is an area where improvements are welcome. In any case, when presented with a buffer that includes a single non-ASCII character that can be encoded by a dozen of possible encodings, it's hard to be too smart based on the contents alone. > If there were a fallback ordering that preferred utf-8 or some > other universally applicable coding system it would be easier > for most users and less confusing for beginners. Such a fallback does exist, see coding-system-priority-list. What "M-x prefer-coding-system RET" does is manipulate the priorities so that the encoding you typed is preferred. Do we close this report, or is there something else to do about it? Thanks.