From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: What does `undecided' do for encoding text? Date: Tue, 10 Feb 2009 20:16:53 +0900 Message-ID: References: NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1234264636 1610 80.91.229.12 (10 Feb 2009 11:17:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Feb 2009 11:17:16 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 10 12:18:31 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LWqdK-0004gT-51 for ged-emacs-devel@m.gmane.org; Tue, 10 Feb 2009 12:18:30 +0100 Original-Received: from localhost ([127.0.0.1]:36213 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LWqc0-0006mV-En for ged-emacs-devel@m.gmane.org; Tue, 10 Feb 2009 06:17:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LWqbv-0006mD-08 for emacs-devel@gnu.org; Tue, 10 Feb 2009 06:17:03 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LWqbt-0006lj-Rt for emacs-devel@gnu.org; Tue, 10 Feb 2009 06:17:02 -0500 Original-Received: from [199.232.76.173] (port=41269 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LWqbt-0006le-No for emacs-devel@gnu.org; Tue, 10 Feb 2009 06:17:01 -0500 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:49834) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LWqbq-00012Z-7K; Tue, 10 Feb 2009 06:16:58 -0500 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id n1ABGs3W002386; Tue, 10 Feb 2009 20:16:54 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp1.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id n1ABGs7U012659; Tue, 10 Feb 2009 20:16:54 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp1.aist.go.jp with ESMTP id n1ABGp3Z000799; Tue, 10 Feb 2009 20:16:51 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1LWqbl-0006Ox-Rx; Tue, 10 Feb 2009 20:16:53 +0900 In-reply-to: (message from Eli Zaretskii on Tue, 10 Feb 2009 11:22:15 +0200) X-detected-operating-system: by monty-python.gnu.org: Solaris 9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:108949 Archived-At: In article , Eli Zaretskii writes: > > I don't think so because it is just a fallback behavior, and > > Elisp programmer should avoid specifying `undecided' on > > encoding. > This may have nothing to do with what the programmer did. My use case > was in Rmail: if the original message had non-ASCII text encoded with > QP or B64, Rmail would (correctly) return `undecided' when it detects > the message encoding. Suppose you then edit the message and add > non-ASCII characters as raw bytes, e.g. by base64-decode-region, and > type "C-c C-c". rmail-cease-edit now needs to encode the text and put > it back into the mbox buffer, and the immediate choice it has for the > pertinent coding-system is to use buffer-file-coding-system of the > buffer where the message was edited. But the value of > buffer-file-coding-system in that buffer is `undecided'... The situation is the same as visiting an ASCII only file, entering some non-ASCII characters, and saving it. In that case, we use selecte-safe-coding-system to decide the coding system to encode the buffer contents. As I wrote before, rmail-cease-edit should do the same or the similar thing. > If you say that using `undecided' in encoding is ``considered > harmful'', we should at least say that in the ELisp manual. Although > in the use case I described `undecided' did exactly what's right, and > the only other correct choice is `raw-text'. For a buffer that contains raw bytes, `raw-text' is the only correct choice. --- Kenichi Handa handa@m17n.org