From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Lillibridge Newsgroups: gmane.emacs.devel Subject: Re: why unrmail fails with raw-text on version 22 [WAS: Re: help needed with coding systems (unrmail problems)] Date: Sun, 09 Jan 2011 10:41:38 -0800 Message-ID: References: Reply-To: mark.lillibridge@hp.com NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1294598516 4380 80.91.229.12 (9 Jan 2011 18:41:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 9 Jan 2011 18:41:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 09 19:41:52 2011 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.69) (envelope-from ) id 1Pc0D8-0006QM-Pw for ged-emacs-devel@m.gmane.org; Sun, 09 Jan 2011 19:41:50 +0100 Original-Received: from localhost ([127.0.0.1]:44149 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pc0D8-0007KY-D0 for ged-emacs-devel@m.gmane.org; Sun, 09 Jan 2011 13:41:50 -0500 Original-Received: from [140.186.70.92] (port=40857 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pc0D4-0007KS-1A for emacs-devel@gnu.org; Sun, 09 Jan 2011 13:41:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pc0D2-0004jw-IT for emacs-devel@gnu.org; Sun, 09 Jan 2011 13:41:45 -0500 Original-Received: from gundega.hpl.hp.com ([192.6.19.190]:57490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pc0D2-0004jh-64; Sun, 09 Jan 2011 13:41:44 -0500 Original-Received: from mailhub-pa1.hpl.hp.com (mailhub-pa1.hpl.hp.com [15.25.115.25]) by gundega.hpl.hp.com (8.14.3/8.14.3/HPL-PA Relay) with ESMTP id p09IfeUZ017795 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 9 Jan 2011 10:41:40 -0800 Original-Received: from ts-rhel5 (ts-rhel5.hpl.hp.com [15.25.118.27]) by mailhub-pa1.hpl.hp.com (8.14.3/8.14.3/HPL-PA Hub) with ESMTP id p09IfcUn020564; Sun, 9 Jan 2011 10:41:38 -0800 In-reply-to: (message from Eli Zaretskii on Sun, 9 Jan 2011 03:25:11 -0500) X-Scanned-By: MIMEDefang 2.69 on 15.0.48.190 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:134388 Archived-At: Eli wrote: > I (Mark) wrote: > > Not obvious, but important: with-temp-buffer creates a multibyte buffer > > so that insert-file-contents is decoding from raw-text to a multibyte > > buffer, producing raw 8-bit bytes for x80-xff. > > But doesn't insert-file-contents make the buffer unibyte due to the > fact that raw-text is being used for decoding? I looked again at the source code of unrmail, and it does not call insert-file-contents with visit set, hence the buffer still being multibyte. If the author had done so and also specified replace (see your excerpted source code fragment), presumably the buffer would have been converted to unibyte. There would still have been a bug because the author also had code to convert to multibyte before doing decoding. > Version 22 is no longer maintained, so providing patches for it would > be pointless, especially as Emacs 23 has fundamentally changed the way > raw bytes are represented and handled. Ok. > Emacs 23.3 is in pretest, so if you hurry, you could get the fix into > it (and into all the later versions). Building a fix for version 23 is trickier. We need to decode the output of version 22's raw-text into the new buffer internal representation. Can we use emacs-mule for this purpose? Is it true that decoding an arbitrary byte stream and then writing it out via emacs-mule (version 23) produces exactly the same byte sequence? - Mark