Commits

Anonymous committed e38873c

Created

  • Participants
  • Tags xemacs

Comments (0)

Files changed (19)

+1998-01-11  SL Baur  <steve@altair.xemacs.org>
+
+	* Makefile: Update to newest package interface.
+
+1998-01-02  SL Baur  <steve@altair.xemacs.org>
+
+	* Makefile: Update to new package interface.
+
+1997-07-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.44 was released.
+	* APEL: Version 3.4 was released.
+
+1997-07-13  MORIOKA Tomohiko  <morioka@mousai>
+
+	* std11-parse.el (std11-parse-ascii-token): Allow non-ASCII
+ 	characters in comments.
+
+1997-06-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* file-detect.el: Add autoload comments for function `add-path',
+	`add-latest-path', `get-latest-path', `file-installed-p',
+	`exec-installed-p', `module-installed-p' and variable
+	`exec-suffix-list'.
+
+Sat May 10 19:39:12 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* README.en (What's APEL?): Add std11 and mule-caesar.el.
+
+
+1997-05-09  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.43.1 was released.
+	* APEL: Version 3.3.2 was released.
+
+Fri May  9 01:23:44 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* APEL-ELS: Add mule-caesar.el.
+
+	* mule-caesar.el: New file.
+
+
+1997-04-30  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.43 was released.
+	* APEL: Version 3.3.1 was released.
+
+Wed Apr 30 12:40:32 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* Makefile: add `release'.
+
+Mon Apr 28 16:47:30 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* Makefile: `TARFILE' was abolished.
+
+Thu Apr  3 17:14:39 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* APEL-ELS: std11.el and std11-parse.el were moved from mu/.
+
+
+1997-03-20  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* APEL: Version 3.3 was released.
+	
+	* APEL-CFG (EMU_PREFIX, EMU_DIR): New variables.
+	* APEL-MK: install emu.
+
+Thu Mar 20 06:09:03 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* Makefile: Add README.en.
+
+Thu Mar 20 06:08:29 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* file-detect.el: Header and DOC-strings were modified.
+
+Thu Mar 20 06:03:51 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* README.en: New file.
+
+Thu Mar 20 05:48:02 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* filename.el: Add DOC-strings.
+
+	* APEL-MK (install-apel): Use `compile-apel'.
+
+	* Makefile (install): Don't depend on `elc'.
+
+Thu Mar 20 02:04:19 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* APEL-MK: Setting for load-path and requiring install were moved
+ 	from APEL-CFG.
+
+	(install-apel): Compile apel-modules.
+
+	* APEL-CFG: Setting for load-path and requiring install were moved
+ 	to APEL-MK.
+
+
+1997-03-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* APEL: Version 3.2 was released.
+
+Fri Mar 14 09:54:04 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* file-detect.el (get-latest-path): Check directory is exist or not.
+
+Fri Mar 14 09:25:15 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* APEL-ELS: Add install.el.
+
+Fri Mar 14 07:24:37 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* Makefile, APEL-MK, APEL-CFG: New file.
+
+1997-03-10  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* atype.el (field-unify): fixed.
+
+1997-03-10  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* filename.el (filename-filters): Use `exec-installed-p' instead
+ 	of `file-installed-p' to search "kakasi".
+
+1997-03-10  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* file-detect.el (module-installed-p): Use function
+ 	`exec-installed-p'.
+
+	* file-detect.el (exec-suffix-list): New variable.
+	(exec-installed-p): New function.
+
+1997-03-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* APEL-ELS (apel-modules): Add filename.el.
+
+	* APEL-ELS: Initial revision
+
+1997-03-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* filename.el (filename-replacement-alist): Don't use function
+ 	`string-to-char-list' and `expand-char-ranges'; Don't require
+ 	tl-str.
+	(filename-special-filter): Use function `assoc-if' instead of
+ 	`ASSOC'; Require cl instead of tl-list.
+	(poly-funcall): New inline-function; copied from tl-list.el.
+
+1997-03-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* atype.el: Alias `fetch-field', `fetch-field-value', `put-field'
+ 	and `delete-field' were abolished.
+
+	Don't require tl-str and tl-list.
+
+	Require alist.
+
+	(field-unify): Don't use function `symbol-concat'.
+	(assoc-unify): Use function `assoc' directly; use function
+ 	`put-alist' directly; use function `del-alist' directly.
+
+	* atype.el: Function `put-fields' was abolished.
+
+	* atype.el: tl-atype.el was renamed to atype.el.
+
+1997-03-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* atype.el: tl-atype.el was renamed to atype.el.
+
+1997-03-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* file-detect.el (file-installed-p): Fixed DOC-string.
+
+1997-02-28  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>
+
+	* alist.el: New module; separated from tl-list.el.
+1997-08-25  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-x20.el (mime-charset-coding-system-alist): iso-2022-jp-2 is
+	defined as coding-system.
+
+
+1997-07-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.44 was released.
+
+1997-07-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-e20.el (mime-charset-coding-system-alist): `iso-2022-ss2-7'
+	-> `iso-2022-7bit-ss2'. (for Emacs 20.0.90)
+
+1997-06-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* richtext.el: Add autoload comments for `richtext-encode' and
+	`richtext-decode'.
+
+	* emu.el: Check richtext.el is bundled.
+
+1997-06-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-x20.el (mime-charset-coding-system-alist): iso-8859-1,
+	hz-gb-2312, cn-gb-2312, gb2312, cn-big5 and koi8-r were defined as
+	coding-system.
+
+	* emu-x20.el: Don't require cyrillic.
+
+Thu May 22 04:46:57 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-mule.el (make-char): New alias.
+
+	* emu-e20.el: Alias `make-character' was abolished.
+
+
+1997-05-09  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.43.1 was released.
+
+Thu May  8 22:21:36 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-x20.el: Use `binary' instead of `no-conversion' temporary.
+
+
+1997-04-30  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.43 was released.
+
+	* emu-x20.el: several changes for XEmacs 20.1-b12.
+
+Tue Apr  8 09:47:40 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu.el (point-at-eol): New function.
+
+Sat Apr  5 16:23:23 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-nemacs.el: `tl:available-face-attribute-alist' ->
+	`emu:available-face-attribute-alist'.
+
+	* emu-nemacs.el, emu-mule.el: `tl:make-overlay' -> `make-overlay';
+ 	`tl:overlay-put' -> `overlay-put'.
+
+Sat Apr  5 06:50:48 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-xemacs.el: Alias `tl:make-overlay', `tl:overlay-put' and
+ 	`tl:overlay-buffer' were abolished; Function `tl:move-overlay'
+ 	were abolished.
+
+	* emu-19.el: Alias `tl:make-overlay', `tl:overlay-put' and
+ 	`tl:overlay-buffer' were abolished.
+
+	* emu-18.el: `tl:overlay-buffer' -> `overlay-buffer'.
+
+	* emu-xemacs.el: Require overlay.
+
+	* emu.el (char-or-char-int-p): New XEmacs 20 emulating alias.
+
+	* emu.el (minibuffer-prompt-width): New function for Emacs 18 and
+ 	XEmacs.
+
+
+1997-03-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.40.1 was released.
+
+Fri Mar 14 07:19:59 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* Makefile, EMU-MK: New file.
+
+	* EMU-ELS: rearrangement.
+
+	* EMU-CFG: New file
+
+Wed Mar 12 14:18:27 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-x20.el: Modified for changing XEmacs/mule API about
+ 	`file-coding-system' -> `buffer-file-coding-system'.
+
+
+1997-03-10  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.40 was released.
+
+	* emu-x20.el (as-binary-process, as-binary-output-file): Use
+	`coding-system-for-write' instead of `file-coding-system'.
+
+	(as-binary-input-file, insert-binary-file-contents-literally): Use
+ 	`coding-system-for-read' instead of `file-coding-system-for-read'.
+
+	* emu-e20.el (mime-charset-coding-system-alist): Delete
+ 	`iso-2022-int-1' and `shift_jis'.
+
+1997-03-06  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu.el (defmacro-maybe): New macro.
+	(save-selected-window): Use `defmacro-maybe'.
+
+	* emu-18.el (defsubst): New macro.
+
+1997-03-06  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-x20.el: Constant `*ctext*', `*hz*', `*big5', `*euc-kr*' and
+ 	`*koi8*' were abolished.
+
+1997-03-06  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-19.el: Alias `tl:add-text-properties' was abolished.
+
+	* emu-18.el, emu-xemacs.el: Function `tl:add-text-properties' was
+ 	abolished.
+
+1997-03-06  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu.el (buffer-substring-no-properties): Use
+ 	`set-text-properties' instead of `tl:set-text-properties'.
+
+	* emu-19.el: Alias `tl:set-text-properties' was abolished.
+
+	* emu-18.el, emu-xemacs.el: Function `tl:set-text-properties' was
+ 	abolished.
+
+1997-03-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-19.el (find-face): New function.
+
+
+1997-03-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.38.1 was released.
+
+1997-03-03  Oscar Figueiredo  <Oscar.Figueiredo@di.epfl.ch>
+
+	* emu-xemacs.el (tl:add-text-properties): In tm-ew-d.el, the
+ 	function mime/decode-encoded-word calls tl:add-text-properties
+ 	with 4 parameters while it is defined in emu-xemacs.el to take 3
+ 	parameters only. (cf. [bug-tm-en:1246])
+
+
+1997-02-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.38 was released.
+
+	* emu.el: Function `insert-binary-file-contents-literally' was
+ 	moved to emu-{nemacs|e19|mule|x20|e20}.el.
+
+	* emu-x20.el, emu-e20.el, emu-mule.el, emu-e19.el, emu-nemacs.el
+ 	(insert-binary-file-contents-literally): New function; moved from
+ 	emu.el.
+
+
+1997-02-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.37.7 was released.
+
+1997-02-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-x20.el: Variable `xemacs-beta-version' was abolished.
+
+1997-02-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-x20.el (as-binary-process): Variable `file-coding-system' is
+ 	effective for `call-process-region'.
+
+
+1997-01-31  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.37.6 was released.
+
+Thu Jan 30 16:55:00 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* richtext.el (richtext-decode): Variable
+ 	`enriched-fill-after-visiting' is not found in enriched.el bundled
+ 	in Emacs 19.34.91-delta.
+
+
+1997-01-30  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.37.5 was released.
+
+Wed Jan 29 15:48:26 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-x20.el, emu-e20.el, emu-e19.el, emu-mule.el, emu-nemacs.el
+ 	(as-binary-output-file): New macro.
+
+Mon Jan 27 12:11:32 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-e20.el (mime-charset-coding-system-alist): Modified for GNU
+ 	MULE 19.34.91-delta.
+  	(mime-charset-to-coding-system): Modified for GNU MULE
+ 	19.34.91-delta.
+
+
+1997-01-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.37.4 was released.
+
+Sat Jan 18 09:44:43 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-x20.el (charsets-mime-charset-alist): Sync with emu-e20.el
+ 	7.9.
+	(default-mime-charset): Default was changed to `x-ctext'.
+	(mime-charset-coding-system-alist): Add `x-ctext', `hz-gb-2312',
+ 	`cn-gb-2312' and `cn-big5'; `x-iso-2022-jp-2' and `x-shiftjis' was
+ 	abolished.
+
+Sat Jan 18 09:35:35 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-e20.el: Function `regulate-latin-char' and
+ 	`regulate-latin-string' were abolished.
+
+	* emu-e20.el (sset): Function `string-embed-string' was renamed to
+ 	`store-substring'.
+
+Wed Jan 15 18:01:13 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-e20.el (fontset-pixel-size): modified for GNU MULE 19.34.91.
+
+Wed Jan 15 16:42:47 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-e20.el: Alias `charset-columns' was abolished.
+	Function `charset-iso-class' was abolished.
+
+	* emu-e20.el: for GNU MULE 19.34.91.
+
+Tue Jan 14 06:35:53 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-x20.el: Alias `charset-description', `find-charset-string',
+ 	`find-charset-region', `char-width', `string-width' and `sref' has
+ 	been defined in XEmacs/mule.
+
+	Function `find-non-ascii-charset-string',
+ 	`find-non-ascii-charset-region', `char-bytes', `char-length',
+ 	`char-columns', `string-columns' and `truncate-string' has been
+ 	defined in XEmacs/mule.
+
+
+Mon Dec 23 14:56:40 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.37.3 was released.
+
+Wed Dec 18 13:12:15 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-e20.el (as-binary-process): Fixed.
+
+
+Mon Dec 16 14:57:02 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.37.2 was released.
+
+Thu Dec 12 02:29:18 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-e20.el: Header was modified.
+
+
+Tue Dec 10 14:41:46 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.37.1 was released.
+
+	* emu-e19.el: `charset-latin-1' -> `charset-latin-iso8859-1'.
+
+	* emu-e19.el: Constants to emulate MULE 2.3 leading-char were
+ 	abolished.
+	(find-charset-string, find-charset-region): Use constant
+ 	`charset-latin-1' instead of `lc-ltn1'.
+
+Sat Dec  7 06:07:15 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-x20.el: Constants to emulate MULE 2.3 leading-char were
+ 	abolished.
+
+	* emu-x20.el: Sync with patch about charset naming rule
+ 	(cf. [xemacs-beta:91])
+
+Thu Dec  5 15:15:39 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-x20.el: Sync with XEmacs 20.0 b30.
+
+
+Wed Dec  4 04:55:36 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.37 was released.
+
+Fri Nov 29 21:22:25 1996  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>
+
+	* emu.el (match-string): New function for Emacs 19.28 or earlier.
+
+Thu Nov 28 19:25:12 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* richtext.el (richtext-decode): Unused local variable `nc' was
+ 	abolished.
+
+	* richtext.el (richtext-decode): Unused local variable `pc' was
+ 	abolished.
+
+Thu Nov 28 19:16:18 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu.el (defun-maybe): New macro.
+	(buffer-substring-no-properties, add-to-list, buffer-live-p,
+ 	functionp): Use macro `defun-maybe' instead of `sysdep-defun'.
+
+	* emu-xemacs.el: Don't use sysdep.el.
+
+	* emu-18.el, emu-19.el: Function `sysdep-defun' was abolished.
+
+Thu Nov 28 18:02:42 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu.el (buffer-substring-no-properties, add-to-list,
+ 	buffer-live-p, functionp): Use `sysdep-defun'.
+
+Thu Nov 28 17:59:45 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-xemacs.el: Use sysdep.el.
+
+	* emu-19.el, emu-18.el (sysdep-defun): New macro.
+
+Wed Nov 27 13:40:42 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-e20.el (fontset-pixel-size): Renamed from
+ 	`fontset-pixel-height'.
+
+
+Sat Nov 16 08:37:04 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu: Version 7.34 was released.
+
+Fri Nov 15 13:59:53 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* emu-xemacs.el: Redefine `file-relative-name' if it is broken.
+
+	* EMU-ELS: New file.
+# Makefile for XEmacs base lisp code
+
+# This file is part of XEmacs.
+
+# XEmacs is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2, or (at your option) any
+# later version.
+
+# XEmacs is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with XEmacs; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+VERSION = 1.02
+PACKAGE = apel
+PKG_TYPE = regular
+REQUIRES = xemacs-base
+CATEGORY = libs
+
+ELCS = atype.elc emu-e19.elc emu-20.elc emu-x20.elc \
+	emu-xemacs.elc emu.elc file-detect.elc filename.elc install.elc \
+	mule-caesar.elc path-util.elc richtext.elc std11-parse.elc \
+	std11.elc tinyrich.elc
+
+include ../../XEmacs.rules
+
+all:: $(ELCS) auto-autoloads.elc
+
+srckit: srckit-std
+
+binkit: binkit-sourceonly
+;;; atype.el --- atype functions
+
+;; Copyright (C) 1994,1995,1996,1997 Free Software Foundation, Inc.
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Version: $Id$
+;; Keywords: atype
+
+;; This file is part of APEL (A Portable Emacs Library).
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Code:
+
+(require 'emu)
+(require 'alist)
+
+
+;;; @ field unifier
+;;;
+
+(defun field-unifier-for-default (a b)
+  (let ((ret
+	 (cond ((equal a b)    a)
+	       ((null (cdr b)) a)
+	       ((null (cdr a)) b)
+	       )))
+    (if ret
+	(list nil ret nil)
+      )))
+
+(defun field-unify (a b)
+  (let ((f
+	 (let ((type (car a)))
+	   (and (symbolp type)
+		(intern (concat "field-unifier-for-" (symbol-name type)))
+		))))
+    (or (fboundp f)
+	(setq f (function field-unifier-for-default))
+	)
+    (funcall f a b)
+    ))
+
+
+;;; @ type unifier
+;;;
+
+(defun assoc-unify (class instance)
+  (catch 'tag
+    (let ((cla (copy-alist class))
+	  (ins (copy-alist instance))
+	  (r class)
+	  cell aret ret prev rest)
+      (while r
+	(setq cell (car r))
+	(setq aret (assoc (car cell) ins))
+	(if aret
+	    (if (setq ret (field-unify cell aret))
+		(progn
+		  (if (car ret)
+		      (setq prev (put-alist (car (car ret))
+					    (cdr (car ret))
+					    prev))
+		    )
+		  (if (nth 2 ret)
+		      (setq rest (put-alist (car (nth 2 ret))
+					    (cdr (nth 2 ret))
+					    rest))
+		    )
+		  (setq cla (put-alist (car cell)(cdr (nth 1 ret)) cla))
+		  (setq ins (del-alist (car cell) ins))
+		  )
+	      (throw 'tag nil)
+	      ))
+	(setq r (cdr r))
+	)
+      (setq r (copy-alist ins))
+      (while r
+	(setq cell (car r))
+	(setq aret (assoc (car cell) cla))
+	(if aret
+	    (if (setq ret (field-unify cell aret))
+		(progn
+		  (if (car ret)
+		      (setq prev (put-alist (car (car ret))
+					    (cdr (car ret))
+					    prev))
+		    )
+		  (if (nth 2 ret)
+		      (setq rest (put-alist (car (nth 2 ret))
+					    (cdr (nth 2 ret))
+					    rest))
+		    )
+		  (setq cla (del-alist (car cell) cla))
+		  (setq ins (put-alist (car cell)(cdr (nth 1 ret)) ins))
+		  )
+	      (throw 'tag nil)
+	      ))
+	(setq r (cdr r))
+	)
+      (list prev (append cla ins) rest)
+      )))
+
+(defun get-unified-alist (db al)
+  (let ((r db) ret)
+    (catch 'tag
+      (while r
+	(if (setq ret (nth 1 (assoc-unify (car r) al)))
+	    (throw 'tag ret)
+	  )
+	(setq r (cdr r))
+	))))
+
+
+;;; @ utilities
+;;;
+
+(defun delete-atype (atl al)
+  (let* ((r atl) ret oal)
+    (setq oal
+	  (catch 'tag
+	    (while r
+	      (if (setq ret (nth 1 (assoc-unify (car r) al)))
+		  (throw 'tag (car r))
+		)
+	      (setq r (cdr r))
+	      )))
+    (delete oal atl)
+    ))
+
+(defun remove-atype (sym al)
+  (and (boundp sym)
+       (set sym (delete-atype (eval sym) al))
+       ))
+
+(defun replace-atype (atl old-al new-al)
+  (let* ((r atl) ret oal)
+    (if (catch 'tag
+	  (while r
+	    (if (setq ret (nth 1 (assoc-unify (car r) old-al)))
+		(throw 'tag (rplaca r new-al))
+	      )
+	    (setq r (cdr r))
+	    ))
+	atl)))
+
+(defun set-atype (sym al &rest options)
+  (if (null (boundp sym))
+      (set sym al)
+    (let* ((replacement (memq 'replacement options))
+	   (ignore-fields (car (cdr (memq 'ignore options))))
+	   (remove (or (car (cdr (memq 'remove options)))
+		       (let ((ral (copy-alist al)))
+			 (mapcar (function
+				  (lambda (type)
+				    (setq ral (del-alist type ral))
+				    ))
+				 ignore-fields)
+			 ral)))
+	   )
+      (set sym
+	   (or (if replacement
+		   (replace-atype (eval sym) remove al)
+		 )
+	       (cons al
+		     (delete-atype (eval sym) remove)
+		     )
+	       )))))
+
+
+;;; @ end
+;;;
+
+(provide 'atype)
+
+;;; atype.el ends here
+;;; emu-20.el --- emu API implementation for Emacs 20 and XEmacs/mule
+
+;; Copyright (C) 1997 Free Software Foundation, Inc.
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Version: $Id$
+;; Keywords: emulation, compatibility, Mule
+
+;; This file is part of emu.
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;;    This module requires Emacs 20.0.93, XEmacs 20.3-b5 (with mule)
+;;    or later.
+
+;;; Code:
+
+(require 'custom)
+
+
+;;; @ binary access
+;;;
+
+(defmacro as-binary-process (&rest body)
+  `(let (selective-display	; Disable ^M to nl translation.
+	 (coding-system-for-read  'binary)
+	 (coding-system-for-write 'binary))
+     ,@body))
+
+(defmacro as-binary-input-file (&rest body)
+  `(let ((coding-system-for-read 'binary))
+     ,@body))
+
+(defmacro as-binary-output-file (&rest body)
+  `(let ((coding-system-for-write 'binary))
+     ,@body))
+
+(defun insert-binary-file-contents-literally
+  (filename &optional visit beg end replace)
+  "Like `insert-file-contents-literally', q.v., but don't code conversion.
+A buffer may be modified in several ways after reading into the buffer due
+to advanced Emacs features, such as file-name-handlers, format decoding,
+find-file-hooks, etc.
+  This function ensures that none of these modifications will take place."
+  (let ((coding-system-for-read 'binary))
+    (insert-file-contents-literally filename visit beg end replace)
+    ))
+
+;;; @@ Mule emulating aliases
+;;;
+;;; You should not use it.
+
+(defconst *noconv* 'binary
+  "Coding-system for binary.
+This constant is defined to emulate old MULE anything older than MULE
+2.3.  It is obsolete, so don't use it.")
+
+
+;;; @ MIME charset
+;;;
+
+(defvar mime-charset-coding-system-alist
+  `,(let ((rest
+	   '((us-ascii      . iso-8859-1)
+	     (gb2312	    . cn-gb-2312)
+	     (iso-2022-jp-2 . iso-2022-7bit-ss2)
+	     (x-ctext       . ctext)
+	     ))
+	  dest)
+      (while rest
+	(let ((pair (car rest)))
+	  (or (find-coding-system (car pair))
+	      (setq dest (cons pair dest))
+	      ))
+	(setq rest (cdr rest))
+	)
+      dest)
+  "Alist MIME CHARSET vs CODING-SYSTEM.
+MIME CHARSET and CODING-SYSTEM must be symbol.")
+
+(defun mime-charset-to-coding-system (charset &optional lbt)
+  "Return coding-system corresponding with CHARSET.
+CHARSET is a symbol whose name is MIME charset.
+If optional argument LBT (`unix', `dos' or `mac') is specified, it is
+used as line break code type of coding-system."
+  (if (stringp charset)
+      (setq charset (intern (downcase charset)))
+    )
+  (let ((ret (assq charset mime-charset-coding-system-alist)))
+    (if ret
+	(setq charset (cdr ret))
+      ))
+  (if lbt
+      (setq charset (intern (format "%s-%s" charset lbt)))
+    )
+  (if (find-coding-system charset)
+      charset))
+
+(defun mime-charset-list ()
+  "Return a list of all existing MIME-charset."
+  (nconc (mapcar (function car) mime-charset-coding-system-alist)
+	 (coding-system-list)))
+
+
+(defvar widget-mime-charset-prompt-value-history nil
+  "History of input to `widget-mime-charset-prompt-value'.")
+
+(define-widget 'mime-charset 'coding-system
+  "A mime-charset."
+  :format "%{%t%}: %v"
+  :tag "MIME-charset"
+  :prompt-history 'widget-mime-charset-prompt-value-history
+  :prompt-value 'widget-mime-charset-prompt-value
+  :action 'widget-mime-charset-action)
+
+(defun widget-mime-charset-prompt-value (widget prompt value unbound)
+  ;; Read mime-charset from minibuffer.
+  (intern
+   (completing-read (format "%s (default %s) " prompt value)
+		    (mapcar (function
+			     (lambda (sym)
+			       (list (symbol-name sym))
+			       ))
+			    (mime-charset-list)))))
+
+(defun widget-mime-charset-action (widget &optional event)
+  ;; Read a mime-charset from the minibuffer.
+  (let ((answer
+	 (widget-mime-charset-prompt-value
+	  widget
+	  (widget-apply widget :menu-tag-get)
+	  (widget-value widget)
+	  t)))
+    (widget-value-set widget answer)
+    (widget-apply widget :notify widget event)
+    (widget-setup)))
+
+(defcustom default-mime-charset 'x-ctext
+  "Default value of MIME-charset.
+It is used when MIME-charset is not specified.
+It must be symbol."
+  :group 'i18n
+  :type 'mime-charset)
+
+(defun detect-mime-charset-region (start end)
+  "Return MIME charset for region between START and END."
+  (charsets-to-mime-charset (find-charset-region start end)))
+
+
+;;; @ end
+;;;
+
+(provide 'emu-20)
+
+;;; emu-20.el ends here
+;;; emu-e19.el --- emu module for Emacs 19 and XEmacs 19
+
+;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Version: $Id$
+;; Keywords: emulation, compatibility, mule, Latin-1
+
+;; This file is part of emu.
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Code:
+
+;;; @ version and variant specific features
+;;;
+
+(cond (running-xemacs
+       (require 'emu-xemacs))
+      (running-emacs-19
+       (require 'emu-19)
+       ))
+
+
+;;; @ character set
+;;;
+
+(defconst charset-ascii 0 "Character set of ASCII")
+(defconst charset-latin-iso8859-1 129 "Character set of ISO-8859-1")
+
+(defun charset-description (charset)
+  "Return description of CHARSET. [emu-e19.el]"
+  (if (< charset 128)
+      (documentation-property 'charset-ascii 'variable-documentation)
+    (documentation-property 'charset-latin-iso8859-1 'variable-documentation)
+    ))
+
+(defun charset-registry (charset)
+  "Return registry name of CHARSET. [emu-e19.el]"
+  (if (< charset 128)
+      "ASCII"
+    "ISO8859-1"))
+
+(defun charset-columns (charset)
+  "Return number of columns a CHARSET occupies when displayed.
+\[emu-e19.el]"
+  1)
+
+(defun charset-direction (charset)
+  "Return the direction of a character of CHARSET by
+  0 (left-to-right) or 1 (right-to-left). [emu-e19.el]"
+  0)
+
+(defun find-charset-string (str)
+  "Return a list of charsets in the string.
+\[emu-e19.el; Mule emulating function]"
+  (if (string-match "[\200-\377]" str)
+      (list charset-latin-iso8859-1)
+    ))
+
+(defalias 'find-non-ascii-charset-string 'find-charset-string)
+
+(defun find-charset-region (start end)
+  "Return a list of charsets in the region between START and END.
+\[emu-e19.el; Mule emulating function]"
+  (if (save-excursion
+	(save-restriction
+	  (narrow-to-region start end)
+	  (goto-char start)
+	  (re-search-forward "[\200-\377]" nil t)
+	  ))
+      (list charset-latin-iso8859-1)
+    ))
+
+(defalias 'find-non-ascii-charset-region 'find-charset-region)
+
+
+;;; @ coding-system
+;;;
+
+(defconst *internal* nil)
+(defconst *ctext* nil)
+(defconst *noconv* nil)
+
+(defun decode-coding-string (string coding-system)
+  "Decode the STRING which is encoded in CODING-SYSTEM.
+\[emu-e19.el; Emacs 20 emulating function]"
+  string)
+
+(defun encode-coding-string (string coding-system)
+  "Encode the STRING as CODING-SYSTEM.
+\[emu-e19.el; Emacs 20 emulating function]"
+  string)
+
+(defun decode-coding-region (start end coding-system)
+  "Decode the text between START and END which is encoded in CODING-SYSTEM.
+\[emu-e19.el; Emacs 20 emulating function]"
+  0)
+
+(defun encode-coding-region (start end coding-system)
+  "Encode the text between START and END to CODING-SYSTEM.
+\[emu-e19.el; Emacs 20 emulating function]"
+  0)
+
+(defun detect-coding-region (start end)
+  "Detect coding-system of the text in the region between START and END.
+\[emu-e19.el; Emacs 20 emulating function]"
+  )
+
+(defun set-buffer-file-coding-system (coding-system &optional force)
+  "Set buffer-file-coding-system of the current buffer to CODING-SYSTEM.
+\[emu-e19.el; Emacs 20 emulating function]"
+  )
+
+(defmacro as-binary-process (&rest body)
+  (` (let (selective-display)	; Disable ^M to nl translation.
+       (,@ body)
+       )))
+
+(defmacro as-binary-input-file (&rest body)
+  (` (let ((emx-binary-mode t)) ; Stop CRLF to LF conversion in OS/2
+       (,@ body)
+       )))
+
+(defmacro as-binary-output-file (&rest body)
+  (` (let ((emx-binary-mode t)) ; Stop CRLF to LF conversion in OS/2
+       (,@ body)
+       )))
+
+
+;;; @@ for old MULE emulation
+;;;
+
+(defun code-convert-string (str ic oc)
+  "Convert code in STRING from SOURCE code to TARGET code,
+On successful converion, returns the result string,
+else returns nil. [emu-e19.el; old MULE emulating function]"
+  str)
+
+(defun code-convert-region (beg end ic oc)
+  "Convert code of the text between BEGIN and END from SOURCE
+to TARGET. On successful conversion returns t,
+else returns nil. [emu-e19.el; old MULE emulating function]"
+  t)
+
+
+;;; @ binary access
+;;;
+
+(defun insert-binary-file-contents-literally
+  (filename &optional visit beg end replace)
+  "Like `insert-file-contents-literally', q.v., but don't code conversion.
+A buffer may be modified in several ways after reading into the buffer due
+to advanced Emacs features, such as file-name-handlers, format decoding,
+find-file-hooks, etc.
+  This function ensures that none of these modifications will take place."
+  (let ((emx-binary-mode t))
+    (insert-file-contents-literally filename visit beg end replace)
+    ))
+
+
+;;; @ MIME charset
+;;;
+
+(defvar charsets-mime-charset-alist
+  (list (cons (list charset-ascii) 'us-ascii)))
+
+(defvar default-mime-charset 'iso-8859-1)
+
+(defun mime-charset-to-coding-system (charset)
+  (if (stringp charset)
+      (setq charset (intern (downcase charset)))
+    )
+  (and (memq charset (list 'us-ascii default-mime-charset))
+       charset)
+  )
+
+(defun detect-mime-charset-region (start end)
+  "Return MIME charset for region between START and END.
+\[emu-e19.el]"
+  (if (save-excursion
+	(save-restriction
+	  (narrow-to-region start end)
+	  (goto-char start)
+	  (re-search-forward "[\200-\377]" nil t)
+	  ))
+      default-mime-charset
+    'us-ascii))
+
+(defun encode-mime-charset-region (start end charset)
+  "Encode the text between START and END as MIME CHARSET.
+\[emu-e19.el]"
+  )
+
+(defun decode-mime-charset-region (start end charset)
+  "Decode the text between START and END as MIME CHARSET.
+\[emu-e19.el]"
+  )
+
+(defun encode-mime-charset-string (string charset)
+  "Encode the STRING as MIME CHARSET. [emu-e19.el]"
+  string)
+
+(defun decode-mime-charset-string (string charset)
+  "Decode the STRING as MIME CHARSET. [emu-e19.el]"
+  string)
+
+
+;;; @ character
+;;;
+
+(defun char-charset (chr)
+  "Return the character set of char CHR.
+\[emu-e19.el; XEmacs 20 emulating function]"
+  (if (< chr 128)
+      charset-ascii
+    charset-latin-iso8859-1))
+
+(defun char-bytes (char)
+  "Return number of bytes a character in CHAR occupies in a buffer.
+\[emu-e19.el; MULE emulating function]"
+  1)
+
+(defalias 'char-length 'char-bytes)
+
+(defun char-columns (character)
+  "Return number of columns a CHARACTER occupies when displayed.
+\[emu-e19.el]"
+  1)
+
+;;; @@ for old MULE emulation
+;;;
+
+(defalias 'char-width 'char-columns)
+
+(defalias 'char-leading-char 'char-charset)
+
+
+;;; @ string
+;;;
+
+(defalias 'string-columns 'length)
+
+(defun string-to-char-list (str)
+  (mapcar (function identity) str)
+  )
+
+(defalias 'string-to-int-list 'string-to-char-list)
+
+(defalias 'sref 'aref)
+
+(defun truncate-string (str width &optional start-column)
+  "Truncate STR to fit in WIDTH columns.
+Optional non-nil arg START-COLUMN specifies the starting column.
+\[emu-e19.el; MULE 2.3 emulating function]"
+  (or start-column
+      (setq start-column 0))
+  (substring str start-column width)
+  )
+
+;;; @@ for old MULE emulation
+;;;
+
+(defalias 'string-width 'length)
+
+
+;;; @ end
+;;;
+
+(provide 'emu-e19)
+
+;;; emu-e19.el ends here
+;;; emu-x20.el --- emu API implementation for XEmacs with mule
+
+;; Copyright (C) 1994,1995,1996,1997 MORIOKA Tomohiko
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Version: $Id$
+;; Keywords: emulation, compatibility, Mule, XEmacs
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Commentary:
+
+;;    This module requires XEmacs 20.3-b5 or later with mule.
+
+;;; Code:
+
+(require 'emu-xemacs)
+(require 'emu-20)
+
+
+;;; @ MIME charset
+;;;
+
+(defun encode-mime-charset-region (start end charset)
+  "Encode the text between START and END as MIME CHARSET."
+  (let ((cs (mime-charset-to-coding-system charset)))
+    (if cs
+	(encode-coding-region start end cs)
+      )))
+
+(defun decode-mime-charset-region (start end charset)
+  "Decode the text between START and END as MIME CHARSET."
+  (let ((cs (mime-charset-to-coding-system charset)))
+    (if cs
+	(decode-coding-region start end cs)
+      )))
+
+(defun encode-mime-charset-string (string charset)
+  "Encode the STRING as MIME CHARSET."
+  (let ((cs (mime-charset-to-coding-system charset)))
+    (if cs
+	(encode-coding-string string cs)
+      string)))
+
+(defun decode-mime-charset-string (string charset)
+  "Decode the STRING as MIME CHARSET."
+  (let ((cs (mime-charset-to-coding-system charset)))
+    (if cs
+	(decode-coding-string string cs)
+      string)))
+
+
+(defvar charsets-mime-charset-alist
+  '(((ascii)						. us-ascii)
+    ((ascii latin-iso8859-1)				. iso-8859-1)
+    ((ascii latin-iso8859-2)				. iso-8859-2)
+    ((ascii latin-iso8859-3)				. iso-8859-3)
+    ((ascii latin-iso8859-4)				. iso-8859-4)
+    ((ascii cyrillic-iso8859-5)				. iso-8859-5)
+;;; ((ascii cyrillic-iso8859-5)				. koi8-r)
+    ((ascii arabic-iso8859-6)				. iso-8859-6)
+    ((ascii greek-iso8859-7)				. iso-8859-7)
+    ((ascii hebrew-iso8859-8)				. iso-8859-8)
+    ((ascii latin-iso8859-9)				. iso-8859-9)
+    ((ascii latin-jisx0201
+	    japanese-jisx0208-1978 japanese-jisx0208)	. iso-2022-jp)
+    ((ascii korean-ksc5601)				. euc-kr)
+    ((ascii chinese-gb2312)				. cn-gb-2312)
+    ((ascii chinese-big5-1 chinese-big5-2)		. cn-big5)
+    ((ascii latin-iso8859-1 greek-iso8859-7
+	    latin-jisx0201 japanese-jisx0208-1978
+	    chinese-gb2312 japanese-jisx0208
+	    korean-ksc5601 japanese-jisx0212)		. iso-2022-jp-2)
+    ((ascii latin-iso8859-1 greek-iso8859-7
+	    latin-jisx0201 japanese-jisx0208-1978
+	    chinese-gb2312 japanese-jisx0208
+	    korean-ksc5601 japanese-jisx0212
+	    chinese-cns11643-1 chinese-cns11643-2)	. iso-2022-int-1)
+    ((ascii latin-iso8859-1 latin-iso8859-2
+	    cyrillic-iso8859-5 greek-iso8859-7
+	    latin-jisx0201 japanese-jisx0208-1978
+	    chinese-gb2312 japanese-jisx0208
+	    korean-ksc5601 japanese-jisx0212
+	    chinese-cns11643-1 chinese-cns11643-2
+	    chinese-cns11643-3 chinese-cns11643-4
+	    chinese-cns11643-5 chinese-cns11643-6
+	    chinese-cns11643-7)				. iso-2022-int-1)
+    ))
+
+(defun detect-mime-charset-region (start end)
+  "Return MIME charset for region between START and END."
+  (charsets-to-mime-charset (charsets-in-region start end)))
+
+
+;;; @ character
+;;;
+
+;;; @@ Mule emulating aliases
+;;;
+;;; You should not use them.
+
+(defalias 'char-leading-char 'char-charset)
+
+(defun char-category (character)
+  "Return string of category mnemonics for CHAR in TABLE.
+CHAR can be any multilingual character
+TABLE defaults to the current buffer's category table."
+  (mapconcat (lambda (chr)
+	       (char-to-string (int-char chr))
+	       )
+	     (char-category-list character)
+	     ""))
+
+
+;;; @ string
+;;;
+
+(defun string-to-int-list (str)
+  (mapcar #'char-int str)
+  )
+
+
+;;; @ end
+;;;
+
+(provide 'emu-x20)
+
+;;; emu-x20.el ends here
+;;; emu-xemacs.el --- emu API implementation for XEmacs
+
+;; Copyright (C) 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1995,1996,1997 MORIOKA Tomohiko
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Version:
+;;	$Id$
+;; Keywords: emulation, compatibility, XEmacs
+
+;; This file is part of XEmacs.
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Code:
+
+;;; @ face
+;;;
+
+(or (fboundp 'face-list)
+    (defalias 'face-list 'list-faces)
+    )
+
+(or (memq 'underline (face-list))
+    (and (fboundp 'make-face)
+	 (make-face 'underline)
+	 ))
+
+(or (face-differs-from-default-p 'underline)
+    (set-face-underline-p 'underline t))
+
+
+;;; @ overlay
+;;;
+
+(condition-case err
+    (require 'overlay)
+  (error (defalias 'make-overlay 'make-extent)
+	 (defalias 'overlay-put 'set-extent-property)
+	 (defalias 'overlay-buffer 'extent-buffer)
+	 (defun move-overlay (extent start end &optional buffer)
+	   (set-extent-endpoints extent start end)
+	   )
+	 ))
+
+
+;;; @ visible/invisible
+;;;
+
+(defmacro enable-invisible ())
+
+(defmacro end-of-invisible ())
+
+(defun invisible-region (start end)
+  (if (save-excursion
+	(goto-char start)
+	(eq (following-char) ?\n)
+	)
+      (setq start (1+ start))
+    )
+  (put-text-property start end 'invisible t)
+  )
+
+(defun visible-region (start end)
+  (put-text-property start end 'invisible nil)
+  )
+
+(defun invisible-p (pos)
+  (if (save-excursion
+	(goto-char pos)
+	(eq (following-char) ?\n)
+	)
+      (setq pos (1+ pos))
+    )
+  (get-text-property pos 'invisible)
+  )
+
+(defun next-visible-point (pos)
+  (save-excursion
+    (if (save-excursion
+	  (goto-char pos)
+	  (eq (following-char) ?\n)
+	  )
+	(setq pos (1+ pos))
+      )
+    (or (next-single-property-change pos 'invisible)
+	(point-max))
+    ))
+
+
+;;; @ mouse
+;;;
+
+(defvar mouse-button-1 'button1)
+(defvar mouse-button-2 'button2)
+(defvar mouse-button-3 'button3)
+
+
+;;; @ dired
+;;;
+
+(or (fboundp 'dired-other-frame)
+    (defun dired-other-frame (dirname &optional switches)
+      "\"Edit\" directory DIRNAME.  Like `dired' but makes a new frame."
+      (interactive (dired-read-dir-and-switches "in other frame "))
+      (switch-to-buffer-other-frame (dired-noselect dirname switches))
+      )
+    )
+
+
+;;; @ string
+;;;
+
+(defmacro char-list-to-string (char-list)
+  "Convert list of character CHAR-LIST to string. [emu-xemacs.el]"
+  `(mapconcat #'char-to-string ,char-list ""))
+
+
+;;; @@ to avoid bug of XEmacs 19.14
+;;;
+
+(or (string-match "^../"
+		  (file-relative-name "/usr/local/share" "/usr/local/lib"))
+    ;; This function was imported from Emacs 19.33.
+    (defun file-relative-name (filename &optional directory)
+      "Convert FILENAME to be relative to DIRECTORY
+(default: default-directory). [emu-xemacs.el]"
+      (setq filename (expand-file-name filename)
+	    directory (file-name-as-directory
+		       (expand-file-name
+			(or directory default-directory))))
+      (let ((ancestor ""))
+	(while (not (string-match (concat "^" (regexp-quote directory))
+				  filename))
+	  (setq directory (file-name-directory (substring directory 0 -1))
+		ancestor (concat "../" ancestor)))
+	(concat ancestor (substring filename (match-end 0)))
+	))
+    )
+
+    
+;;; @ end
+;;;
+
+(provide 'emu-xemacs)
+
+;;; emu-xemacs.el ends here
+;;; emu.el --- Emulation module for each Emacs variants
+
+;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Version: $Id$
+;; Keywords: emulation, compatibility, NEmacs, MULE, Emacs/mule, XEmacs
+
+;; This file is part of emu.
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Code:
+
+(defmacro defun-maybe (name &rest everything-else)
+  (or (and (fboundp name)
+	   (not (get name 'defun-maybe))
+	   )
+      (` (or (fboundp (quote (, name)))
+	     (progn
+	       (defun (, name) (,@ everything-else))
+	       (put (quote (, name)) 'defun-maybe t)
+	       ))
+	 )))
+
+(defmacro defsubst-maybe (name &rest everything-else)
+  (or (and (fboundp name)
+	   (not (get name 'defsubst-maybe))
+	   )
+      (` (or (fboundp (quote (, name)))
+	     (progn
+	       (defsubst (, name) (,@ everything-else))
+	       (put (quote (, name)) 'defsubst-maybe t)
+	       ))
+	 )))
+
+(defmacro defmacro-maybe (name &rest everything-else)
+  (or (and (fboundp name)
+	   (not (get name 'defmacro-maybe))
+	   )
+      (` (or (fboundp (quote (, name)))
+	     (progn
+	       (defmacro (, name) (,@ everything-else))
+	       (put (quote (, name)) 'defmacro-maybe t)
+	       ))
+	 )))
+
+(put 'defun-maybe 'lisp-indent-function 'defun)
+(put 'defsubst-maybe 'lisp-indent-function 'defun)
+(put 'defmacro-maybe 'lisp-indent-function 'defun)
+
+(defmacro defconst-maybe (name &rest everything-else)
+  (or (and (boundp name)
+	   (not (get name 'defconst-maybe))
+	   )
+      (` (or (boundp (quote (, name)))
+	     (progn
+	       (defconst (, name) (,@ everything-else))
+	       (put (quote (, name)) 'defconst-maybe t)
+	       ))
+	 )))
+
+
+(defconst-maybe emacs-major-version (string-to-int emacs-version))
+(defconst-maybe emacs-minor-version
+  (string-to-int
+   (substring emacs-version
+	      (string-match (format "%d\\." emacs-major-version)
+			    emacs-version))))
+
+(defvar running-emacs-18 (<= emacs-major-version 18))
+(defvar running-xemacs (string-match "XEmacs" emacs-version))
+
+(defvar running-mule-merged-emacs (and (not (boundp 'MULE))
+				       (not running-xemacs) (featurep 'mule)))
+(defvar running-xemacs-with-mule (and running-xemacs (featurep 'mule)))
+
+(defvar running-emacs-19 (and (not running-xemacs) (= emacs-major-version 19)))
+(defvar running-emacs-19_29-or-later
+  (or (and running-emacs-19 (>= emacs-minor-version 29))
+      (and (not running-xemacs)(>= emacs-major-version 20))))
+
+(defvar running-xemacs-19 (and running-xemacs
+			       (= emacs-major-version 19)))
+(defvar running-xemacs-20-or-later (and running-xemacs
+					(>= emacs-major-version 20)))
+(defvar running-xemacs-19_14-or-later
+  (or (and running-xemacs-19 (>= emacs-minor-version 14))
+      running-xemacs-20-or-later))
+
+(cond (running-mule-merged-emacs
+       ;; for mule merged EMACS
+       (require 'emu-e20)
+       )
+      (running-xemacs-with-mule
+       ;; for XEmacs/mule
+       (require 'emu-x20)
+       )
+      ((boundp 'MULE)
+       ;; for MULE 1.* and 2.*
+       (require 'emu-mule)
+       )
+      ((boundp 'NEMACS)
+       ;; for NEmacs and NEpoch
+       (require 'emu-nemacs)
+       )
+      (t
+       ;; for EMACS 19 and XEmacs 19 (without mule)
+       (require 'emu-e19)
+       ))
+
+
+;;; @ MIME charset
+;;;
+
+(defun charsets-to-mime-charset (charsets)
+  "Return MIME charset from list of charset CHARSETS.
+This function refers variable `charsets-mime-charset-alist'
+and `default-mime-charset'."
+  (if charsets
+      (or (catch 'tag
+	    (let ((rest charsets-mime-charset-alist)
+		  cell)
+	      (while (setq cell (car rest))
+		(if (catch 'not-subset
+		      (let ((set1 charsets)
+			    (set2 (car cell))
+			    obj)
+			(while set1
+			  (setq obj (car set1))
+			  (or (memq obj set2)
+			      (throw 'not-subset nil)
+			      )
+			  (setq set1 (cdr set1))
+			  )
+			t))
+		    (throw 'tag (cdr cell))
+		  )
+		(setq rest (cdr rest))
+		)))
+	  default-mime-charset)))
+
+
+;;; @ Emacs 19 emulation
+;;;
+
+(defun-maybe minibuffer-prompt-width ()
+  "Return the display width of the minibuffer prompt."
+  (save-excursion
+    (set-buffer (window-buffer (minibuffer-window)))
+    (current-column)
+    ))
+
+
+;;; @ Emacs 19.29 emulation
+;;;
+
+(defvar path-separator ":"
+  "Character used to separate concatenated paths.")
+
+(defun-maybe buffer-substring-no-properties (start end)
+  "Return the characters of part of the buffer, without the text properties.
+The two arguments START and END are character positions;
+they can be in either order. [Emacs 19.29 emulating function]"
+  (let ((string (buffer-substring start end)))
+    (set-text-properties 0 (length string) nil string)
+    string))
+
+(defun-maybe match-string (num &optional string)
+  "Return string of text matched by last search.
+NUM specifies which parenthesized expression in the last regexp.
+ Value is nil if NUMth pair didn't match, or there were less than NUM pairs.
+Zero means the entire text matched by the whole regexp or whole string.
+STRING should be given if the last search was by `string-match' on STRING.
+\[Emacs 19.29 emulating function]"
+  (if (match-beginning num)
+      (if string
+	  (substring string (match-beginning num) (match-end num))
+	(buffer-substring (match-beginning num) (match-end num)))))
+
+(or running-emacs-19_29-or-later
+    running-xemacs
+    ;; for Emacs 19.28 or earlier
+    (fboundp 'si:read-string)
+    (progn
+      (fset 'si:read-string (symbol-function 'read-string))
+      
+      (defun read-string (prompt &optional initial-input history)
+	"Read a string from the minibuffer, prompting with string PROMPT.
+If non-nil, second arg INITIAL-INPUT is a string to insert before reading.
+The third arg HISTORY, is dummy for compatibility. [emu.el]
+See `read-from-minibuffer' for details of HISTORY argument."
+	(si:read-string prompt initial-input)
+	)
+      ))
+
+
+;;; @ Emacs 19.30 emulation
+;;;
+
+;; This function was imported Emacs 19.30.
+(defun-maybe add-to-list (list-var element)
+  "Add to the value of LIST-VAR the element ELEMENT if it isn't there yet.
+If you want to use `add-to-list' on a variable that is not defined
+until a certain package is loaded, you should put the call to `add-to-list'
+into a hook function that will be run only after loading the package.
+\[Emacs 19.30 emulating function]"
+  (or (member element (symbol-value list-var))
+      (set list-var (cons element (symbol-value list-var)))
+      ))
+
+(cond ((fboundp 'insert-file-contents-literally)
+       )
+      ((boundp 'file-name-handler-alist)
+       (defun insert-file-contents-literally
+	 (filename &optional visit beg end replace)
+	 "Like `insert-file-contents', q.v., but only reads in the file.
+A buffer may be modified in several ways after reading into the buffer due
+to advanced Emacs features, such as file-name-handlers, format decoding,
+find-file-hooks, etc.
+  This function ensures that none of these modifications will take place.
+\[Emacs 19.30 emulating function]"
+	 (let (file-name-handler-alist)
+	   (insert-file-contents filename visit beg end replace)
+	   ))
+       )
+      (t
+       (defalias 'insert-file-contents-literally 'insert-file-contents)
+       ))
+
+
+;;; @ Emacs 19.31 emulation
+;;;
+
+(defun-maybe buffer-live-p (object)
+  "Return non-nil if OBJECT is a buffer which has not been killed.
+Value is nil if OBJECT is not a buffer or if it has been killed.
+\[Emacs 19.31 emulating function]"
+  (and object
+       (get-buffer object)
+       (buffer-name (get-buffer object))
+       ))
+
+;; This macro was imported Emacs 19.33.
+(defmacro-maybe save-selected-window (&rest body)
+  "Execute BODY, then select the window that was selected before BODY.
+\[Emacs 19.31 emulating function]"
+  (list 'let
+	'((save-selected-window-window (selected-window)))
+	(list 'unwind-protect
+	      (cons 'progn body)
+	      (list 'select-window 'save-selected-window-window))))
+
+
+;;; @ XEmacs emulation
+;;;
+
+(defun-maybe functionp (obj)
+  "Returns t if OBJ is a function, nil otherwise.
+\[XEmacs emulating function]"
+  (or (subrp obj)
+      (byte-code-function-p obj)
+      (and (symbolp obj)(fboundp obj))
+      (and (consp obj)(eq (car obj) 'lambda))
+      ))
+
+(defun-maybe point-at-eol (&optional arg buffer)
+  "Return the character position of the last character on the current line.
+With argument N not nil or 1, move forward N - 1 lines first.
+If scan reaches end of buffer, return that position.
+This function does not move point. [XEmacs emulating function]"
+  (save-excursion
+    (if buffer
+	(set-buffer buffer)
+      )
+    (if arg
+	(forward-line (1- arg))
+      )
+    (end-of-line)
+    (point)
+    ))
+
+
+;;; @ for XEmacs 20
+;;;
+
+(or (fboundp 'char-int)
+    (fset 'char-int (symbol-function 'identity))
+    )
+(or (fboundp 'int-char)
+    (fset 'int-char (symbol-function 'identity))
+    )
+(or (fboundp 'char-or-char-int-p)
+    (fset 'char-or-char-int-p (symbol-function 'integerp))
+    )
+
+
+;;; @ for text/richtext and text/enriched
+;;;
+
+(cond ((fboundp 'richtext-decode)
+       ;; have richtext.el
+       )
+      ((or running-emacs-19_29-or-later running-xemacs-19_14-or-later)
+       ;; have enriched.el
+       (autoload 'richtext-decode "richtext")
+       (or (assq 'text/richtext format-alist)
+	   (setq format-alist
+		 (cons
+		  (cons 'text/richtext
+			'("Extended MIME text/richtext format."
+			  "Content-[Tt]ype:[ \t]*text/richtext"
+			  richtext-decode richtext-encode t enriched-mode))
+		  format-alist)))
+       )
+      (t
+       ;; don't have enriched.el
+       (autoload 'richtext-decode "tinyrich")
+       (autoload 'enriched-decode "tinyrich")
+       ))
+
+
+;;; @ end
+;;;
+
+(provide 'emu)
+
+;;; emu.el ends here
+;;; file-detect.el --- Path management or file detection utility
+
+;; Copyright (C) 1996,1997 Free Software Foundation, Inc.
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Version: $Id$
+;; Keywords: file detection, install, module
+;; Status: obsoleted
+
+;; This file is part of APEL (A Portable Emacs Library).
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;;	This file is existed only for compatibility.  Please use
+;;	path-util.el instead of this file.
+
+;;; Code:
+
+(require 'path-util)
+
+(provide 'file-detect)
+
+;;; file-detect.el ends here
+;;; filename.el --- file name filter
+
+;; Copyright (C) 1996,1997 MORIOKA Tomohiko
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Version: $Id$
+;; Keywords: file name, string
+
+;; This file is part of APEL (A Portable Emacs Library).
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Code:
+
+(require 'emu)
+(require 'cl)
+
+(defsubst poly-funcall (functions argument)
+  "Apply initial ARGUMENT to sequence of FUNCTIONS.
+FUNCTIONS is list of functions.
+
+(poly-funcall '(f1 f2 .. fn) arg) is as same as
+(fn .. (f2 (f1 arg)) ..).
+
+For example, (poly-funcall '(car number-to-string) '(100)) returns
+\"100\"."
+  (while functions
+    (setq argument (funcall (car functions) argument)
+	  functions (cdr functions))
+    )
+  argument)
+
+
+;;; @ variables
+;;;
+
+(defvar filename-limit-length 21 "Limit size of file-name.")
+
+(defvar filename-replacement-alist
+  '(((?\  ?\t) . "_")
+    ((?! ?\" ?# ?$ ?% ?& ?' ?\( ?\) ?* ?/
+	 ?: ?\; ?< ?> ?? ?\[ ?\\ ?\] ?` ?{ ?| ?}) . "_")
+    (filename-control-p . "")
+    )
+  "Alist list of characters vs. string as replacement.
+List of characters represents characters not allowed as file-name.")
+
+(defvar filename-filters
+  (let ((filters '(filename-special-filter
+		   filename-eliminate-top-low-lines
+		   filename-canonicalize-low-lines
+		   filename-maybe-truncate-by-size
+		   filename-eliminate-bottom-low-lines
+		   )))
+    (require 'path-util)
+    (if (exec-installed-p "kakasi")
+	(cons 'filename-japanese-to-roman-string filters)
+      filters))
+  "List of functions for file-name filter.")
+
+
+;;; @ filters
+;;;
+
+(defun filename-japanese-to-roman-string (str)
+  (save-excursion
+    (set-buffer (get-buffer-create " *temp kakasi*"))
+    (erase-buffer)
+    (insert str)
+    (call-process-region (point-min)(point-max) "kakasi" t t t
+			 "-Ha" "-Ka" "-Ja" "-Ea" "-ka")
+    (buffer-string)
+    ))
+
+(defun filename-control-p (character)
+  (let ((code (char-int character)))
+    (or (< code 32)(= code 127))
+    ))
+
+(defun filename-special-filter (string)
+  (let (dest
+	(i 0)
+	(len (length string))
+	(b 0)
+	)
+    (while (< i len)
+      (let* ((chr (sref string i))
+	     (ret (assoc-if (function
+			     (lambda (key)
+			       (if (functionp key)
+				   (funcall key chr)
+				 (memq chr key)
+				 )))
+			    filename-replacement-alist))
+	     )
+	(if ret
+	    (setq dest (concat dest (substring string b i)(cdr ret))
+		  i (+ i (char-length chr))
+		  b i)
+	  (setq i (+ i (char-length chr)))
+	  )))
+    (concat dest (substring string b))
+    ))
+
+(defun filename-eliminate-top-low-lines (string)
+  (if (string-match "^_+" string)
+      (substring string (match-end 0))
+    string))
+
+(defun filename-canonicalize-low-lines (string)
+  (let (dest)
+    (while (string-match "__+" string)
+      (setq dest (concat dest (substring string 0 (1+ (match-beginning 0)))))
+      (setq string (substring string (match-end 0)))
+      )
+    (concat dest string)
+    ))
+
+(defun filename-maybe-truncate-by-size (string)
+  (if (and (> (length string) filename-limit-length)
+	   (string-match "_" string filename-limit-length)
+	   )
+      (substring string 0 (match-beginning 0))
+    string))
+
+(defun filename-eliminate-bottom-low-lines (string)
+  (if (string-match "_+$" string)
+      (substring string 0 (match-beginning 0))
+    string))
+
+
+;;; @ interface
+;;;
+
+(defun replace-as-filename (string)
+  "Return safety filename from STRING.
+It refers variable `filename-filters' and default filters refers
+`filename-limit-length', `filename-replacement-alist'."
+  (and string
+       (poly-funcall filename-filters string)
+       ))
+
+
+;;; @ end
+;;;
+
+(provide 'filename)
+
+;;; filename.el ends here
+;;; install.el --- Emacs Lisp package install utility
+
+;; Copyright (C) 1996 Free Software Foundation, Inc.
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Created: 1996/08/18
+;; Version: $Id$
+;; Keywords: install, byte-compile, directory detection
+
+;; This file is part of APEL (A Portable Emacs Library).
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Code:
+
+(require 'emu)
+(require 'path-util)
+
+
+;;; @ compile Emacs Lisp files
+;;;
+
+(defun compile-elisp-module (module &optional path every-time)
+  (setq module (expand-file-name (symbol-name module) path))
+  (let ((el-file (concat module ".el"))
+	(elc-file (concat module ".elc"))
+	)
+    (if (or every-time
+	    (file-newer-than-file-p el-file elc-file))
+	(byte-compile-file el-file)
+      )
+    ))
+
+(defun compile-elisp-modules (modules &optional path every-time)
+  (mapcar (function
+	   (lambda (module)
+	     (compile-elisp-module module path every-time)
+	     ))
+	  modules))
+
+
+;;; @ install files
+;;;
+
+(defvar install-overwritten-file-modes (+ (* 64 6)(* 8 4) 4))
+
+(defun install-file (file src dest &optional move overwrite)
+  (let ((src-file (expand-file-name file src)))
+    (if (file-exists-p src-file)
+	(let ((full-path (expand-file-name file dest)))
+	  (if (and (file-exists-p full-path) overwrite)
+              (delete-file full-path)
+	    )
+	  (copy-file src-file full-path t t)
+	  (if move
+	      (catch 'tag
+		(while (and (file-exists-p src-file)
+			    (file-writable-p src-file))
+		  (condition-case err
+		      (progn
+			(delete-file src-file)
+			(throw 'tag nil)
+			)
+		    (error (princ (format "%s\n" (nth 1 err))))
+		    ))))
+	  (princ (format "%s -> %s\n" file dest))
+	  ))
+    ))
+
+(defun install-files (files src dest &optional move overwrite)
+  (or (file-exists-p dest)
+      (make-directory dest t)
+      )
+  (mapcar (function (lambda (file)
+		      (install-file file src dest move overwrite)
+		      ))
+	  files))
+
+
+;;; @@ install Emacs Lisp files
+;;;
+
+(defun install-elisp-module (module src dest)
+  (let (el-file elc-file)
+    (let ((name (symbol-name module)))
+      (setq el-file (concat name ".el"))
+      (setq elc-file (concat name ".elc"))
+      )
+    (let ((src-file (expand-file-name el-file src)))
+      (if (file-exists-p src-file)
+	  (let ((full-path (expand-file-name el-file dest)))
+	    (if (file-exists-p full-path)
+                (delete-file full-path)
+	      )
+	    (copy-file src-file full-path t t)
+	    (princ (format "%s -> %s\n" el-file dest))
+	    ))
+      (setq src-file (expand-file-name elc-file src))
+      (if (file-exists-p src-file)
+	  (let ((full-path (expand-file-name elc-file dest)))
+            (if (file-exists-p full-path)
+                (delete-file full-path)
+              )
+	    (copy-file src-file full-path t t)
+	    (catch 'tag
+	      (while (file-exists-p src-file)
+		(condition-case err
+		    (progn
+		      (delete-file src-file)
+		      (throw 'tag nil)
+		      )
+		  (error (princ (format "%s\n" (nth 1 err))))
+		  )))
+	    (princ (format "%s -> %s\n" elc-file dest))
+	    ))
+      )))
+
+(defun install-elisp-modules (modules src dest)
+  (or (file-exists-p dest)
+      (make-directory dest t)
+      )
+  (mapcar (function (lambda (module)
+		      (install-elisp-module module src dest)
+		      ))
+	  modules))
+
+
+;;; @ detect install path
+;;;
+
+(defvar install-prefix
+  (if (or running-emacs-18 running-xemacs)
+      (expand-file-name "../../.." exec-directory)
+    (expand-file-name "../../../.." data-directory)
+    )) ; install to shared directory (maybe "/usr/local")
+
+(defvar install-elisp-prefix
+  (if (>= emacs-major-version 19)
+      "site-lisp"
+    "local.lisp"))
+
+(defun install-detect-elisp-directory (&optional prefix elisp-prefix
+						 allow-version-specific)
+  (or prefix
+      (setq prefix install-prefix)
+      )
+  (or elisp-prefix
+      (setq elisp-prefix install-elisp-prefix)
+      )
+  (or
+   (catch 'tag
+     (let ((rest default-load-path)
+	   dir)
+       (while (setq dir (car rest))
+	 (if (string-match
+	      (concat "^"
+		      (expand-file-name (concat ".*/" elisp-prefix) prefix)
+		      "$")
+	      dir)
+	     (if (or allow-version-specific
+		     (not (string-match (format "%d\\.%d"
+						emacs-major-version
+						emacs-minor-version) dir))
+		     )
+		 (throw 'tag dir)
+	       ))
+	 (setq rest (cdr rest))
+	 )))
+   (expand-file-name (concat
+		      (if running-emacs-19_29-or-later
+			  "share/"
+			"lib/")
+		      (cond ((boundp 'NEMACS) "nemacs/")
+			    ((boundp 'MULE)   "mule/")
+			    (running-xemacs
+			     (if (featurep 'mule)
+				 "xmule/"
+			       "xemacs/"))
+			    (t "emacs/"))
+		      elisp-prefix) prefix)