From xemacs-m  Wed Jan  1 17:22:19 1997
Received: from venus.Sun.COM (venus.Sun.COM [192.9.25.5])
          by xemacs.cs.uiuc.edu (8.8.4/8.8.4) with SMTP
	  id RAA29187 for <xemacs-beta@xemacs.org>; Wed, 1 Jan 1997 17:22:19 -0600 (CST)
Received: from Eng.Sun.COM ([129.146.1.25]) by venus.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id PAA11295; Wed, 1 Jan 1997 15:21:50 -0800
Received: from kindra.eng.sun.com by Eng.Sun.COM (SMI-8.6/SMI-5.3)
	id PAA21436; Wed, 1 Jan 1997 15:21:47 -0800
Received: from xemacs.eng.sun.com by kindra.eng.sun.com (SMI-8.6/SMI-SVR4)
	id PAA26941; Wed, 1 Jan 1997 15:21:45 -0800
Received: by xemacs.eng.sun.com (SMI-8.6/SMI-SVR4)
	id PAA23094; Wed, 1 Jan 1997 15:21:45 -0800
Date: Wed, 1 Jan 1997 15:21:45 -0800
Message-Id: <199701012321.PAA23094@xemacs.eng.sun.com>
From: Martin Buchholz <mrb@Eng.Sun.COM>
To: Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch>,
        Kyle Jones <kyle_jones@wonderworks.com>,
        MORIOKA Tomohiko <morioka@jaist.ac.jp>
Cc: XEmacs Beta Test <xemacs-beta@xemacs.org>
Subject: Troubles with TM + VM + XEmacs 20.0
Reply-To: Martin Buchholz <mrb@Eng.Sun.COM>
Mime-Version: 1.0 (generated by tm-edit 7.100)
Content-Type: text/plain; charset=US-ASCII

I'm trying to use the TM + VM + tm-vm packages with XEmacs 20.0 to
create a nice Japanese mail-reading environment, and I'm having
troubles.

I can compose and send myself (and others) mail with Mule characters,
both in the headers and the body, successfully, in a *VM-mail* with
MIME-edit buffer.  But then things start to go wrong.

After the mail is sent, there is a
sent mail to xxxx
buffer, which contains the content of the sent message, but with the
encoding characters visible, i.e. I can see the iso2022 escape
sequences in the body and the rfc1522 escape sequence in the headers, 
e.g. =?ISO-2022-JP?B?GyRCPXxAUhsoQg==?=

It would be nice if there was a way of seeing the message the way it
was composed, and this should be the `default view' of the
sent mail to ...
buffer.

When a mime message with japanese characters arrives, it is displayed
properly, both in the inbox and inbox summary buffers.  But when the
message is saved to a folder on disk, the japanese characters in the
body are lost, i.e. converted into `~' characters.  The
rfc1522-encoded Japanese characters in the headers are preserved
intact.  When the folder is visited again, the characters in the body
are (obviously) still `~' characters, but the Japanese characters in
the header readable in the original form, but only in the
*Preview-inbox* buffer.  In the inbox Summary buffer, they are only
visible as `~' characters.  (but they were visible when the same
message was first incorporated into inbox).

I notice that the value of `file-coding-system', which is used in
XEmacs 20.0 when writing files to disk, is set to no-conversion in the
inbox buffer, but set to euc-japan in the inbox summary buffer (the
value in the inbox summary buffer shouldn't matter, since I presume
a folder summary is never saved to disk, just the folder buffer
itself.  The inbox buffer *does* contain japanese characters:

(save-excursion
  (set-buffer "inbox")
  (charsets-in-region (point-min) (point-max)))
(japanese-jisx0208 ascii)


My diagnosis is that when the folder is saved, either
- the mule characters need to be re-encoded into escape sequence form
  before the folder is saved (using no-conversion), or
- the folder must be saved with file-coding-system set to something
  like iso-2022-8

Oscar, do you have any suggestions?

P.S. Oscar, could you change the following things in the tm-vm
package:

- rename tm-vm_en.* to tm-vm-en.*

- Currently tm-vm_en.texi doesn't survive being run through makeinfo,
  because the quote in What's New confuses makeinfo.  A simple fix is
  removing the quote character from the texinfo Node name.

Martin

