From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii 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 03:25:11 -0500 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1294561527 8928 80.91.229.12 (9 Jan 2011 08:25:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 9 Jan 2011 08:25:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: mark.lillibridge@hp.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 09 09:25:23 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 1PbqaZ-0002P0-2U for ged-emacs-devel@m.gmane.org; Sun, 09 Jan 2011 09:25:23 +0100 Original-Received: from localhost ([127.0.0.1]:55939 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbqaY-0005Iy-5S for ged-emacs-devel@m.gmane.org; Sun, 09 Jan 2011 03:25:22 -0500 Original-Received: from [140.186.70.92] (port=36861 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbqaT-0005Ij-5j for emacs-devel@gnu.org; Sun, 09 Jan 2011 03:25:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PbqaS-00052x-4Y for emacs-devel@gnu.org; Sun, 09 Jan 2011 03:25:17 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:40586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PbqaS-00052t-21 for emacs-devel@gnu.org; Sun, 09 Jan 2011 03:25:16 -0500 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1PbqaN-0000GZ-Au; Sun, 09 Jan 2011 03:25:11 -0500 In-reply-to: (message from Mark Lillibridge on Sat, 08 Jan 2011 21:52:27 -0800) 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:134381 Archived-At: > Date: Sat, 08 Jan 2011 21:52:27 -0800 > From: Mark Lillibridge > Reply-To: mark.lillibridge@hp.com > > (with-temp-buffer > ;; Read in the old Rmail file with no decoding. > (let ((coding-system-for-read 'raw-text)) > (insert-file-contents file)) > ;; But make it multibyte. > (set-buffer-multibyte t) > (setq buffer-file-coding-system 'raw-text-unix) > > 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? > My testing so far shows that this problem can be fixed for version > 22 by switching to the Rmail way of doing things (e.g., read unibyte and > only convert to multibyte at the end). A more complicated solution will > be needed for version 23. Should I produce a patch for version 22 given > that it will not work for version 23? 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. Emacs 23.3 is in pretest, so if you hurry, you could get the fix into it (and into all the later versions). Thanks.