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 05:01:48 -0500 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1294567333 29664 80.91.229.12 (9 Jan 2011 10:02:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 9 Jan 2011 10:02:13 +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 11:02:05 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 1Pbs66-0003Yy-3P for ged-emacs-devel@m.gmane.org; Sun, 09 Jan 2011 11:02:02 +0100 Original-Received: from localhost ([127.0.0.1]:42755 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pbs65-00088q-0h for ged-emacs-devel@m.gmane.org; Sun, 09 Jan 2011 05:02:01 -0500 Original-Received: from [140.186.70.92] (port=43711 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pbs5y-00088j-Aw for emacs-devel@gnu.org; Sun, 09 Jan 2011 05:01:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pbs5w-0006eA-HI for emacs-devel@gnu.org; Sun, 09 Jan 2011 05:01:54 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:45441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pbs5w-0006e5-FX for emacs-devel@gnu.org; Sun, 09 Jan 2011 05:01:52 -0500 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1Pbs5s-0000qc-62; Sun, 09 Jan 2011 05:01:48 -0500 In-reply-to: (message from Eli Zaretskii on Sun, 09 Jan 2011 03:25:11 -0500) 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:134384 Archived-At: > From: Eli Zaretskii > Date: Sun, 09 Jan 2011 03:25:11 -0500 > Cc: emacs-devel@gnu.org > Reply-To: Eli Zaretskii > > > 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? Answering my own question here: yes, it does. Here's the relevant portion of insert-file-contents from the current development sources: if (!NILP (visit)) { /* When we visit a file by raw-text, we change the buffer to unibyte. */ if (CODING_FOR_UNIBYTE (&coding) /* Can't do this if part of the buffer might be preserved. */ && NILP (replace)) /* Visiting a file with these coding system makes the buffer unibyte. */ current_buffer->enable_multibyte_characters = Qnil; } The current sources of the Emacs 23.3 release branch have the same code. So I would expect this problem not to exist in Emacs 23 and later. If it does exist, then probably there's some other factor at work here.