Commits

Anonymous committed c41180e

package standards update, Mule synch

Comments (0)

Files changed (14)

+1999-06-30  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* mule-debug.el (list-coding-system-briefly): Define as an
+	obsolete alias for `describe-current-coding-system-briefly'.
+	(list-coding-system): Define as an obsolete alias for
+	`describe-coding-system'.
+	(mule-diag): Don't define in here [it is defined in mule-diag.el].
+	(dump-charsets): Deleted.
+	(dump-coding-systems): Deleted.
+
+	* mule-diag.el: Load "mule-util" when it is compiled.
+	(describe-current-coding-system): Use `coding-priority-list'
+	instead of `coding-category-list'.
+	(list-coding-categories): Likewise.
+	(mule-diag): Likewise [but may not work yet].
+
+1999-06-30  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* mule-util.el (set-coding-system-alist): Define as an obsolete
+	alias for `modify-coding-system-alist'.
+	(eol-mnemonic-undecided): New variable.
+	(eol-mnemonic-lf): New variable.
+	(eol-mnemonic-crlf): New variable.
+	(eol-mnemonic-cr): New variable.
+	(coding-system-eol-type-mnemonic): New function.
+	(detect-coding-with-priority): Ported to XEmacs; changed to inline
+	function.
+	(detect-coding-with-language-environment): Ported to XEmacs.
+	(compose-region): Deleted.
+	(decompose-region): Deleted.
+	(reference-point-alist): Deleted.
+	(compose-chars-component): Deleted.
+	(compose-chars-rule): Deleted.
+	(compose-chars): Deleted.
+	(decompose-composite-char): Deleted.
+
+1999-06-30  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* mule-diag.el (sort-charset-list): Deleted.
+	(sorted-charset-list): New function.
+	(list-character-sets): Don't use `sort-charset-list'.
+	(describe-current-coding-system-briefly): Modify for XEmacs.
+
+1999-06-29  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* china-util.el (setup-chinese-gb-environment-internal): Renamed
+	from `chinese-gb-environment-setup-function'.
+
+	* Makefile (ELCS): Add korea-util.elc.
+	(auto-autoloads.el): Deleted.
+
+	* korea-util.el: New file.
+
+1999-06-29  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* japan-util.el (setup-japanese-environment): Call
+	`set-language-environment'.
+	(setup-japanese-environment-internal): New function [virtually
+	renamed from `setup-japanese-environment'].
+
+1999-06-29  Kenichi Handa  <handa@etl.go.jp>
+
+	* thai-xtis-util.el (thai-xtis-word-segment): Wait a little bit
+	more after starting `wordseg' program.
+
+1999-06-29  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* ethio-util.el (setup-ethiopic-environment-internal): Modify for
+	XEmacs [but may be not completed].
+	(ethio-sera-to-fidel-mail): Don't use `rfc822-goto-eoh'.
+	(ethio-fidel-to-sera-mail): Likewise.
+
+1999-06-29  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* etc/TUTORIAL.th: Deleted [same file is included in kernel].
+
+1999-06-29  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* cyril-util.el (setup-cyrillic-iso-environment): Just call
+	`set-language-environment'.
+	(setup-cyrillic-koi8-environment): Likewise.
+	(setup-cyrillic-alternativnyj-environment): Likewise.
+
+1999-06-29  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* china-util.el (chinese-gb-environment-setup-function): New
+	function.
+	(setup-chinese-gb-environment): Just call
+	`set-language-environment'.
+	(setup-chinese-gb-environment): Likewise.
+	(setup-chinese-big5-environment): Likewise.
+	(hz/zw-start-gb): Add \0-\177.
+	(hz-set-msb-table): New constant.
+	(decode-hz-region): Sync with Emacs 20.3.11.
+
+1999-06-17  Kenichi Handa  <handa@etl.go.jp>
+
+	* mule-diag.el (describe-current-coding-system-briefly): Fix
+	format string.
+
+1999-05-13  Ken'ichi Handa  <handa@gnu.org>
+
+	* mule-diag.el (mule-diag): Change MULE to Mule in docstring.
+
+1999-05-04  Ken'ichi Handa  <handa@gnu.org>
+
+	* mule-diag.el (describe-coding-system): Fix English message.
+
+1998-11-16  Kenichi Handa  <handa@etl.go.jp>
+
+	* japan-util.el (japanese-zenkaku-region): New optional arg
+	KATAKANA-ONLY.
+
+1998-10-30  Andreas Schwab  <schwab@delysid.gnu.org>
+
+	* mule-diag.el (describe-coding-system): Describe all flags.
+
+1998-09-06  Bill Richter  <richter@math.nwu.edu>
+
+	* mule-util.el: Doc fixes.
+
+1998-08-01  Kenichi HANDA  <handa@etl.go.jp>
+
+	* mule-diag.el (describe-current-coding-system): Check if each
+	coding category is bound to a valid coding system.
+
+	* cyril-util.el (cyrillic-encode-koi8-r-char): New funciton.
+	(cyrillic-encode-alternativnyj-char): New function.
+
+1998-07-19  Kenichi Handa  <handa@etl.go.jp>
+
+	* japan-util.el (japanese-replace-region): New function.
+	(japanese-katakana-region, japanese-hiragana-region,
+	japanese-hankaku-region, japanese-zenkaku-region): Don't change
+	point.  Use japanese-replace-region to change text.
+
+1998-06-23  Kenichi Handa  <handa@etl.go.jp>
+
+	* japan-util.el: Introduce new character code property
+	`composition'.  Add property `jisx0208' to Japanese hankaku
+	characters.
+	(japanese-kana-table): Add more data.
+	(japanese-symbol-table): Change the order of elements.
+	(japanese-katakana-region): Adjusted for the above changes.  Check
+	character code properties directly here.
+	(japanese-hiragana-region): Likewise.
+	(japanese-hankaku-region): Likewise.
+	(japanese-zenkaku-region): Likewise.
+
+1998-06-03  Richard Stallman  <rms@gnu.org>
+
+	* mule-diag.el (list-character-sets-1): New subroutine.
+	(list-character-sets): Use it.
+	(list-coding-systems-1): New subroutine.
+	(list-coding-systems): Use it.
+	(list-input-methods-1): New subroutine.
+	(list-input-methods): Use it.
+	(mule-diag): Avoid method of displaying text in *Help* then
+	copying it.
+	Instead, insert it directly into *Mule-Diagnosis*.
+	Use list-character-sets-1, list-coding-systems-1,
+	list-input-methods-1.
+	Copy the code from list-fontsets and list-coding-categories.
+	Improve the display buffer's header.
+
+1998-05-31  Richard Stallman  <rms@gnu.org>
+
+	* mule-diag.el: Many doc fixes.
+
+1998-05-30  Richard Stallman <rms@gnu.org>
+
+	* mule-diag.el (mule-diag): Don't call help-mode.  Instead, call
+	print-help-return-message.
+
+1998-05-07  Richard Stallman  <rms@psilocin.gnu.org>
+
+	* mule-diag.el (list-input-methods): Doc fix.
+
+1998-05-06  Richard Stallman  <rms@psilocin.gnu.org>
+
+	* mule-diag.el (print-coding-system): Handle (SYMBOL . SYMBOL) as
+	the flags of a type 4 coding system.
+
+1998-04-10  Eli Zaretskii  <eliz@is.elta.co.il>
+
+	* mule-diag.el (list-input-methods): Fix doc string.
+	(describe-font, describe-fontset, list-fontsets, mule-diag): Don't
+	use fontset-related features if global-fontset-alist is not bound.
+
+1999-06-29  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* japan-util.el (sentence-end-save): New variable.
+
+1998-04-06  Kenichi Handa  <handa@etl.go.jp>
+
+	* japan-util.el (setup-japanese-environment): Setup sentence-end
+	suitable for Japanese text.
+	(exit-japanese-environment): New function.
+
+1998-02-04  Kenichi HANDA  <handa@etl.go.jp>
+
+	* china-util.el (encode-hz-region): Do not bind
+	enable-multibyte-characters to nil locally.
+	
+1998-01-21  Kenichi Handa  <handa@etl.go.jp>
+
+	* mule-diag.el (describe-coding-system): Change the format of
+	showing safe charsets.
+
+	* mule-util.el (detect-coding-with-priority): New macro.
+	(detect-coding-with-language-environment): New function.
+
+1997-10-24  Kenichi Handa  <handa@etl.go.jp>
+
+	* mule-diag.el (list-input-methods): Improve the message shown
+	when LEIM is not installed.
+
+1997-10-23  Kenichi Handa  <handa@etl.go.jp>
+
+	* mule-diag.el (list-input-methods): Handle the case that title of
+	input method is not a simple string.  Show users an informative
+	message when leim is not yet installed.
+	(describe-coding-system): Print safe charasets of the coding
+	system.
+
+1999-06-30  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* mule-diag.el (print-coding-system-briefly): Use
+	`coding-system-get'; refer `alias-coding-systems'.
+	(describe-current-coding-system): Likewise.
+	(print-coding-system): Likewise [not ported yet].
+
+1997-10-21  Kenichi Handa  <handa@etl.go.jp>
+
+	* mule-diag.el (describe-coding-system): Print information about
+	coding system properties, post-read-conversion and
+	pre-write-conversion.
+
+	* mule-util.el (coding-system-post-read-conversion): Use the new
+	function coding-system-get.
+	(coding-system-pre-write-conversion): Likewise.
+	(coding-system-plist): Deleted.
+
+1997-10-19  John F. Whitehead  <jfw@cisco.com>
+
+	* mule-diag.el (describe-font): Fix prompt.
+
+1999-06-29  Kenichi Handa  <handa@etl.go.jp>
+
+	* thai-xtis-util.el (thai-xtis-text-mode): On entering Thai text
+	mode, make before-change-functions buffer local, and add
+	thai-xtis-wordseg-overlay-modification-function to it.  On exiting
+	the mode, wind up this setting.
+	(thai-xtis-word-segment): Use `binary' coding system to
+	communicate with `wordseg' program.  Decode and encode Thai text
+	explicitely.
+	(thai-xtis-wordseg-overlay-modification-function): Rewrite it to
+	be used in before-change-functions.
+	(thai-xtis-put-wordseg-overlay): Don't use overlay properties
+	modification-hooks, insert-in-front-hooks, and
+	insert-behind-hooks.
+
+1999-06-29  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* thai-xtis-util.el (thai-xtis-text-mode-map): Don't use
+	`escape-map'.
+
+1999-06-29  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* thai-xtis-util.el (setup-thai-xtis-environment): Deleted.
+	(exit-thai-xtis-environment): Deleted.
+	(thai-xtis-wordseg-coding-system): Use `tis-620'.
+
+1999-06-28  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* thai-xtis-util.el (thai-xtis-backward-delete-char): Renamed from
+	`thai-backward-delete-char'.
+
+1999-06-28  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* thai-xtis-util.el: Require `overlay'.
+	(thai-xtis-text-mode-map): Delete unused local variable
+	`helper-map'.
+	(thai-xtis-wordseg-coding-system): Renamed from
+	`thai-xtis-wordseg-coding'.
+	(thai-xtis-wordseg-info): Fix typo.
+	(thai-xtis-search-next-wordseg): Delete unused local variable
+	`point' [typo?].
+
+1999-06-28  TAKAHASHI Naoto  <ntakahas@etl.go.jp>
+
+	* thai-xtis-util.el (thai-xtis-generic-char): New variable.
+	(thai-xtis-char-regexp): New variable.
+	(thai-xtis-text-mode): Renamed from `thai-text-mode'.
+	(thai-xtis-text-mode-map): Renamed from `thai-text-mode-map';
+	bound various commands.
+	(thai-xtis-prev-auto-fill-function): New variable.
+	(thai-xtis-prev-normal-auto-fill-function): New variable.
+	(thai-xtis-text-mode): Renamed from `thai-text-mode'; new
+	implementation.
+	(thai-xtis-wordseg-program): New variable.
+	(thai-xtis-wordseg-data): New variable.
+	(thai-xtis-wordseg-args): New variable.
+	(thai-xtis-wordseg-service): New variable.
+	(thai-xtis-wordseg-server): New variable.
+	(thai-xtis-wordseg-coding): New variable.
+	(thai-xtis-wordseg-proc): New variable.
+	(thai-xtis-wordseg-buf): New variable.
+	(thai-xtis-wordseg-ready): New variable.
+	(thai-xtis-wordseg-filter): New function.
+	(thai-xtis-word-segment): New function.
+	(thai-xtis-delete-wordseg-overlay): New function.
+	(thai-xtis-wordseg-overlay-modification-function): New function.
+	(thai-xtis-get-wordseg-overlay): New function.
+	(thai-xtis-put-wordseg-overlay): New function.
+	(thai-xtis-set-wordseg-info-region): New function.
+	(thai-xtis-wordsegs-at): New function.
+	(thai-xtis-wordseg-info): New function.
+	(thai-xtis-search-next-wordseg): New function.
+	(thai-xtis-find-break-point): New function.
+	(thai-xtis-auto-fill-delay-column): New variable.
+	(thai-xtis-do-auto-fill): New function.
+	(thai-xtis-forward-word): New function.
+	(thai-xtis-backward-word): New function.
+	(thai-xtis-kill-word): New function.
+	(thai-xtis-backward-kill-word): New function.
+	(thai-xtis-transpose-words): New function.
+
+1999-05-27  SL Baur  <steve@gneiss.etl.go.jp>
+
+	* canna.el: Removed RCS magic cookies.
+	Removed bytecompile bomb if no Canna support -- we never build .elcs
+	with Canna support.
+
+1999-05-26  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* Makefile (REQUIRES): Add `apel'.
+
+1999-05-24  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* canna.el (canna:delete-last-preedit): Save `buffer-undo-list'.
+	(canna:insert-preedit): Likewise.
+
+1998-10-27  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* canna.el (canna:enter-canna-mode): Don't use
+	`buffer-disable-undo'.
+	(canna:quit-canna-mode): Don't use `buffer-enable-undo'.
+
+1998-10-26  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* canna.el: Abolish function `cancel-undo-boundary' because it is
+	defined in poem.
+
+1998-01-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* canna.el (canna-dl-module): New variable.
+
+1999-05-25  SL Baur  <steve@gneiss.etl.go.jp>
+
+	* japan-util.el (setup-japanese-environment): load Kana keyboard
+	support if using a kana keyboard.
+
+	* kana-keyboard.el: New file.
+
+1999-04-20  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* etc/TUTORIAL.th, doc/Thai/README.Mule: Convert to tis-620.
+
+1999-04-05  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* thai-xtis-util.el: Merge some features of thai-text.el by
+	Ken'ichi HANDA <handa@etl.go.jp> and
+	Virach Sornlertlamvanich <virach@links.nectec.or.th>.
+
+1999-04-01  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* ethio-util.el (ethio-fidel-to-java-buffer): Don't use ?xHHHH to
+	represent hex numbers [use #xHHHH instead].
+	(ethio-java-to-fidel-buffer): Likewise.
+
+1999-03-30  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* Makefile (ELCS): Add thai-xtis-util.elc, viet-util.elc and
+	ethio-util.elc.
+	(EXTRA_SOURCES): Delete thai.el and thai-util.el.
+
+	* thai-xtis-util.el: New file
+	[by TAKAHASHI Naoto <ntakahas@etl.go.jp>].
+
+	* viet-util.el, ethio-util.el: New files [imported from Emacs
+	20.3.7].
+
+	* thai.el, thai-util.el: Removed.
+
 1999-04-20  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
 
 	* etc/TUTORIAL.th, doc/Thai/README.Mule: Convert to tis-620.
 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
 
-VERSION = 1.31
+VERSION = 1.32
 AUTHOR_VERSION =
 MAINTAINER = SL Baur <steve@altair.xemacs.org>
 PACKAGE = mule-base
 CATEGORY = mule
 
 ELCS =	canna.elc char-table.elc chartblxmas.elc china-util.elc \
-	cyril-util.elc kana-keyboard.elc isearch-mule.elc japan-util.elc \
-	mule-cne.elc mule-diag.elc mule-keyboard.elc mule-trex.elc \
-	mule-util.elc viet-util.elc
+	cyril-util.elc kana-keyboard.elc korea-util.elc isearch-mule.elc \
+	japan-util.elc mule-cne.elc mule-diag.elc mule-keyboard.elc \
+	mule-trex.elc mule-util.elc thai-xtis-util.elc viet-util.elc
 
 # The following are shipped unbytecompiled because they aren't grokked by
 # the version of XEmacs used to build distribution packages
-EXTRA_SOURCES = thai-xtis-util.el ethio-util.el
+EXTRA_SOURCES = ethio-util.el
 
 DATA_FILES = $(shell echo etc/[FMTVa-z]*)
 DATA_DEST = mule
 auto-autoloads.el: $(ELCS:.elc=.el) $(MULE_ELCS:.elc=.el) _pkg.el
 	$(XEMACS) $(VANILLA) -batch \
 	-eval "(setq autoload-package-name \"$(PACKAGE)\")" \
-	-eval "(setq generated-autoload-file \"./auto-autoloads.el\")" \
-	 -l autoload -f batch-update-autoloads $^
+ 	-eval "(setq generated-autoload-file \"./auto-autoloads.el\")" \
+ 	-l autoload -f batch-update-autoloads $^
 
 srckit: srckit-std
 
 
 ;; Copyright (C) 1994 Akira Kon, NEC Corporation.
 ;; Copyright (C) 1996,1997,1998 MORIOKA Tomohiko
+;; Copyright (C) 1997 Stephen Turnbull
 
 ;; Author: Akira Kon <kon@d1.bs2.mt.nec.co.jp>
 ;;         MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Keywords: i18n, mule
+;;         Stephen Turnbull <turnbull@sk.tsukuba.ac.jp>
+;; Keywords: Canna, Japanese, input method, mule, multilingual
 
-;; This file part of 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
 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ;; 02111-1307, USA.
 
-;;; Synched up with: Not synched.
-
 ;;; Commentary:
 
 ;; Egg offered some influences to the implementation of Canna on
   (and (not (boundp 'CANNA))
        (fboundp 'dynamic-link)
        (dynamic-link canna-dl-module)))
- 
+
 (and canna-dl-handle
      (dynamic-call "emacs_canna_init" canna-dl-handle))
  
 ;;; china-util.el --- utilities for Chinese
 
-;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
+;; Copyright (C) 1995,1999 Electrotechnical Laboratory, JAPAN.
 ;; Licensed to the Free Software Foundation.
 ;; Copyright (C) 1997 MORIOKA Tomohiko
 
 ;;; Code:
 
 ;;;###autoload
+(defun setup-chinese-gb-environment-internal ()
+  (when (featurep 'egg)
+    (setq-default its:*current-map* (its:get-mode-map "PinYin")))
+  )
+
+;;;###autoload
 (defun setup-chinese-gb-environment ()
   "Setup multilingual environment (MULE) for Chinese GB2312 users."
   (interactive)
-  (setup-english-environment)
-
-  (set-default-coding-systems 'cn-gb-2312)
-  ;; (setq coding-category-iso-8-2 'chinese-iso-8bit)
-  (set-coding-category-system 'iso-8-2 'cn-gb-2312)
-  ;; (setq coding-category-iso-7-else 'chinese-iso-7bit)
-  ;; (setq coding-category-big5 'chinese-big5)
-
-  ;; (set-coding-priority
-  ;;  '(coding-category-iso-7
-  ;;    coding-category-iso-7-else
-  ;;    coding-category-iso-8-2
-  ;;    coding-category-big5
-  ;;    coding-category-iso-8-1
-  ;;    coding-category-emacs-mule
-  ;;    coding-category-iso-8-else))
-  (set-coding-priority-list
-   '(iso-7
-     iso-8-2
-     big5
-     iso-8-1
-     no-conversion
-     iso-8-designate
-     iso-lock-shift
-     shift-jis))
-  
-  ;; (when (eq 'x (device-type (selected-device)))
-  ;;   (x-use-halfwidth-roman-font 'chinese-gb2312 "gb1988"))))
-  (when (featurep 'egg)
-    (setq-default its:*current-map* (its:get-mode-map "PinYin")))
-  (setq default-input-method  "chinese-py-punct")
-  )
+  (set-language-environment "Chinese-GB"))
 
 ;;;###autoload
 (defun setup-chinese-big5-environment ()
   "Setup multilingual environment (MULE) for Chinese Big5 users."
   (interactive)
-  (setup-english-environment)
-
-  (set-default-coding-systems 'big5)
-  ;; (setq coding-category-iso-8-2 'chinese-big5)
-  (set-coding-category-system 'iso-8-2 'cn-gb-2312)
-  ;; (setq coding-category-iso-7-else 'chinese-iso-7bit)
-  ;; (setq coding-category-big5 'chinese-big5)
-
-  ;; (set-coding-priority
-  ;;  '(coding-category-iso-7
-  ;;    coding-category-iso-7-else
-  ;;    coding-category-big5
-  ;;    coding-category-iso-8-2
-  ;;    coding-category-emacs-mule
-  ;;    coding-category-iso-8-else))
-  (set-coding-priority-list
-   '(iso-7
-     big5
-     iso-8-2
-     no-conversion
-     iso-8-1
-     iso-8-designate
-     iso-lock-shift
-     shift-jis))
-  
-  (setq default-input-method "chinese-py-punct-b5")
-  )
+  (set-language-environment "Chinese-BIG5"))
 
 ;; ;;;###autoload
 ;; (defun setup-chinese-cns-environment ()
 ;;   "Setup multilingual environment (MULE) for Chinese CNS11643 family users."
 ;;   (interactive)
-;;   (setup-english-environment)
-;; 
-;;   (setq coding-category-iso-7-else 'chinese-iso-7bit)
-;;   (setq coding-category-big5 'chinese-big5)
-;;   (setq coding-category-iso-8-2 'chinese-big5)
-;;   (set-default-coding-systems 'chinese-iso-7bit)
-;; 
-;;   (set-coding-priority
-;;    '(coding-category-iso-7
-;;      coding-category-iso-7-else
-;;      coding-category-iso-8-2
-;;      coding-category-big5
-;;      coding-category-iso-7-else))
-;; 
-;;   (setq-default buffer-file-coding-system 'chinese-iso-7bit)
-;;   (setq default-terminal-coding-system 'chinese-iso-7bit)
-;;   (setq default-keyboard-coding-system 'chinese-iso-7bit)
-;; 
-;;   (setq default-input-method "chinese-quick-cns"))
+;;   (set-language-environment "Chinese-CNS"))
 
 ;; Hz/ZW encoding stuffs
 
 ;; Regexp of ZW sequence to start GB2312.
 (defvar zw-start-gb "^zW")
 ;; Regexp for start of GB2312 in an encoding mixture of HZ and ZW.
-(defvar hz/zw-start-gb (concat hz-gb-designnation "\\|" zw-start-gb))
+(defvar hz/zw-start-gb
+  (concat hz-gb-designnation "\\|" zw-start-gb "\\|[^\0-\177]"))
 
 (defvar decode-hz-line-continuation nil
   "Flag to tell if we should care line continuation convention of Hz.")
 
+(defconst hz-set-msb-table
+  (let ((str (make-string 127 0))
+	(i 0))
+    (while (< i 33)
+      (aset str i i)
+      (setq i (1+ i)))
+    (while (< i 127)
+      (aset str i (+ i 128))
+      (setq i (1+ i)))
+    str))
+
 ;;;###autoload
 (defun decode-hz-region (beg end)
   "Decode HZ/ZW encoded text in the current region.
   (interactive "r")
   (save-excursion
     (save-restriction
-      (narrow-to-region beg end)
+      (let (pos ch)
+	(narrow-to-region beg end)
 
-      ;; We, at first, convert HZ/ZW to `iso-2022-7bit',
-      ;; then decode it.
+	;; We, at first, convert HZ/ZW to `cn-gb-2312',
+	;; then decode it.
 
-      ;; "~\n" -> "\n"
-      (goto-char (point-min))
-      (while (search-forward "~" nil t)
-	(if (= (following-char) ?\n) (delete-char -1))
-	(if (not (eobp)) (forward-char 1)))
+	;; "~\n" -> "\n", "~~" -> "~"
+	(goto-char (point-min))
+	(while (search-forward "~" nil t)
+	  (setq ch (following-char))
+	  (if (or (= ch ?\n) (= ch ?~)) (delete-char -1)))
 
-      ;; "^zW...\n" -> Chinese GB2312
-      ;; "~{...~}"  -> Chinese GB2312
-      (goto-char (point-min))
-      (let ((chinese-found nil))
+	;; "^zW...\n" -> Chinese GB2312
+	;; "~{...~}"  -> Chinese GB2312
+	(goto-char (point-min))
+	(setq beg nil)
 	(while (re-search-forward hz/zw-start-gb nil t)
-	  (if (= (char-after (match-beginning 0)) ?z)
-	      ;; ZW -> iso-2022-7bit
-	      (progn
-		(delete-char -2)
-		(insert iso2022-gb-designation)
-		(end-of-line)
-		(insert iso2022-ascii-designation))
-	    ;; HZ -> iso-2022-7bit
-	    (delete-char -2)
-	    (insert iso2022-gb-designation)
-	    (let ((pos (save-excursion (end-of-line) (point))))
-	      (if (search-forward hz-ascii-designnation pos t)
-		  (replace-match iso2022-ascii-designation)
-		(if (not decode-hz-line-continuation)
-		    (insert iso2022-ascii-designation)))))
-	  (setq chinese-found t))
-	(if (or chinese-found
-		(let ((enable-multibyte-characters nil))
-		  ;; Here we check if the text contains EUC (China) codes.
-		  ;; If any, we had better decode them also.
-		  (goto-char (point-min))
-		  (re-search-forward "[\240-\377]" nil t))) 
-	    (decode-coding-region (point-min) (point-max) 'cn-gb-2312)))
-
-      ;; "~~" -> "~"
-      (goto-char (point-min))
-      (while (search-forward "~~" nil t) (delete-char -1))
+	  (setq pos (match-beginning 0)
+		ch (char-after pos))
+	  ;; Record the first position to start conversion.
+	  (or beg (setq beg pos))
+	  (end-of-line)
+	  (setq end (point))
+	  (if (>= ch 128)		; 8bit GB2312
+	      nil
+	    (goto-char pos)
+	    (delete-char 2)
+	    (setq end (- end 2))
+	    (if (= ch ?z)			; ZW -> cn-gb-2312
+		(progn
+		  (translate-region (point) end hz-set-msb-table)
+		  (goto-char end))
+	      (if (search-forward hz-ascii-designnation
+				  (if decode-hz-line-continuation nil end)
+				  t)
+		  (delete-char -2))
+	      (setq end (point))
+	      (translate-region pos (point) hz-set-msb-table))))
+	(if beg
+	    (decode-coding-region beg end 'cn-gb-2312)))
       (- (point-max) (point-min)))))
 
 ;;;###autoload
       ;; Chinese GB2312 -> "~{...~}"
       (goto-char (point-min))
       (if (re-search-forward "\\cc" nil t)
-	  (let ((enable-multibyte-characters nil)
-		pos)
+	  (let (pos)
 	    (goto-char (setq pos (match-beginning 0)))
 	    (encode-coding-region pos (point-max) 'iso-2022-7bit)
 	    (goto-char pos)
 (defun setup-cyrillic-iso-environment ()
   "Setup multilingual environment (MULE) for Cyrillic ISO-8859-5 users."
   (interactive)
-  (setup-8-bit-environment "Cyrillic-ISO" 'cyrillic-iso8859-5
-			   'iso-8859-5 "cyrillic-yawerty"))
+  (set-language-environment "Cyrillic-ISO"))
 
 ;;;###autoload
 (defun setup-cyrillic-koi8-environment ()
   "Setup multilingual environment (MULE) for Cyrillic KOI8 users."
   (interactive)
-  (setup-8-bit-environment "Cyrillic-KOI8" 'cyrillic-iso8859-5 'koi8-r
-			   "cyrillic-yawerty"))
+  (set-language-environment "Cyrillic-KOI8"))
 
 ;;;###autoload
 (defun setup-cyrillic-alternativnyj-environment ()
   "Setup multilingual environment (MULE) for Cyrillic ALTERNATIVNYJ users."
   (interactive)
-  (setup-8-bit-environment "Cyrillic" 'cyrillic-iso8859-5
-			   'alternativnyj "cyrillic-yawerty")
-  ;; (setq coding-category-raw-text 'alternativnyj)
-  )
+  (set-language-environment "Cyrillic-ALT"))
+
+;;;###autoload
+(defun cyrillic-encode-koi8-r-char (char)
+  "Return KOI8-R external character code of CHAR if appropriate."
+  (aref (char-table-extra-slot cyrillic-koi8-r-nonascii-translation-table 0)
+	char))
+
+;;;###autoload
+(defun cyrillic-encode-alternativnyj-char (char)
+  "Return ALTERNATIVNYJ external character code of CHAR if appropriate."
+  (aref (char-table-extra-slot
+	 cyrillic-alternativnyj-nonascii-translation-table 0)
+	char))
 
 
 ;; Display 
-		      ==============================
-		      GNUEMACS ���ҭ���� (Mule) ���ͧ��
-		      ==============================
-
-�����˵�:       �͡��é�Ѻ���ͧ�鹹�� �١��¹������ִ��ѡ������ "�ͧ�����´ա������¹���"
-               ��÷Ѵ���������鹴��� ">>" ���դ������� ���仨���������
-
-     �·���� ��û�͹��������Ѻ Mule �������� �����͹��� (������躹˹�������� ��¹���
-��� CTRL ���� CTL) ���� ���� META (�»��� ���¶֧���� ESC)  㹷���� ��Ҩ����ѭ�ѡɳ����
-��� ᷹�����¹��� � ��� CONTROL ���� META
-
-C-<����ѡ��>     ���¶֧ ��顴�����͹��Ť�ҧ��� ���ǡ����� <����ѡ��>   ������ҧ�� C-f
-               ���¶֧ ��顴�����͹��Ť�ҧ��� ���ǡ����� f
-<<Blank lines inserted here by startup of help-with-tutorial>>
-       >> �͹��������ͧ�� C-v (View Next Screen ��˹�ҵ���) ��  ��������͹���ҹ˹��
-          ����
-          ��ͨҡ����繵��  �ء���駷����ҹ˹��˹�� � ��������㹷ӹͧ���ǡѹ ��������͹�
-          ��˹�ҵ���
-
-ESC <����ѡ��>   ���¶֧ ��顴���� ESC ���ǻ���� ��ѧ�ҡ��鹨֧������ <����ѡ��> ���
-
-�����˵�:       <����ѡ��> �������繵���˭����͵����� ����������������͹�ѹ����Ͷ١���
-               �����   ����ҡ�ջ��� META ��顴 �������ö���á� M-<����ѡ��> ᷹
-               ��� ESC <����ѡ��> ��  (�����顴���� META ��ҧ��� ���Ǩ֧�� <����ѡ��>)
-
-����Ӥѭ:        ���Ҩ���ԡ�� Emacs ��顴 C-x C-c  ����㹡óշ����� Emacs �ҡ csh
-               ������ö�� suspend (��ش���Ǥ���) ��  ��� suspend Emacs ������
-               �� C-z
-
-     ��ͨҡ���  ������͹����� C-v �ء � ���駷����ҹ��˹��˹��
-
-     ����˹�ҷ�����ǡѺ˹�ҶѴ� ���������ҫ�ӡѹ����ҧ��÷Ѵ  ������蹹�� �������������ö���
-����� �����ҷ���ʴ������� ������ͧ�ѹ����
-
-
-     ��͹��� ���繨е�ͧ����Ըա���¡���µ��˹���� ����������������¡�͹  ������͡�
-���� ���� C-v ������Ѻ����͹仢�ҧ˹��  ��Ҩ�����͹��Ѻ������ ����顴 ESC v
-
-      >> �ͧ�� ESC v ��� C-v ��������͹��Ҵ� �ѡ�ͧ�������
-
-��ػ
-===
-     ����� ����Ѻ����͹��ҷ���˹��������������� ���
-
-     C-v     ����͹仢�ҧ˹�� ˹��˹�Ҩ�
-     ESC v   ����͹仢�ҧ��ѧ ˹��˹�Ҩ�
-     C-l     ��¹˹�Ҩ����� ���㹢�����ǡѹ ���������͹���˹觢ͧ�������� (cursor)
-             �����ç��ҧ��
-
-       >> ������ѧࡵ����� 㹢�й�����������������˹ �������駨Ӣ�ͤ�����������ͺ��ҧ�ͧ
-          �����������  �����ͧ�� C-l ��   ��Ǩ�ͺ����� ������������͹��������˹
-          ��ͤ�����������ͺ��ҧ����¹����ҧ��
-
-�Ը��¡�������������鹾�鹰ҹ
-=======================
-
-     �͹��� ��ҡ�����Ը��¡�������Ẻ����˹������  ���� �������¹����Ը��¡����价����˹��
-���˹�˹������˹�����ǡѹ �������ö���������Ը�  �Ը�˹�觡������������ 仺�÷Ѵ��͹˹��
-(previous) 仺�÷Ѵ���� (next) 仴�ҹ˹�� (forward) 仴�ҹ��ѧ (backward)  �����
-����ҹ�� �١�������� C-p C-n C-f ��� C-b ����ӴѺ  ��觨з�����¡��������� ����º�Ѻ
-���˹觻Ѩ�غѹ  ��ػ��¹��Ἱ�Ҿ��ѧ���
-
-
-			      ��÷Ѵ������� C-p
-                                    :
-                                    :
-   ����ѡ�ô�ҹ��ѧ C-b  ....  ���˹���������Ѩ�غѹ  ....   ����ѡ�ô�ҹ˹�� C-f
-                                    :
-                                    :
-			      ��÷Ѵ���� C-n
-
-
-     ���������ҹ�� ����Ҩҡ����ѡ�õ���á�ͧ ����� Previous Next Backward Forward
-��觨Ъ�������������ҡ  ���������ҹ���繤��������Ѻ����¡���¢�鹾�鹰ҹ ��觵�ͧ����������
-
-       >> �ͧ�� C-n ������ � ����  ��������͹�����������ѧ��÷Ѵ��� (��÷Ѵ�����ѧ��ҹ
-          ������)
-
-       >> �ͧ�� C-f ������ � ����  ��������͹����������ѧ�ç��ҧ�ͧ��÷Ѵ �����ͧ
-          �� C-p ����͹��鹢�ҧ����  �ѧࡵ�ٴ������ ���˹觢ͧ������������¹����ҧ��
-
-       >> �ͧ�� C-b ��з����������˹�˹���ش�ͧ��÷Ѵ��  �ѧࡵ�ٴ������ ������������͹
-          ����ҧ��  �ҡ�����顴 C-b �ա�ͧ�������  ���ǡ� C-f ��������͹��ѧ�����ش
-          �ͧ��÷Ѵ��  ��������������ҧ�� ��ҡ�����·��º�÷Ѵ�
-
-
-     ���ҷ������͹�������� ����º�÷Ѵ�á�ش���ͺ�÷Ѵ�����ش�ͧ˹���  ���������
-����͹��ѧ��÷Ѵ����㹷�ȷҧ��� �  ��л�Ѻ������������Ѻ�����躹˹�Ҩ�����
-
-       >> �ͧ�� C-n ��������͹�������������º�÷Ѵ��ҧ�ش�ͧ˹�Ҩʹ�  �����ѧࡵ�����
-          �Դ���â�� ��е��˹觢ͧ������������¹����ҧ��
-
-     �������֡��ҡ�â�Ѻ价��е���ѡ�ù���״�Ҵ�״�Ҵ  ������ö��������͹��������价��Ф�
-��  �� ESC f �����������͹仢�ҧ˹��˹�觤� ��� ESC b �����������͹仢�ҧ��ѧ˹�觤�
-
-�����˵�:        ����Ѻ������  �ѧ�������ö���¡���˹觢ͧ����١��ͧ  �֧���
-                ����ö���ͧ����觹����
-
-       >> �ͧ�� ESC f ��� ESC b �ͧ������ � ����  ����ͧ�������Ѻ C-f �Ѻ C-b ��
-          ����
-
-     ���ѧࡵ�������� ESC f ��� ESC b ���ٻẺ����¤�֧�Ѻ C-f ��� C-b  ����ǹ�˭�
-ESC <����ѡ��> ��������ǡѺ��èѴ��â�ͤ���  ��ǹ C-<����ѡ��> ����Ѻ��觷���繾�鹰ҹ�ҡ
-���� (�� ����ѡ�� ���� ��÷Ѵ)
-
-     C-a �Ѻ C-e �繤���觹�Ҩ�������  ���Ф�͹��ҧ�дǡ�շ�����  C-a ������Ѻ����͹
-��������价����˹�˹���ش�ͧ��÷Ѵ  C-e ����Ѻ����͹价����˹觷����ش�ͧ��÷Ѵ
-
-
-       >> �ͧ�� C-a ���ͧ����  ��ѧ�ҡ�����顴 C-e ���ͧ����  �����ͧ�ѧࡵ����� ���
-          ������觹���ҡ�����ͧ���� ���������������͹����������˹���ҡ���ҹ���ա
-
-     �ѧ���ա�ͧ����� ����Ѻ�������͹��������Ẻ���� � ��� ����� ESC < ����Ѻ�������͹
-��������价����˹��á�ش�ͧ��������� ��Ф���� ESC > ����Ѻ�������͹仵��˹觷����ش
-
-     ������¡���˹觢ͧ��ͤ��� �������������������� "�ش (point)"  ���;ٴ�ա���ҧ˹����
-��� �������� ����觷��͡������������ �ش ����ç�˹�ͧ˹�Ҩ�
-
-     ��ػ���������Ѻ�������͹��� �������������͹����˹��¢ͧ�� ˹��¢ͧ��÷Ѵ������
-��ѧ���
-
-     C-f     仢�ҧ˹��˹�觵���ѡ��
-     C-b     ��Ѻ��ҧ��ѧ˹�觵���ѡ��
-
-     ESC f   仢�ҧ˹��˹�觤�
-     ESC b   ��Ѻ��ҧ��ѧ˹�觤�
-
-     C-n     ����͹仺�÷Ѵ����
-     C-p     ����͹仺�÷Ѵ�������
-
-     ESC ]   ����͹仵��˹觷����ش�ͧ���˹�� (paragraph)
-     ESC [   ����͹仵��˹��á�ش�ͧ���˹��
-
-     C-a     ����͹仵��˹��á�ش�ͧ��÷Ѵ
-     C-e     ����͹仵��˹觷����ش�ͧ��÷Ѵ
-
-     ESC <   ����͹仵��˹��á�ش�ͧ���������
-     ESC >   ����͹仵��˹觷����ش�ͧ���������
-
-       >> �ͧ���������Ф���觴�  ���������ҹ���繤���觷����ѹ�����ش  ������ͧ�������ѧ
-          ������͹�������� ��ѧ������͹��ҧ��  ����ͧ������ C-v ��� ESC v ����
-          ����͹���������Ѻ�ҷ��ç���
-
-     ����Ѻ�������� � �ͧ Emacs ���蹡ѹ  ���������ҹ�������ö����������͡ (argument) 
-���͡�˹� �ӹǹ���� 㹡�û�Ժѵԧҹ��   ��á�˹��ӹǹ���� �����¡� C-u ���ǵ��
-���¨ӹǹ���駷���ͧ��á�͹ ���Ǩ֧���¡�����觵��
-
-     ������ҧ��  ����� C-u 8 C-f ���¶֧ �������͹仢�ҧ˹�� 8 ����ѡ��
-
-       >> ����ͧ��˹��ӹǹ���駷�������������Ѻ����� C-n ���� C-p ��������͹��������
-          �������������÷Ѵ�������ҡ����ش��ҷ��з��� 㹡������͹���������������
-
-     ����Ѻ C-v ��� ESC v �����ᵡ��ҧ��ѡ��硹���  㹡óչ�� ���繡������͹˹�Ҩ�
-���ŧ ����ӹǹ��÷Ѵ᷹
-
-       >> �ͧ�� C-u 3 C-v ��
-
-     ����͹��Ѻ���������� C-u 3 ESC v
-
-�����¡��ԡ
-=========
-
-     ����� C-g ������Ѻ���¡��ԡ����觵�ҧ � ����ͧ��á�û�͹�������������  ������ҧ��
-�����ҧ�����������͡ (argument) ���� ���������ҧ����觷���ͧ��á������ҡ���� 2 ��������  ���
-�ҡ��ͧ���¡��ԡ ����顴 C-g
-
-       >> �ͧ��˹��ӹǹ��������� 100 �¡�á� C-u 100 ���ǡ� C-g ��  ��ѧ�ҡ���
-          ����ͧ�� C-f �� �����ѧࡵ�����������������͹仡�����ѡ��  ���͵͹����Ҵ仡�
-          ESC ��������  ������ö�� C-g ¡��ԡ��
-
-��ͼԴ��Ҵ (Error)
-================
-
-     㹺ҧ���� �Ҩ���ա����觻�Ժѵԧҹ�ҧ���ҧ ��� Emacs ����Ѻ������Դ���  ������ҧ��
-��á�����觤͹��źҧ����� ���������˹����� Emacs ��з���� Emacs �����§��͹
-����ʴ��ŷ���÷Ѵ��ҧ�ش�ͧ�� �͡��ҼԴ��Ҵ���ҧ��
-
-     ����觺ҧ����觷����¹�����͡��é�Ѻ��� �Ҩ�������Ѻ Emacs �ҧ��� (version) ��觨�
-������ա���ʴ��Ţ�ͼԴ��Ҵ (error) ���   㹡óչ�� ����顴�������á��� ��������͹��ѧ��ǹ
-����
-
-�Թ��� (Window)
-==============
-
-     Emacs ����ö�Դ�Թ����������ѹ�����Թ��� ������Թ�������ҹ���ʴ��Ţ�ͤ���
-��ҧ � �����ͧ�����  ��͹��� ���èзӤ������ѡ�Ѻ����� ���������Ѻ���ź�Թ�����ǹ�Թ
-����ҷ���ʴ����Ѿ��ͧ����觺ҧ����� ���� Help �͡���¡�͹
-
-     C-x 1             ��������Թ�������
-
-     ����� C-x 1 ������Ѻź�Թ������  ���Ǣ����Թ�������������������  ����������
-�Թ�������
-
-       >> �������͹���������ҷ���÷Ѵ���  ���ǡ� C-u 0 C-l
-
-       >> �ͧ�� C-h k C-f ��  �����ѧࡵ������Թ���������¹����ҧ�� ��������Թ���������
-          ͸Ժ���Ը������� C-f ��ҡ����
-
-       >> �ͧ�� C-x 1 ����ź�Թ���������������� �͡
-
-����á (insert) ��� ���ź (delete)
-===================================
-
-     �� Emacs ��Ҩ�����ö��������ѡ����������� ����͵�ͧ��þ�����ͤ���  Emacs ��
-�����ҵ��˹ѧ��ͷ���ͧ�����ء��� (�� 'A' '7' '*' '�' ������ �) �繢�ͤ�������ͧ��è�
-�á (insert) ���仵ç �  ����ͨШ���÷Ѵ ��顴 <Return> ��������ѡ�â�鹺�÷Ѵ����
-(linefeed character) ����
-
-     ��顴 <Delete> ����͵�ͧ��è�ź����ѡ�÷����觾��������  <Delete> ���¶֧������¹
-�����˹�������� "Delete"  ���ͺҧ���Ҩ����¹��� "Rubout" ����   �·���� <Delete>
-������Ѻź����ѡ�÷�������͹˹�ҵ��˹���������Ѩ�غѹ
-
-       >> �ͧ��������ѡ���������� � ���  ������ <Delete> ź����ѡ������ҹ�鹷��
-
-       >> �ͧ������ͤ���ŧ�����Թ�ͺ��� (right margin)  ���ҷ�������ͤ�������
-          ����Թ�������ҧ�ͧ˹�觺�÷Ѵ  ��÷Ѵ��鹡�� "�١���" �������Թ˹��˹�Ҩ�
-	  ���������ͧ���� '\' �����ͺ����ش ���ͺ͡��������Һ�÷Ѵ����ѧ�յ��  Emacs ��
-	  ����͹ (scroll) ˹�Ҩ����������繵��˹觷����ѧ������������ҧ�Ѵਹ  ����ҡ
-	  �ͺ������͢ͺ���¢ͧ������ͧ���� '\' ���� ���繡�ú͡��������� ��÷Ѵ����ѧ�յ��
-	  �㹷�ȷҧ��� �
-
-     �ͧ��ԺѵԴ���� ���Ъ���������㨧��¡��ҡ��͸Ժ�´��µ��˹ѧ���
-
-       >> ����Ѻ�����������麹��÷Ѵ��觶١����������Թ˹��˹�Ҩ� �����觻�͹���������
-          �ѡ������  ������ C-d ź��ͤ����͡�ҧ��ǹ ��������Ǣͧ��ͤ�����������˹��
-	  ��÷Ѵ  �ѧࡵ���������ͧ���� '\' ������
-
-       >> �������͹����������������˹��á�ش�ͧ��÷Ѵ ���ǡ� <Delete> ��  ��÷�
-          Ẻ��� �з�����ѭ�ѡɳ��������ҧ��÷Ѵ�١ź�͡�  ��÷Ѵ��鹡�ж١���仵�͡Ѻ
-	  ��÷Ѵ��͹˹�ҹ�� ����ѹ�繺�÷Ѵ��Ǻ�÷Ѵ���� ����Ҩ�����ѭ�ѡɳ��ͺ�÷Ѵ
-	  ��ҡ����
-
-       >> ��顴 <Return> �������� ����ѡ�â�鹺�÷Ѵ���� ��Ѻ����ҧ���
-
-     �������ǹ�˭�ͧ Emacs ������ö��˹��ӹǹ���駷���ͧ�����黯Ժѵ���  �����駡��
-�á (insert) ����ѡ�ô���
-
-
-       >> �ͧ��͹����� C-u 8 * ��  �ѧࡵ������Դ���â��
-
-     ��ҵ�ͧ��è�������÷Ѵ��ҧ � (blank line) �����ҧ�ͧ��÷Ѵ  �������͹价����˹�
-�á�ش�ͧ��÷Ѵ����ͧ  ���ǡ� C-o
-
-       >> �������͹价����˹��á�ش�ͧ��÷Ѵ㴡���  �����ͧ�� C-o ��
-
-     �֧�ç���  ��ҡ������¹�Ըվ�鹰ҹ����Ѻ��û�͹��ͤ��� ��С������Դ����  �͡�ҡ��
-ź����е���ѡ������  �ѧ�դ���觫������ö��ź����繤� � �����繺�÷Ѵ � �ա����  ��ػ
-���������Ѻ���ź��ѧ���
-
-     <Delete>       ź����ѡ�÷������˹����������
-     C-d            ź����ѡ�÷����������������
-
-     ESC <Delete>   ź�ӷ������˹����������
-     ESC d          ź�ӵ������˹觷��������������
-
-     C-k            ź��÷Ѵ�������˹觷��������������
-
-     㹺ҧ���� ����Ҩ��ͧ��è������ǹ���ź仡�Ѻ�׹��   ����� Emacs �Ш���ǹ���ź
-�͡��� ���ҷ��ź��ͤ����˹��·���ҡ����˹�觵���ѡ��   ��������� C-y ���ҷ���ͧ��è����
-��ͤ�����Ѻ�׹  ��觷�������ѧ���� C-y �����������§����˹觷��ź��ͤ����͡��ҹ��  ���
-��Ѻ���˹�㴡���  C-y �繤��������Ѻ�á��ͤ����������� ŧ㹵��˹觷����������������
-�������ö���������ö���㹡������͹���¢�ͤ�����
-
-     ���������Ѻ���ź�������ͧẺ��� ����� "Delete" �Ѻ ����� "Kill"  ����� "Kill"
-������ǹź�͡��� ������ "Delete" �������  �����ҡ�����觹������ � ����  �����
-��ǹ���ź�͡������
-
-      >> ��顴 C-n �ѡ�ͧ������� ��������͹��ѧ��������������˹�Ҩ� �����ͧ�� C-k ����
-         ź��÷Ѵ����͡��
-
-     ����͡� C-k �����á ��ͤ���㹺�÷Ѵ��鹨ж١ź�͡  �������͡��ա C-k �ա���� ��÷Ѵ
-����ͧ��駺�÷Ѵ��ж١ź�͡仴���  ���ҡ�˹��ӹǹ�������Ѻ����� C-k ������¶֧ ���ź
-��÷Ѵ�͡ (�����������е�Ǻ�÷Ѵ) �繨ӹǹ��÷Ѵ ��ҡѺ�ӹǹ���駷���˹�
-
-     ��÷Ѵ������ź�͡� �ж١����� �������ö�ӡ�Ѻ�׹���� �������� C-y
-
-       >> �ͧ�� C-y ��
-
-     ��ͤ������١ź�͡ �¡�á� C-k ���� � ����  �ж١���Ǻ������ �������ö��
-��Ѻ�ҷ�������㹤������� �¡�á� C-y
-
-       >> �ͧ�� C-k ������ � ����
-
-       >> ���������Ѻ���¡��ͤ�����Ѻ�� ��� C-y   ��͹����������͹��������ŧ仢�ҧ��ҧ
-          �ѡ�ͧ�����÷Ѵ  �����ͧ�� C-y �� �������ö�Ѵ�͡ (copy) ��ͤ�����
-
-     ��ҵ͹����红�ͤ������úҧ���ҧ���  ����ź��ͤ���������������ա ���Դ���â��
-���Ѿ���� C-y �����¡�׹������§��ͤ������ź�͡��������ش��ҹ��
-
-
-       >> �ͧź��÷Ѵ��˹�觺�÷Ѵ  ��������͹��������价�����  ����ź��÷Ѵ�͡���ա˹��
-          ��÷Ѵ  �ͧ�� C-y �� �����ѧࡵ����Ҩ�������§��÷Ѵ����ͧ�׹��ҹ��
-
-����ѹ�� (UNDO)
-=============
-
-     ���ҷ����䢢�ͤ����ҧ���ҧ ���ǵ�ͧ��è�����¹��Ѻ��������ҧ���  ������ö����ء
-����ʹ��¤���� C-x u   �»��� ��������Ѻ¡��ԡ����� ����͹������������  ����ö��
-����觹������駡�������ͧ���
-
-       >> �ͧź��÷Ѵ����͡�� ���¤���� C-k �������¡��Ѻ�׹�Ҵ��� C-x u
-
-     ����� C-_ ���繤�����ѹ���ա�ѹ˹��  ��������ö����͹�Ѻ����� C-x u
-
-     ����ö��˹��ӹǹ����������� C-_ ��� C-x u ��
-
-
-��������� (File)
-==============
-
-     ��Ҩ��繵�ͧ���ѡ�� (save) ��ͤ����������������������  ��ҵ�ͧ��è������觷��
-�������¹����ҧ����  ����蹹�� ��觷�����仡������ �ѹ�շ����ԡ����� Emacs
-
-     ��������ŷ���ͧ������� �����觷��ѹ�֡��觷����ѧ�������  ���;ٴ���� � ������������ŷ���ͧ���
-�����͵����������ŷ����ѧ�������
-
-     �訹������������Ũж١���ѡ�� (save) ŧ�  ��������ŷ��١������� �����١��¹�Ѻ
-ŧ����ҧ�索Ҵ  �ѹ��������繡�û�ͧ�ѹ�����¹�Ѻ��������ŷ������Ẻ���� � ��ҧ �
-����������
-
-     �͡�ҡ��� �����繡�û�ͧ�ѹ������ѡ�� (save) ��觷����䢼Դ���������  Emacs
-������¹������������ŵ鹩�Ѻ�������� ��͹������ѡ��
-
-�����˵�:       Emacs �ѧ�ա�û�ͧ�ѹ�غѵ��˵ط��Ҵ���֧ �¡�����ѡ����������ŷ����ѧ
-               ������������� � ���������������ŵ�ҧ�ѹ  �����Ըչ�� �з��������öŴ
-               ����������·���Ҩ�Դ�����  �����·���ش��ҷ��з���
-
-     �ç��ǹ��ҧ�ͧ�� ���պ�÷Ѵ���� (mode line) ��ѡɳТ�ҧ��ҧ�ʴ�����
-
-
-(������ҧ) [--]J:--**-Mule: TUTORIAL.th    (Fundamental) ---55%--------------
-
-
-     ��Ѻ���Ңͧ Tutorial �ͧ Emacs �����ѧ��ҹ��������� TUTORIAL.th  ���ҷ����������
-������������� find-file (������������� ������ҹ�����㹺ѿ����) ����ʴ�����������������
-�ç��ǹ TUTORIAL.th  ������ҧ�� �������������������Ū��� new-file  ��÷Ѵ��������ʴ�
-����� "Mule: new-file"
-
-�����˵�:       ���դ�͸Ժ�������������ǡѺ��÷Ѵ���� (mode line) 㹵͹��ѧ
-
-     ������������������� ��Ф����������ѡ����������� ���ѡɳ�ᵡ��ҧ�ҡ����觷���ҹ � ��
-�ç��� ��Сͺ仴��� 2 ����ѡ�� ��͵�ͧ������觺ҧ���ҧ �����ѧ����� C-x ������¶֧�����
-����ǡѺ���������
-
-     ����ա�ش˹�� ��ᵡ��ҧ�ҡ����觷���ҹ�Ҥ�� ���������������������� ��Ҩж١ Emacs
-������ͧ͢��������Ź�� �  ������¡���������ҹ����� ����觻����������������͡ (argument)
-�ҡ�����Թ��
-
-�����˵�:       㹷���� ������͡ (argument) ��ͪ������������
-
-                    C-x C-f   �������� (find) ���������
-
-     ���� Emacs �ж�����ͧ͢��������� �»�ҡ���鹷����ǹ��ҧ�ͧ��  ������¡��ǹ�������͹
-������������Ź����� �ԹԺѿ���� (mini buffer)  �ԹԺѿ����ж١��ҹ��ѡɳй��  �ԹԺѿ����
-�����˹�ҷ��������� ��ѧ�ҡ����͹������������� ���ǡ����� <Return> 
-
-       >> �ͧ�� C-x C-f ���ǵ������ C-g ��  �繡�����¡��ԡ��������ԹԺѿ���� ����
-          ¡��ԡ����� C-x C-f  �ѧ��� Emacs ������������������ �
-
-     ���ǹ�� ���ͧ���ѡ����������Ŵ�  ���ҷ���ͧ������ѡ����觷������Ҩ��֧�͹��� �������
-����觴ѧ���
-
-     C-x C-s   ���ѡ�� (save) ���������
-
-     ���������ҷ������� Emacs ��ж١��¹ŧ价�����������  �������ѡ����������� ���������
-�鹩�Ѻ������٭���� ��ж١�����㹪�������  ������Ҩҡ������ҷ���ͷ��´��� '~'
-
-     ��ѧ�ҡ������ѡ�������������������  Emacs ����ʴ�������������ŷ��������
-
-       >> �ͧ�� C-x C-x �������ѡ�����Ңͧ Tutorial ����  ��������� �����ǹ��ҧ
-          �ͧ�� �բ�ͤ������ "Wrote ...../TUTORIAL.th" ��ҡ����
-
-     ���ҷ������ҧ�������������  ��������ǡѺ��ҨФ��� (find-file) �����������ҫ����
-�����͹˹�ҹ������  ���Ǿ�����ͤ���ŧ����������ŷ������
-
-     ������ҷ��������ѡ�������������ҹ��  ��͵͹��� Emacs ���������ҷ������ҷ����� ŧ
-�����������繤����á
-
-
-�ѿ���� (Buffer)
-===============
-
-     ����ҡ������������������ѹ����ͧ ���¤���� C-x C-f  �����Ңͧ����������á ����ѧ��
-�١���ѡ������� Emacs  ��觷�����ѡ����������ŷ����ҹ����� ����������� Emacs ���¡���
-�ѿ���� (Buffer)  ���ҷ����ҹ������������������ Emacs ������ҧ�ѿ�������� ���������
-
-     ��ҵ�ͧ��èд���¡�âͧ�ѿ���� ���١���ѡ���������� Emacs  ����顴�����
-
-     C-x C-b
-
-       >> �ͧ�� C-x C-b ��  �ѧࡵ��������кѿ�����ժ����������  ��ж١��駪���������
-          ���ҧ�� � Emacs
-
-     �պҧ�ѿ���� �������դ��Ѻ��������Ũ�ԧ �  ������ҧ�� �������������ŷ���ժ������ "*Buffer
-List*" �����ԧ �  ���繺ѿ���������ҧ����������ʴ���¡�úѿ���� �¤���� C-x C-b
-
-     ��ͤ����ء��ͤ�������ҡ�������Թ���ͧ Emacs ��� ������㹺ѿ����㴺ѿ����˹������
-
-       >> �ͧ�� C-x 1 ����ź��¡�úѿ�����͡��
-
-     ������¡�����������蹢������� �͹�����ѧ������������˹��������  ������������������
-�á�١���ѡ��  ��觷�����������������á�ж١�ѹ�֡���㹺ѿ����ͧ��������Ź�� ��ҹ��
-
-     ������ҧ�ѿ���������� ����Ѻ�������������ѹ����ͧ ���������úҧ���ҧ㹺ѿ������
-������ռ�� � ��ͺѿ����ͧ����������ѹ���˹�觷�����  �ش�����������ö������������á�������
-���㹵͹��ѧ
-
-     �����ҷ���ͧ��è����ѡ�� (save) �ѿ����ŧ����������� ���¤���� C-x C-s ���
-�е�ͧ��Է����ѧ�ѿ�������ͧ��è��� ���¤���� C-x C-f ��觤�͹��ҧ����ҡ  ����դ���觫��
-������Ѻ��ù����੾�� ���
-
-     C-x s   ���ѡ�� (save) �ء�ѿ������������
-
-     C-x s �����ѡ�ҷء�ѿ������١���������� ŧ���������� �¨ж����͹��Ҩ����
-�纺ѿ��������� y ���� n �Ѻ�ѿ�������кѿ����  �Ӷ���л�ҡ����ǹ��ҧ�ͧ˹�Ҩ� �ѧ
-������ҧ���
-
-             Save file  /usr/private/yours/TUTORIAL.th? (y or n)
-
-
-
-��â��¤���� (extension)
-=======================
-
-     ������ Editor ��� �ըӹǹ������ҡ���� �ӹǹ����觫������ö�����»����͹���
-���ͻ��� META �����  ����觢��� (eXtend) ����������������ö����������ҹ������� ������ 2
-Ẻ �ѧ���
-
-     C-x     �����������µ���ѡ�� ����Ѻ������ѡ�õ������ 1 ���
-     ESC x   �����������ª��ͤ���� ����Ѻ�����ͤ���觵�����价�����
-
-     ����觻�������� ���繤���觷���ջ���ª��  ����ǹ�˭�ж١���¡�� ���¤��駡��Ҥ���觷����
-������ҧ�� ���������������� (find) C-x C-f  ��������ѡ����������� (save) C-x C-s
-����� C-x C-c (��ԡ Editor) ��ҧ����˹��㹤��������ҹ��
-
-     ����� C-z �繤���觷�����㹡���͡�ҡ Emacs ��͹��ҧ����  ����觹������¡��ԡ
-Emacs ��·����� �����ش Emacs �����Ǥ��� �����������ö��Ѻ��� csh ���ա  ��á�
-C-z �֧�繡����ش Emacs �����Ǥ�����ҹ�� �����Ӥ�������������Ѻ�����ҷ������
-
-�����˵�:       ����� 㹡óշ���麹 X-window ������ sh ���� �������դ�������ö���
-
-
-     ����觻����� C-x ���ҡ������¤����  ����觷��͸Ժ��������մѧ���
-
-     C-x C-f   ����������� (find) ����Ѻ���
-     C-x C-s   ���ѡ����������� (save)
-     C-x C-b   �ʴ���¡�úѿ���� (buffer list)
-     C-x C-c   ��ԡ����� Editor ������ѡ��������������ѵ��ѵ�  �����ҡ�����
-               �����źҧ�ѹ�١���  ���������Ҩ����ѡ����������Ź�����  �·����
-               ����͡�ҡ Emacs �����¤���� C-x C-s C-x C-c ���������ѡ��
-               ��͹���Ǩ֧��ԡ
-
-     ����觢�������Ẻ���͹�� ������Ѻ����觷������������ ���ͤ���觷����੾�СѺ��������ɺҧ
-����  ������ҧ�� ����� "command-apropos" ��觨ж�� ��������� (keyword) �����ʴ���
-����觷ء����觷���ժ�������Ǣ�ͧ�Ѻ�Ѻ��������촹��  ���Ҩ���觤���觹�� ����顴 ESC x ���Ǩ��յ���ѡ��
-"M-x" ��ҡ���鹷����ǹ��ҧ�ͧ��  �ҡ��鹡���������ͤ���觷���ͧ��� (㹡óչ����
-"command-apropos")  ����ͻ�͹������件֧ "command-a" ���ǡ� SPACE BAR ��ǹ�������ͧ͢
-���ͤ���觡�ж١������ (completion) ����ͧ���ѵ��ѵ�   ��ѧ�ҡ��� �ж١������������ �����
-������ѡ��� (string) ����ͧ������ŧ�  ��ͧ��������������������� ��������觷��������������
-
-       >> �ͧ�� ESC x ������� "command-apropos<Return>" ����
-          "command-a<Space><Return>"  ��ѧ�ҡ��鹡硴 "kanji<Return>" ��
-
-     ��顴 C-x 1 ���ҵ�ͧ��è�ź "�Թ���" �������������� 
-
-��÷Ѵ���� (Mode Line)
-=====================
-
-     ���ҷ�������������仪�� � Emacs ���ʴ���觷������ŧ仵ç��÷Ѵ��ҧ�ش�ͧ�ͫ�����¡
-��� echo area  ��÷Ѵ�������Ѵ�����˹�觺�÷Ѵ ���¡��Һ�÷Ѵ���� (mode line)  ��÷Ѵ
-�������ѡɳдѧ���
-
-
- [--]J:--**-Mule: TUTORIAL.th   (Fundamental) ---NN%--------------
-
-
-�����˵�:       �ç��ǹ NN �ͧ NN% ���յ���Ţ�������  ��÷Ѵ��������ʴ������Ҩ��ᵡ��ҧ
-               仨ҡ������ҧ��ҧ ����������  ������ҧ�� �Ҩ������������ uptime
-               �ʴ�������  �ѹ����繤�������ö�ͧ����� display-time
-
-     ��÷Ѵ����բ����ŷ���繻���ª�������������ҧ
-
-
-     �������á��� ������������ŷ����ѧ��ҹ����   ����Ţ NN% ���ʴ���������ҡ��ѧ�ʴ�����ǹ�˹
-�ͧ������������� �¤Դ������ૹ��   �������ǹ���ش�ͧ����������������բ�ͤ������
---Top-- �ʴ�����  �������ǹ��ҧ�ش����բ�ͤ������ --Bot--  ����ҡ����ö�ʴ����������
-��������˹�Ҩ��� ����բ�ͤ������ --All-- �ʴ�����
-
-     ����ǧ��红ͧ��÷Ѵ���� ���ʴ���������ҵ͹������������ (mode) ����  㹵�����ҧ
-��ҧ����� ��������� Fundamental ���������������� (default)  ���������˹�������
-��ѡ (Major Mode)
-
-     Emacs ��������ѡ (Major Mode) ����Ѻ������������ ���͡�����ͤ��� ��
-Lisp mode Text mode ���������� � �ա��������  �»��� Emacs �������������ѡ
-���������˹������
-
-     ����觺ҧ����觨��վĵԡ������ᵡ��ҧ�ѹ������ԧ ����������������ѡ����ҧ�ѹ   ������ҧ
-�� ������������� ���դ��������Ѻ���ҧ �����˵� (comment) ����  ���ͧ�ҡ�Ը����
-�����˵آͧ������������ᵡ��ҧ�ѹ   ����觹����ᵡ��ҧ�ѹ������������ѡ  �������
-����ö��������˵���������������ҧ�١��ͧ
-
-     ���������Ѻ�������¹���������������ѡ��� ��ͤ���觢��� (extend) ��觪��ͤ�����繪���
-���� ������ҧ�� ����� M-x fundamental-mode ��ͤ��������Ѻ����¹���������� 
-Fundamental
-
-     ���ҷ��������������������ѧ��� ������� Text mode
-
-       >> �ͧ��͹����� M-x text-mode<Return>
-
-     ��ҵ�ͧ����Ң�������������ǡѺ������ѡ���������㹻Ѩ�غѹ ������͹����� C-h m
-
-       >> ��顴 C-h m �����֡�Ң��ᵡ��ҧ�����ҧ Text mode �Ѻ Fundamental mode
-
-       >> ��顴 C-x 1 ����ź�͡����͡�ҡ��
-
-     �ç��ǹ���¢ͧ��÷Ѵ���� �����ѭ�ѡɳ� '[--]' �����ʴ���������Ѻ��û�͹������
-(input mode) ����   �ѭ�ѡɳ� [--] ���¶֧����ö��͹����������µ���ѡ�������ѧ���
-(English alphabets)  ��س���ҹ�����ͧ͢ "Tamago" ����Ѻ��������´�ͧ�Ը���
-
-     ��еç��ҹ��Ңͧ�ѭ�ѡɳ��� ��������ͧ�����ʴ�ʶҹТͧ flag �ͧ�к�����
-(coding-system) ����   Mule ����ö��˹��к������¡੾������Ѻ �������ҹ���������
-��û�͹�����Ũҡ������� ����ʴ����͡�ҧ�� ������Шҡ�ѹ  ���»��Ԩ��ʴ�੾��
-�ѭ�ѡɳ���¨� (mnemonic) �ͧ�к���������Ѻ�������ҹ��������� ��ҹ��
-
-       >> ��Ǩ��������ѭ�ѡɳ� ����¤�֧�Ѻ "J:" "S:" "E:" �ʴ��������÷Ѵ�����������
-
-     ����ѡ�õ���á��� �ѭ�ѡɳ���¨� (mnemonic) �ͧ�к����ʷ��������  ��� ':' �ʴ�������
-����յ���ѡ�âͧ������� �͡�ҡ�����ѧ����ʴ����� (�� ���Ҩչ ���ҭ���� �繵�)  ��� J
-���¶֧ ���ʷ����Ѻ JUNET ��� ���� JIS  ��� S ���¶֧ Shift-JIS ��� ��� E ���¶֧
-���� EUC ���ҭ����   ����Ѻ����¹ (toggle) ����ʴ������ҹҹҪҵ����� C-x C-k t
-
-     ������ҧ��ҧ��ҧ ��͡����Ѻ����¹�������ʴ����ҹҹҪҵ� ������Ѻ��Ѻ�ա����˹��
-
-       >> �ͧ��͹����� C-x C-k t ���ͧ����
-
-     ��������Թ�ŷ���������ջ��� META ���������������������� JIS  ��ҡ������ö����� META
-᷹��á����� ESCAPE ��  �Ը��������͹�Ѻ���������͹��� �����顴���� META ��ҧ������Ǩ֧
-������ѡ�õ��  M-<����ѡ��> �з�˹�ҷ������͹�Ѻ ESC <����ѡ��>  ��蹤�� �ء���ҧ���͸Ժ����
-���֧�ش��� ���ѧ���ռ�����͹��� ��ѧ�ҡ����¹ ESC <����ѡ��> ����� M-<����ѡ��>  ����
-������ѧ���� ���� META ���������ö����Ѻ���� Shift-JIS ��� EUC
-
-     �������¹�к����ʨ��ռ�����§�Ѻ���кѿ������ҹ��  ����ö�٤��������ǡѺ�к�����
-���¤���� C-h a coding-system <Return>
-
-       >> ����͹����� C-h a coding-system <Return> ������ҹ��������´�ͧ����� 
-	  set-display-coding-system set-file-coding-system ���
-	  set-process-coding-system �ҡ�͡��÷���ҡ����
-
-���� (search)
-================
-
-     Emacs ����ö��������ѡ��� (string) �������������价ҧ��ҧ˹�����͢�ҧ��ѧ��
-��ҵ�ͧ��ä���价ҧ��ҧ˹�Ңͧ���˹��������� (cursor) ����顴 C-s  ��ҵ�ͧ��ä���
-价ҧ��ҧ��ѧ�ͧ���˹���������  ����顴 C-r  ��ѧ�ҡ��鹨��բ�ͤ������ "I-search:"
-��ҡ���鹵ç echo area  ¡��ԡ��ä�������¡�á� ESC
-
-
-       >> �� C-s �����������ä���  ���ǡ�����ѡ�âͧ����� "cursor" ŧ价��е�����ҧ
-          ��� �����ѧࡵ��������������Ѻ����ҧ��
-
-       >> �ͧ�� C-s ���ա˹�觤������ͤ��Ҥ���� "cursor" ��ǵ���
-
-       >> �� <Delete> �� 4 ���� �����ѧࡵ����ҡ������͹���ͧ��������
-
-       >> �� ESC ����¡��ԡ��ä���
-
-     ��ä��Ҩ��������鹷ѹ�� ������ҧ�����������ѡ��з���ͧ��èФ��� ������§�ҧ��ǹ
-��ҵ�ͧ��èФ��ҵ�ǵ��� ����顴 C-s �ա˹�觤���  ����ҡ��������ѡ��з���͹������辺 ��
-���բ�ͤ�����ҡ����  ��顴 C-g ����¡��ԡ
-
-     �����ҧ����������  ��ҡ� <Delete> ����ѡ�õ���ش���������ѡ��С�ж١ź�  ����
-���������С�Ѻ仵��˹觡�͹˹��   ������ҧ�� ��ҡ� "cu" ��Ф���件֧���˹觷���դ����
-"cu"  ���ҡ� <Delete> 㹨ѧ��й�� ��� 'u' � search line ������� ������������
-�Т�Ѻ��Ѻ价����˹觷���յ�� 'c' ����
-
-     ��ҡ�����ѡ�ä͹��� (control character) ������ �͡�˹�ͨҡ C-s ���� C-r
-��ä��ҡ������شŧ
-
-     ����� C-s �Ф�������ѡ��з���ͧ��� 价ҧ��ҧ˹�Ңͧ���˹���������  ��ҵ�ͧ���
-����价ҧ�����ѧ  ����顴 C-r  ��蹤�� ����ö�� C-s ��� C-r ��Ѻ�ѹ���ͤ������㹷��
-�ͧ��ȷҧ  C-s ��� C-r ��˹�ҷ������͹�ѹ�ء��С�� �е�ҧ�ѹ��ç��ȷҧ��ä�����ҹ��
-
-Recursive Editing Level
-
-     �ҧ�� ����Ҩ����ش���������ʶҹз�����¡��� Recursive Editing Level ����
-������  �������� ����ͧ����ǧ��� '()' ����ʴ�����������ѡ (major mode) �������ǧ���
-'[]' ���� ��������ա˹�觪��  ������ҧ�� �������� (Fundamental) ���� �������¹��
-[(Fundamental)] ᷹
-
-�����˵�:       ��Ҩ����͸Ժ������ǡѺ Recursive Editing Level 㹷����
-
-     ��顴 M-x top-level <Return> ���ͷ����͡�ҡ Recursive Editing Level
-
-       >> �ͧ���� �ç��ǹ��ҧ�ͧ�ͨ��բ�ͤ������ "Back to top level" ��ҡ����
-
-     ���ͧ�ҡ ���������дѺ���ش (top level) ��������  ����觹��֧����ռ�� �
-
-     �������ö�� ����� C-g ���ͷ����͡�ҡ Recursive Editing Level ��
-
-
-Help
-====
-
-     Emacs �դ�������ö����ջ���ª�� �ҡ����������ҧ ����������ö͸Ժ�������㹷����
-����Ҩ�����ö���¡�� <HELP> ���ͷ������¹����������ö����ҹ�� ���¡�á� C-h ��觨�
-�������������Ѻ����������������������ҧ
-
-     �Ը�������顴 C-h ���ǵ�����µ�����͡ (option) �ա˹�觵���ѡ��  �����������Ҩе�ͧ��
-������͡���� ����顴 C-h ?  ���Ǩ��դ�͸Ժ������ǡѺ������͡��ҡ����  ���ҡ����¹㨨�
-������¡ HELP ��ѧ�ҡ�� C-h ����顴 C-g ����¡��ԡ��
-
-     ����� HELP ��鹰ҹ����ش�ѹ˹�觡��� C-h c ���ǵ�����¡�á�����觺ҧ�����  ��觨�����
-͸Ժ����� � ����ǡѺ����觹��
-
-       >> �ͧ�� C-h c C-p ��  ��觨�����ͤ������
-          "C-p runs the command previous-line"
-
-     ����觹��Ъ������Ϳ�鹤����� ����ǡѺ����觷���¼�ҹ������ �������� �������ҧ��  �����
-������ҡ����˹�觵���ѡ�� �� C-x C-s ������ö�������ѧ C-h c ��
-
-     ����ҡ��ͧ��������������´�ҡ���ҹ��  ������� k ᷹��� c
-
-       >> �ͧ�� C-h k C-p ��
-
-     ������Թ�������� Emacs �ա˹���ѹ �����ʴ���������´�ͧ����觹��  �������ҹ������
-����顴 C-x 1 ����ź�Թ����͡
-
-     ������͡��蹷���ջ���ª�� �մѧ���
-
-    C-h f      ��������ͧ͢����� �����ʴ���������´����ǡѺ����觹��
-
-       >> ��顴 C-h f previous-line ���ǵ������ <Return> �����ʴ���������´�����
-          �Ѻ����觫�����¡����ҡ��á� C-p
-
-    C-h a      ���ǵ�����¤�������� (keyword) �����ʴ�����觷ء����� ����դ�������� �������
-               ���������ҹ������ö���¡�����¡�á� ESC x
-
-       >> �ͧ�� C-h a file ���ǵ������ <Return> �����ʴ����ͤ���觷ء����觷���դ����
-          "file" �������  ��觨��� find-file ��� write-file ������¡�����¡�á�
-          C-x C-f ��� C-x C-w ����������
-
-�����ش���
-======
-
-�������:         ���������Ѻ�����ԡ Emacs ��� C-x C-c
-
-
-     �͡��é�Ѻ���ͧ�鹹��  ������¹�������Ѻ�����������Ѵ���� ��੾��  ����ҡ�ըش�˹������
-���� ������������ɵ���ͧ  �������¹�����Դ���ѧ�����¹᷹
-
-
-     ��ѧ�ҡ�� EMACS ���ѡ�ͧ����ѹ �礧�ЪԹ��ͧ  㹵͹�á �Ҩ���ըش�������֡�Ѻʹ���
-������������ҧ  ����觹�������Դ������� ������������� Editor ����� � ����  ��੾��
-���ҧ��觡Ѻ EMACS ���ͧ�ҡ�����������դ�������ö��ҡ�����ҡ   �ѹ����ԧ���� EMACS
-����ء��觷ء���ҧ
-
-
-
-�͢ͺ�س
-=======
-     �͡��é�Ѻ��� �Ѵ�ŧ�Ҩҡ "MicroEMACS (kemacs) ���ҭ���� ���ͧ��" ������Ҩҡ
-JUNET ����������� Tutorial ����Ѻ GNUEmacs (Nemacs)
-
-     �͡��ù�� �Ѵ�ŧ�Ҩҡ "JOVE Tutorial" (19 ���Ҥ� 86) �ͧ Jonathan Payne
-     ��觴Ѵ�ŧ�Ҩҡ�͡��âͧ Steve Zimmerman ��� CCA-UNIX ��觴Ѵ�ŧ (�ա��) ��
-     �ҡ�͡��� "Teach-Emacs" ��Ѻ���ͧ�� (31 ���Ҥ� 85) �ͧ MIT
-
-     Update - February 1986 by Dana Hoggatt.
-
-     Update - December 1986 by Kim Leburg.
-
-     Update/Translate - July 1987 by SANETO Takanori
-
-�͢ͺ�س�繾����
-==============
-
-     �س SANETO Takanori (����� �ҡ����) ��������ҭ���蹩�Ѻ�á�ش  �͡��é�Ѻ���
-��¹���� GMW + Wnn + Nemacs  ���ʴ������ͺ�س ���������ҧ������ش���������ҹ����
-��Т͢ͺ�س �س Fujiwara Shoko ������������������㹡���� ��û�͹������ ������ҧ����ա
-���� � ���ҧ
-
-
-
-
-���Ѻ�Դ�ͺ ����ŷ��Դ��Ҵ �������� ������ � �������§�������
-
-                        �ث١� ����⹺�@sra.co.jp
-
-
-Update/Add - December 1987 by Hironobu Suzuki
-Update/Add - November 1989 by Ken'ichi Handa
-Update/Add - January  1990 by Shigeki Yoshida
-Update/Add - March    1992 by Kenichi HANDA
-
-Translated into Thai
-          - September 1994 by Manop Wongsaisuwan
 ;;;###autoload
 (defun setup-ethiopic-environment-internal ()
   (let ((key-bindings '((" " . ethio-insert-space)
-			([?\S- ] . ethio-insert-ethio-space)
-			([?\C-'] . ethio-gemination)
+			([(shift space)] . ethio-insert-ethio-space)
+			([(control ?')] . ethio-gemination)
 			([f2] . ethio-toggle-space)
-			([S-f2] . ethio-replace-space) ; as requested
+			([(shift f2)] . ethio-replace-space) ; as requested
 			([f3] . ethio-toggle-punctuation)
 			([f4] . ethio-sera-to-fidel-buffer)
-			([S-f4] . ethio-sera-to-fidel-region)
-			([C-f4] . ethio-sera-to-fidel-mail-or-marker)
+			([(shift f4)] . ethio-sera-to-fidel-region)
+			([(control f4)] . ethio-sera-to-fidel-mail-or-marker)
 			([f5] . ethio-fidel-to-sera-buffer)
-			([S-f5] . ethio-fidel-to-sera-region)
-			([C-f5] . ethio-fidel-to-sera-mail-or-marker)
+			([(shift f5)] . ethio-fidel-to-sera-region)
+			([(control f5)] . ethio-fidel-to-sera-mail-or-marker)
 			([f6] . ethio-modify-vowel)
 			([f7] . ethio-replace-space)
 			([f8] . ethio-input-special-character)))
 	border)
     (save-excursion
 
-      ;; follow RFC822 rules instead of looking for a fixed separator
-      (rfc822-goto-eoh)
-      (forward-line 1)
-      (setq border (point))
+      ;; look for the header-body separator
+      (goto-char (point-min))
+      (if (search-forward
+	   (if (eq major-mode 'rmail-mode)
+	       "\n\n" (concat "\n" mail-header-separator "\n"))
+	   nil t)
+	  (setq border (point))
+	(error "header separator not found"))
 
       ;; note that the point is placed at the border
       (if (or (re-search-forward "^<sera>$" nil t)
 	border)
     (save-excursion
 
-      ;; follow RFC822 rules instead of looking for a fixed separator
-      (rfc822-goto-eoh)
-      (forward-line 1)
-      (setq border (point))
-
+      ;; look for the header-body separator
+      (goto-char (point-min))
+      (if (search-forward
+	   (if (eq major-mode 'rmail-mode)
+	       "\n\n" (concat "\n" mail-header-separator "\n"))
+	   nil t)
+	  (setq border (point))
+	(error "header separator not found"))
+			     
       ;; process body first not to change the border
       ;; note that the point is already at the border
       (if (re-search-forward "\\ce" nil t)
 
 ;;; Code:
 
+(defvar sentence-end-save nil)
+
 ;;;###autoload
 (defun setup-japanese-environment ()
   "Setup multilingual environment (MULE) for Japanese."
   (interactive)
-  (setup-english-environment)
+  (set-language-environment "Japanese"))
 
-  ;; (setq coding-category-iso-8-2 'japanese-iso-8bit)
-  (set-coding-category-system 'iso-8-2 'euc-jp)
-  ;; (setq coding-category-iso-8-else 'japanese-iso-8bit)
-  
-  ;; (set-coding-priority
-  ;;  '(coding-category-iso-7
-  ;;    coding-category-iso-8-2
-  ;;    coding-category-sjis
-  ;;    coding-category-iso-8-1
-  ;;    coding-category-iso-7-else
-  ;;    coding-category-iso-8-else
-  ;;    coding-category-emacs-mule))
-  (set-coding-priority-list
-   '(iso-7
-     iso-8-2
-     shift-jis
-     iso-8-1
-     iso-lock-shift
-     iso-8-designate
-     no-conversion
-     big5))
-  
-  (set-default-coding-systems
-   (if (eq system-type 'ms-dos)
-       'japanese-shift-jis
-     'iso-2022-jp))
-  
-  ;; (when (eq 'x (device-type (selected-device)))
-  ;;   (x-use-halfwidth-roman-font 'japanese-jisx0208 "jisx0201"))
-  
-  ;; (setq default-input-method "japanese")
+;;;###autoload
+(defun setup-japanese-environment-internal ()
+  (if (eq system-type 'ms-dos)
+      (prefer-coding-system 'shift_jis)
+    (setq default-file-name-coding-system 'euc-jp))
+  (setq sentence-end-save sentence-end)
+  (setq sentence-end (concat sentence-end "\\|[$B!#!)!*(B]"))
+
   (when (and (fboundp 'x-keysym-on-keyboard-p)
 	     (console-on-window-system-p)
 	     (x-keysym-on-keyboard-p 'kana_A))
-    (kana-keyboard-define-keys))
-  )
+    (kana-keyboard-define-keys)))
+
+(defun exit-japanese-environment ()
+  (setq sentence-end sentence-end-save))
 
 (defconst japanese-kana-table
   '((?$B$"(B ?$B%"(B ?(I1(B) (?$B$$(B ?$B%$(B ?(I2(B) (?$B$&(B ?$B%&(B ?(I3(B) (?$B$((B ?$B%((B ?(I4(B) (?$B$*(B ?$B%*(B ?(I5(B)
     (?$B$^(B ?$B%^(B ?(IO(B) (?$B$_(B ?$B%_(B ?(IP(B) (?$B$`(B ?$B%`(B ?(IQ(B) (?$B$a(B ?$B%a(B ?(IR(B) (?$B$b(B ?$B%b(B ?(IS(B)
     (?$B$d(B ?$B%d(B ?(IT(B) (?$B$f(B ?$B%f(B ?(IU(B) (?$B$h(B ?$B%h(B ?(IV(B)
     (?$B$i(B ?$B%i(B ?(IW(B) (?$B$j(B ?$B%j(B ?(IX(B) (?$B$k(B ?$B%k(B ?(IY(B) (?$B$l(B ?$B%l(B ?(IZ(B) (?$B$m(B ?$B%m(B ?(I[(B)
-    (?$B$o(B ?$B%o(B ?(I\(B) (?$B$p(B ?$B%p(B nil) (?$B$q(B ?$B%q(B nil) (?$B$r(B ?$B%r(B ?(I&(B)
+    (?$B$o(B ?$B%o(B ?(I\(B) (?$B$p(B ?$B%p(B "(I2(B") (?$B$q(B ?$B%q(B "(I4(B") (?$B$r(B ?$B%r(B ?(I&(B)
     (?$B$s(B ?$B%s(B ?(I](B)
     (?$B$,(B ?$B%,(B "(I6^(B") (?$B$.(B ?$B%.(B "(I7^(B") (?$B$0(B ?$B%0(B "(I8^(B") (?$B$2(B ?$B%2(B "(I9^(B") (?$B$4(B ?$B%4(B "(I:^(B")
     (?$B$6(B ?$B%6(B "(I;^(B") (?$B$8(B ?$B%8(B "(I<^(B") (?$B$:(B ?$B%:(B "(I=^(B") (?$B$<(B ?$B%<(B "(I>^(B") (?$B$>(B ?$B%>(B "(I?^(B")
     (?$B$!(B ?$B%!(B ?(I'(B) (?$B$#(B ?$B%#(B ?(I((B) (?$B$%(B ?$B%%(B ?(I)(B) (?$B$'(B ?$B%'(B ?(I*(B) (?$B$)(B ?$B%)(B ?(I+(B)
     (?$B$C(B ?$B%C(B ?(I/(B)
     (?$B$c(B ?$B%c(B ?(I,(B) (?$B$e(B ?$B%e(B ?(I-(B) (?$B$g(B ?$B%g(B ?(I.(B)
-    (?$B$n(B ?$B%n(B nil)
-    (nil ?$B%t(B "(I3^(B") (nil ?$B%u(B nil) (nil ?$B%v(B nil))
+    (?$B$n(B ?$B%n(B "(I\(B")
+    ("$B$&!+(B" ?$B%t(B "(I3^(B") (nil ?$B%u(B "(I6(B") (nil ?$B%v(B "(I9(B"))
   "Japanese JISX0208 Kana character table.
 Each element is of the form (HIRAGANA KATAKANA HANKAKU-KATAKANA), where
 HIRAGANA and KATAKANA belong to `japanese-jisx0208',
 	  hiragana (car slot) katakana (nth 1 slot) jisx0201 (nth 2 slot)
 	  l (cdr l))
     (if hiragana
-	(progn
+	(if (stringp hiragana)
+	    (if (> (length hiragana) 1)
+		(let ((hira (aref hiragana 0)))
+		  (put-char-code-property
+		   hira 'kana-composition
+		   (cons (cons (aref hiragana 1) katakana)
+			 (get-char-code-property hira 'kana-composition)))))
 	  (put-char-code-property hiragana 'katakana katakana)
-	  (put-char-code-property katakana 'hiragana hiragana)
-	  (if jisx0201
-	      (progn
-		(put-char-code-property hiragana 'jisx0201 jisx0201)
-		(if (integerp jisx0201)
-		    (put-char-code-property jisx0201 'hiragana hiragana))))))
+	  (put-char-code-property hiragana 'jisx0201 jisx0201)))
+    (when (integerp katakana)
+      (put-char-code-property katakana 'hiragana hiragana)
+      (put-char-code-property katakana 'jisx0201 jisx0201))
     (if jisx0201
-	(progn
-	  (put-char-code-property katakana 'jisx0201 jisx0201)
-	  (if (integerp jisx0201)
-	      (put-char-code-property jisx0201 'katakana katakana))))))
+	(if (stringp jisx0201)
+	    (if (> (length jisx0201) 1)
+		(let ((kana (aref jisx0201 0)))
+		  (put-char-code-property
+		   kana 'kana-composition
+		   (cons (cons (aref jisx0201 1) katakana)
+			 (get-char-code-property kana 'kana-composition)))))
+	  (put-char-code-property jisx0201 'hiragana hiragana)
+	  (put-char-code-property jisx0201 'katakana katakana)
+	  (put-char-code-property jisx0201 'jisx0208 katakana)))))
 
 (defconst japanese-symbol-table
-  '((?\$B!!(B ?\ ) (?$B!"(B ?, ?(I$(B) (?$B!#(B ?. ?(I!(B) (?$B!$(B ?, ?(I$(B) (?$B!%(B ?. ?(I!(B) (?$B!&(B nil ?(I%(B)
+  '((?\$B!!(B ?\ ) (?$B!$(B ?, ?(I$(B) (?$B!%(B ?. ?(I!(B) (?$B!"(B ?, ?(I$(B) (?$B!#(B ?. ?(I!(B) (?$B!&(B nil ?(I%(B)
     (?$B!'(B ?:) (?$B!((B ?\;) (?$B!)(B ??) (?$B!*(B ?!) (?$B!+(B nil ?(I^(B) (?$B!,(B nil ?(I_(B)
     (?$B!-(B ?') (?$B!.(B ?`) (?$B!0(B ?^) (?$B!2(B ?_) (?$B!<(B ?-) (?$B!=(B ?-) (?$B!>(B ?-)
     (?$B!?(B ?/) (?$B!@(B ?\\) (?$B!A(B ?~)  (?$B!C(B ?|) (?$B!F(B ?`) (?$B!G(B ?') (?$B!H(B ?\") (?$B!I(B ?\")
     (or (get-char-code-property obj 'jisx0208)
 	obj)))
 
+(defun japanese-replace-region (from to string)
+  "Replace the region specified by FROM and TO to STRING."
+  (goto-char from)
+  (insert string)
+  (delete-char (- to from)))
+
 ;;;###autoload
 (defun japanese-katakana-region (from to &optional hankaku)
   "Convert Japanese `hiragana' chars in the region to `katakana' chars.
   (interactive "r\nP")
   (save-restriction
     (narrow-to-region from to)
-    (goto-char (point-min))
-    (while (re-search-forward "\\cH\\|\\cK" nil t)
-      (let* ((hira (preceding-char))
-	     (kata (japanese-katakana hira hankaku)))
-	(if kata
-	    (progn
-	      (delete-region (match-beginning 0) (match-end 0))
-	      (insert kata)))))))
+    (save-excursion
+      (goto-char (point-min))
+      (while (re-search-forward "\\cH\\|\\cK" nil t)
+	(let* ((kana (preceding-char))
+	       (composition (get-char-code-property kana 'kana-composition))
+	       next slot)
+	  (if (and composition (setq slot (assq (following-char) composition)))
+	      (japanese-replace-region (match-beginning 0) (1+ (point))
+				       (cdr slot))
+	    (let ((kata (get-char-code-property
+			 kana (if hankaku 'jisx0201 'katakana))))
+	      (if kata
+		  (japanese-replace-region (match-beginning 0) (point)
+					   kata)))))))))
+
 
 ;;;###autoload
 (defun japanese-hiragana-region (from to)
-  "Convert Japanese `katakana' chars in the region to `hiragana'  chars."
+  "Convert Japanese `katakana' chars in the region to `hiragana' chars."
   (interactive "r")
   (save-restriction
     (narrow-to-region from to)
-    (goto-char (point-min))
-    (while (re-search-forward "\\cK\\|\\ck" nil t)
-      (let* ((kata (preceding-char))
-	     (hira (japanese-hiragana kata)))
-	(if hira
-	    (progn
-	      (delete-region (match-beginning 0) (match-end 0))
-	      (insert hira)))))))
+    (save-excursion
+      (goto-char (point-min))
+      (while (re-search-forward "\\cK\\|\\ck" nil t)
+	(let* ((kata (preceding-char))
+	       (composition (get-char-code-property kata 'kana-composition))
+	       next slot)
+	  (if (and composition (setq slot (assq (following-char) composition)))
+	      (japanese-replace-region (match-beginning 0) (1+ (point))
+				       (get-char-code-property
+					(cdr slot) 'hiragana))
+	    (let ((hira (get-char-code-property kata 'hiragana)))
+	      (if hira
+		  (japanese-replace-region (match-beginning 0) (point)
+					   hira)))))))))
 
 ;;;###autoload
 (defun japanese-hankaku-region (from to &optional ascii-only)
   (interactive "r\nP")
   (save-restriction
     (narrow-to-region from to)
-    (goto-char (point-min))
-    (while (re-search-forward "\\cj" nil t)
-      (let* ((zenkaku (preceding-char))
-	     (hankaku (japanese-hankaku zenkaku ascii-only)))
-	(if hankaku
-	    (progn
-	      (delete-region (match-beginning 0) (match-end 0))
-	      (insert hankaku)))))))
+    (save-excursion
+      (goto-char (point-min))
+      (while (re-search-forward "\\cj" nil t)
+	(let* ((zenkaku (preceding-char))
+	       (hankaku (or (get-char-code-property zenkaku 'ascii)
+			    (and (not ascii-only)
+				 (get-char-code-property zenkaku 'jisx0201)))))
+	  (if hankaku
+	      (japanese-replace-region (match-beginning 0) (match-end 0)
+				       hankaku)))))))
 
 ;;;###autoload
-(defun japanese-zenkaku-region (from to)
+(defun japanese-zenkaku-region (from to &optional katakana-only)
   "Convert hankaku' chars in the region to Japanese `zenkaku' chars.
 `Zenkaku' chars belong to `japanese-jisx0208'
-`Hankaku' chars belong to `ascii' or `japanese-jisx0201-kana'."
-  (interactive "r")
+`Hankaku' chars belong to `ascii' or `japanese-jisx0201-kana'.
+Optional argument KATAKANA-ONLY non-nil means to convert only KATAKANA char."
+  (interactive "r\nP")
   (save-restriction
     (narrow-to-region from to)
-    (goto-char (point-min))
-    (while (re-search-forward "\\ca\\|\\ck" nil t)
-      (let* ((hankaku (preceding-char))
-	     (zenkaku (japanese-zenkaku hankaku)))
-	(if zenkaku
-	    (progn
-	      (delete-region (match-beginning 0) (match-end 0))
-	      (insert zenkaku)))))))
+    (save-excursion
+      (goto-char (point-min))
+      (while (or (and katakana-only
+		      (re-search-forward "\\ck" nil t))
+		 (and (not katakana-only)
+		      (re-search-forward "\\ca\\|\\ck" nil t)))
+	(let* ((hankaku (preceding-char))
+	       (composition (get-char-code-property hankaku 'kana-composition))
+	       next slot)
+	  (if (and composition (setq slot (assq (following-char) composition)))
+	      (japanese-replace-region (match-beginning 0) (1+ (point))
+				       (cdr slot))
+	    (let ((zenkaku (japanese-zenkaku hankaku)))
+	      (if zenkaku
+		  (japanese-replace-region (match-beginning 0) (match-end 0)
+					   zenkaku)))))))))
 
 ;;;###autoload
 (defun read-hiragana-string (prompt &optional initial-input)
+;;; korea-util.el --- utilities for Korean
+
+;; Copyright (C) 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1999 Electrotechnical Laboratory, JAPAN.
+;; Licensed to the Free Software Foundation.
+
+;; Keywords: mule, multilingual, Korean
+
+;; 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.
+
+;;; Code:
+
+;;;###autoload
+(defvar default-korean-keyboard ""
+  "*The kind of Korean keyboard for Korean input method.
+\"\" for 2, \"3\" for 3.")
+
+;; functions useful for Korean text input
+
+(defun toggle-korean-input-method ()
+  "Turn on or off a Korean text input method for the current buffer."
+  (interactive)
+  (if current-input-method
+      (inactivate-input-method)
+    (activate-input-method
+     (concat "korean-hangul" default-korean-keyboard))))
+
+(defun quail-hangul-switch-symbol-ksc (&rest ignore)
+  "Swith to/from Korean symbol package."
+  (interactive "i")
+  (and current-input-method
+       (if (string-equal current-input-method "korean-symbol")
+	   (activate-input-method (concat "korean-hangul"
+					  default-korean-keyboard))
+	 (activate-input-method "korean-symbol"))))
+
+(defun quail-hangul-switch-hanja (&rest ignore)
+  "Swith to/from Korean hanja package."
+  (interactive "i")
+  (and current-input-method
+       (if (string-match "korean-hanja" current-input-method)
+	   (activate-input-method (concat "korean-hangul"
+					  default-korean-keyboard))
+	 (activate-input-method (concat "korean-hanja"
+					default-korean-keyboard)))))
+
+;; The following three commands are set in isearch-mode-map.
+
+(defun isearch-toggle-korean-input-method ()
+  (interactive)
+  (let ((overriding-terminal-local-map nil))
+    (toggle-korean-input-method))
+  (setq isearch-input-method-function input-method-function
+	isearch-input-method-local-p t)
+  (setq input-method-function nil)
+  (isearch-update))
+
+(defun isearch-hangul-switch-symbol-ksc ()
+  (interactive)
+  (let ((overriding-terminal-local-map nil))
+    (quail-hangul-switch-symbol-ksc))
+  (setq isearch-input-method-function input-method-function
+	isearch-input-method-local-p t)
+  (setq input-method-function nil)
+  (isearch-update))
+
+(defun isearch-hangul-switch-hanja ()
+  (interactive)
+  (let ((overriding-terminal-local-map nil))
+    (quail-hangul-switch-hanja))
+  (setq isearch-input-method-function input-method-function
+	isearch-input-method-local-p t)
+  (setq input-method-function nil)
+  (isearch-update))
+
+;; Information for setting and exiting Korean environment.
+(defvar korean-key-bindings
+  `((global [(shift space)] toggle-korean-input-method nil)
+    (global [(control f9)] quail-hangul-switch-symbol-ksc nil)
+    (global [f9]  quail-hangul-switch-hanja nil)
+    (,isearch-mode-map [(shift space)] isearch-toggle-korean-input-method nil)
+    (,isearch-mode-map [(control f9)] isearch-hangul-switch-symbol-ksc nil)
+    (,isearch-mode-map [f9] isearch-hangul-switch-hanja nil)))
+
+;;;###autoload
+(defun setup-korean-environment ()
+  "Setup multilingual environment (MULE) for Korean."
+  (interactive)
+  (set-language-environment "Korean"))
+
+;;;###autoload
+(defun setup-korean-environment-internal ()
+  (let ((key-bindings korean-key-bindings))
+    (while key-bindings
+      (let* ((this (car key-bindings))
+	     (key (nth 1 this))
+	     (new-def (nth 2 this))
+	     old-def)
+	(if (eq (car this) 'global)
+	    (progn
+	      (setq old-def (global-key-binding key))
+	      (global-set-key key new-def))
+	  (setq old-def (lookup-key (car this) key))
+	  (define-key (car this) key new-def))
+	(setcar (nthcdr 3 this) old-def))
+      (setq key-bindings (cdr key-bindings))))
+
+  ;; EGG specific setup 97.02.05 jhod
+  (when (featurep 'egg)
+    (when (not (featurep 'egg-kor))
+      (provide 'egg-kor)
+      (load "its-hangul")
+      (setq its:*standard-modes*
+	    (cons (its:get-mode-map "hangul") its:*standard-modes*)))
+    (setq-default its:*current-map* (its:get-mode-map "hangul")))
+  )
+
+(defun exit-korean-environment ()
+  "Exit Korean language environment."
+  (let ((key-bindings korean-key-bindings))
+    (while key-bindings
+      (let* ((this (car key-bindings))
+	     (key (nth 1 this))
+	     (new-def (nth 2 this))
+	     (old-def (nth 3 this)))
+	(if (eq (car this) 'global)
+	    (if (eq (global-key-binding key) new-def)
+		(global-set-key key old-def))
+	  (if (eq (lookup-key (car this) key) new-def)
+	      (define-key (car this) key old-def))))
+      (setq key-bindings (cdr key-bindings)))))
+
+;;
+(provide 'korea-util)
+
+;;; korean-util.el ends here
+;;; mule-diag.el --- debugging functions for Mule.
+
+;; Copyright (C) 1992 Free Software Foundation, Inc.
+;; Copyright (C) 1995 Sun Microsystems.
+
+;; 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.
+
+;;; 93.7.28  created for Mule Ver.0.9.8 by K.Handa <handa@etl.go.jp>
+
+;;; General utility function
+
+(defun mule-debug-princ-list (&rest args)
+  (while (cdr args)
+    (if (car args)
+	(progn (princ (car args)) (princ " ")))
+    (setq args (cdr args)))
+  (princ (car args))
+  (princ "\n"))
+
+;;; character sets
+
+;;;###autoload
+(defun list-charsets ()
+  "Display a list of existing character sets."
+  (interactive)
+  (with-output-to-temp-buffer "*Charset List*"
+    (princ "## LIST OF CHARACTER SETS\n")
+    (princ
+     "NAME                 REGISTRY        BYTES CHARS FINAL GRAPHIC DIR\n")
+    (princ
+     "--------------------------------------------------------------------\n")
+    (dolist (charset (charset-list))
+      (setq charset (get-charset charset))
+      (princ (format
+	      "%-20.20s %-15.15s %5d %5d %5d %-7d %s\n"
+	      (charset-name charset)
+	      (charset-registry  charset)
+	      (charset-dimension charset)
+	      (charset-chars     charset)
+	      (charset-final     charset)
+	      (charset-graphic   charset)
+	      (charset-direction charset)))
+      (princ "        ")
+      (princ (format "%s\n" (charset-doc-string charset))))))
+
+;    (princ "## CCL PROGRAM TO CONVERT INTERNAL TO EXTERNAL CODE\n")
+;    (princ "NAME                 CCL-PROGRAMS\n")
+;    (mapcar
+;     (lambda (name)
+;       (let ((ccl (charset-ccl-program name)))
+;	 (if ccl
+;	     (let ((i 0) (len (length ccl)))
+;	       (princ (format "%20s " name))
+;	       (while (< i len)
+;		 (princ (format " %x" (aref ccl i)))
+;		 (setq i (1+ i)))
+;	       (princ "\n")))))
+;     (charset-list))
+;    ))
+
+;;;###autoload
+(define-obsolete-function-alias
+  'list-coding-system-briefly 'describe-current-coding-system-briefly)
+
+;; (defun list-coding-system-briefly ()
+;;   "Display coding-systems currently used with a brief format in mini-buffer."
+;;   (interactive)
+;;   (let ((cs (and (fboundp 'process-coding-system) (process-coding-system)))
+;;         eol-type)
+;;     (message
+;;      "current: [FKDPp=%c%c%c%c%c%c%c%c] default: [FPp=%c%c%c%c%c%c]"
+;;      (coding-system-mnemonic buffer-file-coding-system)
+;;      (coding-system-eol-mnemonic buffer-file-coding-system)
+;;      (coding-system-mnemonic keyboard-coding-system)
+;;      (coding-system-mnemonic terminal-coding-system)
+;;      (coding-system-mnemonic (car cs))
+;;      (coding-system-eol-mnemonic (car cs))
+;;      (coding-system-mnemonic (cdr cs))
+;;      (coding-system-eol-mnemonic (cdr cs))
+;;      (coding-system-mnemonic (default-value 'buffer-file-coding-system))
+;;      (coding-system-eol-mnemonic (default-value 'buffer-file-coding-system))
+;;      (coding-system-mnemonic (car default-process-coding-system))
+;;      (coding-system-eol-mnemonic (car default-process-coding-system))
+;;      (coding-system-mnemonic (cdr default-process-coding-system))
+;;      (coding-system-eol-mnemonic (cdr default-process-coding-system))
+;;      )))
+
+;; (defun princ-coding-system (code)
+;;   (princ ": ")
+;;   (princ code)
+;;   (princ " [")
+;;   (princ (char-to-string (coding-system-mnemonic code)))
+;;   (princ (char-to-string (coding-system-eol-mnemonic code)))
+;;   (princ "]\n"))
+
+;; (defun todigit (flags idx &optional default-value)
+;;   (if (aref flags idx)
+;;       (if (numberp (aref flags idx)) (aref flags idx) 1)
+;;     (or default-value 0)))
+
+;; (defun print-coding-system-description (code)
+;;   (let ((type (get-code-type code))
+;;         (eol (or (get-code-eol code) 1))
+;;         (flags (get-code-flags code))
+;;         line)
+;;     (setq type
+;;           (cond ((null type) 0)
+;;                 ((eq type t) 2)
+;;                 ((eq type 0) 1)
+;;                 ((eq type 1) 3)
+;;                 ((eq type 2) 4)
+;;                 ((eq type 3) 5)
+;;                 ((eq type 4) 6)
+;;                 (t nil)))
+;;     (if (or (null type)
+;;             (get code 'post-read-conversion)
+;;             (get (get-base-code code) 'post-read-conversion)
+;;             (get code 'pre-write-conversion)
+;;             (get (get-base-code code) 'pre-write-conversion)
+;;             (eq code '*noconv*))
+;;         nil
+;;       (princ
+;;        (format "%s:%d:%c:"
+;;                code type (coding-system-mnemonic code)))
+;;       (princ (format "%d" (if (numberp eol) eol 0)))
+;;       (cond ((= type 4)
+;;              (princ
+;;               (format
+;;                ":%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d"
+;;                (todigit flags 0 -1)
+;;                (todigit flags 1 -1)
+;;                (todigit flags 2 -1)
+;;                (todigit flags 3 -1)
+;;                (todigit flags 4)
+;;                (todigit flags 5)
+;;                (todigit flags 6)
+;;                (todigit flags 7)
+;;                (todigit flags 8)
+;;                (todigit flags 9)
+;;                (todigit flags 10)
+;;                (todigit flags 11))))
+;;             ((= type 5)
+;;              (princ ":0"))
+;;             ((= type 6)
+;;              (if (and (vectorp (car flags)) (vectorp (cdr flags)))
+;;                  (let (i len)
+;;                    (princ ":")
+;;                    (setq i 0 len (length (car flags)))
+;;                    (while (< i len)
+;;                      (princ (format " %x" (aref (car flags) i)))
+;;                      (setq i (1+ i)))
+;;                    (princ ",")
+;;                    (setq i 0 len (length (cdr flags)))
+;;                    (while (< i len)
+;;                      (princ (format " %x" (aref (cdr flags) i)))
+;;                      (setq i (1+ i))))))
+;;             (t (princ ":0")))
+;;       (princ ":")
+;;       (princ (get-code-document code))
+;;       (princ "\n"))
+;;     ))
+
+;;;###autoload
+(define-obsolete-function-alias
+  'list-coding-system 'describe-coding-system)
+
+;; (defun list-coding-system (&optional all)
+;;   "Describe coding-systems currently used with a detailed format.
+;; If optional arg ALL is non-nil, all coding-systems are listed in
+;; machine readable simple format."
+;;   (interactive "P")
+;;   (with-output-to-temp-buffer "*Help*"
+;;     (if (null all)
+;;         (let ((cs (and (fboundp 'process-coding-system)
+;;                        (process-coding-system))))
+;;           (princ "Current:\n  buffer-file-coding-system")
+;;           (princ-coding-system buffer-file-coding-system)
+;;           (princ "  keyboard-coding-system")
+;;           (princ-coding-system keyboard-coding-system)
+;;           (princ "  terminal-coding-system")
+;;           (princ-coding-system terminal-coding-system)
+;;           (when cs
+;;             (princ "  process-coding-system (input)")
+;;             (princ-coding-system (car cs))
+;;             (princ "  process-coding-system (output)")
+;;             (princ-coding-system (cdr cs)))
+;;           (princ "Default:\n  buffer-file-coding-system")
+;;           (princ-coding-system (default-value 'buffer-file-coding-system))
+;;           (princ "  process-coding-system (input)")
+;;           (princ-coding-system (car default-process-coding-system))
+;;           (princ "  process-coding-system (output)")
+;;           (princ-coding-system (cdr default-process-coding-system))
+;;           (princ "Others:\n  buffer-file-coding-system-for-read")
+;;           (princ-coding-system buffer-file-coding-system-for-read)
+;;           (princ "Coding categories by priority:\n")
+;;           (princ (coding-priority-list)))
+;;       (princ "########################\n")
+;;       (princ "## LIST OF CODING SYSTEM\n")
+;;       (princ "## NAME(str):TYPE(int):MNEMONIC(char):EOL(int):FLAGS:DOC(str)\n")
+;;       (princ "##  TYPE = 0(no conversion),1(auto conversion),\n")
+;;       (princ "##         2(Mule internal),3(SJIS),4(ISO2022),5(BIG5),6(CCL)\n")
+;;       (princ "##  EOL = 0(AUTO), 1(LF), 2(CRLF), 3(CR)\n")
+;;       (princ "##  FLAGS =\n")
+;;       (princ "##    if TYPE = 4 then\n")
+;;       (princ "##        G0,G1,G2,G3,SHORT,ASCII-EOL,ASCII-CNTL,SEVEN,\n")
+;;       (princ "##        LOCK-SHIFT,USE-ROMAN,USE-OLDJIS\n")
+;;       (princ "##    else if TYPE = 6 then\n")
+;;       (princ "##        CCL_PROGRAM_FOR_READ,CCL_PROGRAM_FOR_WRITE\n")
+;;       (princ "##    else\n")
+;;       (princ "##        0\n")
+;;       (princ "##\n")
+;;       (let ((codings nil))
+;;         (mapatoms
+;;          (function
+;;           (lambda (arg)
+;;             (if (eq arg '*noconv*)
+;;                 nil
+;;               (if (and (or (vectorp (get arg 'coding-system))
+;;                            (vectorp (get arg 'eol-type)))
+;;                        (null (get arg 'pre-write-conversion))
+;;                        (null (get arg 'post-read-conversion)))
+;;                   (setq codings (cons arg codings)))))))
+;;         (while codings
+;;           (print-coding-system-description (car codings))
+;;           (setq codings (cdr codings))))
+;;       (princ "############################\n")
+;;       (princ "## LIST OF CODING CATEGORIES (ordered by priority)\n")
+;;       (princ "## CATEGORY(str):CODING-SYSTEM(str)\n")
+;;       (princ "##\n")
+;;       (princ (coding-priority-list))
+;;       )))
+
+;;; FONT
+(defun describe-font-internal (fontinfo &optional verbose)
+  (let ((cs (character-set (aref fontinfo 3))))
+    (mule-debug-princ-list (format "Font #%02d for" (aref fontinfo 0))
+		(nth 6 cs) (nth 7 cs) "--"
+		(cond ((= (aref fontinfo 4) 0) "NOT YET OPENED")
+		      ((= (aref fontinfo 4) 1) "OPENED")
+		      (t "NOT FOUND")))
+    (mule-debug-princ-list "  request:" (aref fontinfo 1))
+    (if (= (aref fontinfo 4) 1)