From xemacs-m  Mon Dec  2 00:42:08 1996
Received: from venus.Sun.COM (venus.Sun.COM [192.9.25.5]) by xemacs.cs.uiuc.edu (8.8.3/8.8.3) with SMTP id AAA26539 for <xemacs-beta@xemacs.org>; Mon, 2 Dec 1996 00:42:07 -0600 (CST)
Received: from Eng.Sun.COM ([129.146.1.25]) by venus.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id WAA05446; Sun, 1 Dec 1996 22:41:03 -0800
Received: from kindra.eng.sun.com by Eng.Sun.COM (SMI-8.6/SMI-5.3)
	id WAA26821; Sun, 1 Dec 1996 22:40:59 -0800
Received: from xemacs.eng.sun.com by kindra.eng.sun.com (SMI-8.6/SMI-SVR4)
	id WAA10108; Sun, 1 Dec 1996 22:40:59 -0800
Received: by xemacs.eng.sun.com (SMI-8.6/SMI-SVR4)
	id WAA19812; Sun, 1 Dec 1996 22:40:56 -0800
Date: Sun, 1 Dec 1996 22:40:56 -0800
Message-Id: <199612020640.WAA19812@xemacs.eng.sun.com>
From: Martin Buchholz <mrb@Eng.Sun.COM>
To: Murata Shuuichirou <mrt@mickey.ai.kyutech.ac.jp>
Cc: mule@etl.go.jp, xemacs-beta@xemacs.org, Bob Brewin <brewin@Eng.Sun.COM>,
        Teruhiko Kurosaka <Teruhiko.Kurosaka@Japan.Sun.COM>
Subject: Re: mule API of Emacs and XEmacs (Re: caesar-region) 
In-Reply-To: <19961017143058I/mrt@mickey.ai.kyutech.ac.jp>
References: <199610170721.QAA26100@mikan.jaist.ac.jp>
	<19961017143058I/mrt@mickey.ai.kyutech.ac.jp>
Reply-To: Martin Buchholz <mrb@Eng.Sun.COM>
Mime-Version: 1.0 (generated by tm-edit 7.94)
Content-Type: text/plain; charset=US-ASCII

>>>>> "Murata" == Murata Shuuichirou <mrt@mickey.ai.kyutech.ac.jp> writes:

Murata> Now, I think coding-system-alist should be as follows:

Murata> *Alist of elements
Murata> (REGEXP OPERATION CODING-SYSTEM-FOR-READ [CODING-SYSTM-FOR-WRITE
Murata> [CODING-SYSTEM-FOR-PROCESS-ARGUMENTS]]).

Murata> If a target of I/O primitive operation OPERATION matches REGEXP,
Murata> CODING-SYSTEM is used for the OPERATION.

Murata> TARGET varies depending on OPERATION as follows:
Murata> 	OPERATION		TARGET
Murata> 	---------		------
Murata> 	file			name of a file to be inserted or to be
Murata> written
Murata> 	process			name of a program to be called
Murata> 	network			name of a service for the network stream

Murata> file: write-region, insert-file-contents
Murata> process: start-process, call-process, call-process-region
Murata> network: open-network-stream

This is an interesting proposal.  Some observations:

I would prefer to see separate alists for each of the different kinds
of operations, if only for performance reasons - they are logically
separate.  coding-system-for-process-arguments is only used with
process operations.

Most of the time, one wants to use the same coding-system for
process-arguments as for pathnames, since the most common kind of
process argument is a pathname, and in particular argv[0] is always a
pathname.

For file operations, one would almost always want
coding-system-for-write to match whatever was used when reading the
file.  If coding-system-for-read and coding-system-for-write were
different, then files would be saved in a different form after
editing.

I'm not sure how useful coding-system-alist will be for process
operations.  Typically I would like interactive shells to be run with
coding-system-for-read and coding-system-for-write set to the
`natural' coding-system for that OS, but it's hard to come up with a
regexp that will match all possible names of shells.  I predict that
having shell mode use a particular coding system will be best solved
by using code run from shell-mode, e.g. in shell-mode-hook, as
implemented in XEmacs 20.0.

The most recent XEmacs 20.0 has a variable `pathname-coding-system'
and that is used to decode the filename of file operations and the
arguments of process operations (including the xemacs process itself).
It is not obvious how mule handles file and directory names encoded in
some coding system (typically the one supported by the OS,
e.g. euc-japan on Solaris 2) - is this capability not implemented, or
am I missing something?

Martin

