Merge egg-980220.
authormorioka <morioka>
Fri, 20 Feb 1998 12:11:30 +0000 (12:11 +0000)
committermorioka <morioka>
Fri, 20 Feb 1998 12:11:30 +0000 (12:11 +0000)
ChangeLog
egg.el
egg/sj3.el
egg/sj3rpc.el
egg/wnn.el
egg/wnnrpc.el
leim-list-egg.el
menudiag.el

index 5cdd3ae..9989248 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,187 @@
+1998-02-20  KATAYAMA Yoshio <kate@pfu.co.jp>
+
+       * its.el (its-restart): New function.
+       (its-insert-fence-open, its-insert-fence-close): New function.
+       (its-start): Rewritten.  Use its-insert-fence-open and
+       its-insert-fence-close.
+       (its-exit-mode-internal): Leave its-syl property.
+       (its-exit-mode-internal): Delete the property in this case.
+       (its-keydef): Require it.
+
+       * its-keydef.el: Provide the feature.
+
+       * egg-cnv.el (egg-convert-region): Add egg-source property to save 
+       the source string.
+       (egg-conversion-map, \C-c): New keybind.
+       (egg-get-previous-bunsetsu): Bug fix.
+       (egg-decide-before-point): New implementation.
+       (egg-exit-conversion): Use gg-decide-before-point.
+       (egg-abort-conversion): New command.
+
+1998-02-20  NIIBE Yutaka  <gniibe@akebono>
+
+       * Makefile (SRCS), Egg.prj: Remove euc-china.el.
+       * egg-com.el: Include egg-china.el.
+       * egg-china.el: Removed.
+
+1998-02-18  NIIBE Yutaka  <gniibe@mri.co.jp>
+
+       * Egg.prj: Use PRCS.
+
+       * Makefile (SRCS): Rename euc-cn.el to euc-china.el
+       * egg-mlh.el (mlh-space-bar-backward-henkan): Put "Japanese"
+       language property for text.
+
+1998-02-18  KATAYAMA Yoshio <kate@pfu.co.jp>
+
+       * euc-china.el: Rename from euc-cn.el.  Update.
+
+       * egg.el (egg-mode): Bug fix.  Call get-exit-conversion.
+       * leim-list-egg.el ("japanese-egg-wnn", "japanese-egg-sj3"): 
+       Use new definition (with language argument).
+       * egg/wnn.el (egg-activate-wnn): 
+       * egg/sj3.el (egg-activate-sj3): 
+       
+1998-02-17  NIIBE Yutaka  <gniibe@mri.co.jp>
+
+       * Makefile (SRCS): Add its/pinyin.el, its/hangul.el and
+       its-keydef.el.
+
+       * egg-com.el (ccl-encode-fixed-euc-kr): Fixed the name.
+       
+1998-02-17  KATAYAMA Yoshio <kate@pfu.co.jp>
+       
+       * its-keydef.el: New file.
+       * its/hangul.el, its/pinyin.el: New version.
+
+       * egg/wnnrpc.el (load-library "egg/wnn"): Comment it out.
+       (wnnrpc-get-error-message): Support multiple languages.
+       (wnnrpc-call-with-environment): Chinese support.
+
+       * egg/wnn.el (wnn-support-languages): New const.
+       (<env>): Add <server-type>, <dic-set>, and <rev-flag>.
+       (wnnenv-get-server-type, wnnenv-get-dictionary-set,
+        wnnenv-get-reverse-flag): New substs.
+       (wnnenv-get-daibunsetsu-info, wnnenv-set-daibunsetsu-info): Changed.
+       (wnn-server): Removed.
+       (wnn-jserver, wnn-cserver, wnn-tserver, wnn-kserver): New custom.
+       (wnn-server-info-list): New const.
+       (wnn-get-server-info): New function.
+       (wnn-server-locale, wnn-server-type, wnn-server-port,
+        wnn-server-stream-name, wnn-server-buffer-name,
+        wnn-server-coding-system, wnn-server-hostname): New substs.
+       (wnn-start-conversion): Add new arguments.
+       (wnn-uniq-candidates): Initialize 'n'.
+       (wnn-change-bunsetsu-length): Simplefied.
+       (wnn-change-bunsetsu-length): Call renbunsetsu-conversion,
+       instead.
+       (wnn-fini, wnn-comm-sentinel): back to 971009 version.
+       (wnn-jserver-port): Removed.
+       (wnn-open): Argument change.  Support languages.
+
+       (wnn-dictionary-specification): Removed.
+       (wnn-dictionary-specification-list): New variable.
+       (wnn-get-dic-spec, wnn-dic-spec-dic-set, wnn-dic-spec-reverse,
+       wnn-dic-spec-name, wnn-dic-spec-param, wnn-dic-spec-fuzokugo,
+        wnn-dic-spec-dic-list): New substs.
+       (wnn-get-environment): Rewrite.
+       (wnn-create-environment): Rewrite.
+
+       (egg-activate-wnn): Support languages.
+
+       * egg/sj3rpc.el (load-library "egg/sj3"): Don't load it.
+
+       * egg/sj3.el (sj3-support-languages): New const.
+       (sj3-start-conversion, sj3-fini): Add lang.
+       (sj3-change-bunsetsu-length): Simplified.
+       (egg-activate-sj3): Support language.
+
+       * its/hira.el (its/hira): Packagefy. (?)
+       (its-hira-map): Add language spec.  Move here the escape keys
+       ("Z", "~").
+
+       * leim-list-egg.el ("chinese-gb-egg-wnn-py", "chinese-gb-egg-wnn-zy",
+        "chinese-cns-egg-wnn-py", "chinese-cns-egg-wnn-zy",
+        "korean-egg-wnn"): New input methods.
+
+       * its.el (its-current-language): New Local Variables.
+       <map>: Change the structure.  Add <language>.
+       (its-get-language): New substitution.
+       (its-set-indicator): Removed.
+       (its-get-indicator, its-get-start-state): New implementation.
+       (its-reset-start-state): Removed.
+       (its-buffer-ins/del-SYL): Add new properties, its-map and its-lang.
+       (its-exit-mode-internal): Change for its-map and its-lang.
+       (its-in-fence-p): New function.
+
+       ("its-keydef.el"): Load it.
+
+       (its-select-map-menu): Removed.
+       (its-select-map-from-menu): Removed.
+       (its-select-hiragana, its-select-katakana, its-select-downcase,
+       its-select-upcase, its-select-zenkaku-downcase,
+       its-select-zenkaku-upcase, its-select-map, its-zenkaku-escape,
+       its-hankaku-escape): Removed.
+
+       (define-its-state-machine): Rewrite.
+       (define-its-compiled-map): New macro.
+       (its-define-state-machine): Removed.
+
+       (its-forward-SYL): Cleanup.
+
+       (its-beginning-of-input-buffer): Fix.
+       (its-end-of-input-buffer): Likewise.
+
+       * egg-com.el (egg-fixed-euc, egg-mb-euc): New Local Variables.
+       (ccl-decode-fixed-euc-kr, ccl-encode-fixed-euc-kr): New CCLs.
+       (fixed-euc-kr): New coding system.
+       (comm-format-mb-string, comm-format-u16-string): Support EUC-KR.
+       (comm-unpack-u16-string, comm-unpack-mb-string): Likewise.
+
+       * egg-cnv.el (egg-get-bunsetsu-info): New function.
+       (egg-conversion-backend-alist, egg-finalize-backend-alist): 
+       New Variables.
+       Make egg-conversion-backend buffer local.
+       (egg-set-current-backend): New function.
+       (egg-initialize-backend): Call egg-set-current-backend.
+       (egg-start-conversion): Add new argument LANGUAGE.
+       (egg-finalize-backend): Finalize for all backend(s).
+       (egg-set-conversion-backend-internal): New Macro.
+       (egg-convert-region): Support multiple languages in the region.
+       (egg-separate-languages, egg-char-to-language, egg-next-part-lang,
+       egg-next-chinese-lang): New functions.
+       (egg-insert-bunsetsu-list): Change the meaning of last argument.
+       (egg-shrink-bunsetsu): Simplified.  Just call egg-enlarge-bunsetsu.
+       (egg-enlarge-bunsetsu): Support shrink.
+
+       (egg-decide-bunsetsu, egg-next-candidate, egg-select-candidate): 
+       Use egg-get-bunsetsu-info.
+
+       (egg-insert-bunsetsu): The property now includes
+       egg-conversion-backend.
+
+       * egg.el: Don't load its/hira and don't set its-current-map.
+
+       * egg.el (egg-default-language, egg-support-languages): New Variables.
+       (egg-last-method-name, egg-mode-line-title): New Local Variables.
+       (egg-set-mode-line-title, egg-check-language): New functions.
+       (egg-set-support-languages): New function.
+       (egg-mode): Final processing: call its-exit-mode, call
+       egg-exit-conversion.
+       Changing the arguments, remember last input method.
+
+       Bug fix. Don't set its-hira-period and its-hira-comma.
+
+1998-02-17  KAWABATA, Taichi
+
+       * menudiag.el (menudiag-mode-map): New binds for new commands.
+       (menudiag-beginning-of-items, menudiag-end-of-items): New commands.
+       (menudiag-make-menu-formatted-string): Bug fix.  Use 
+       menudiag-item-num-to-char.
+       (menudiag-goto-item): Rewrite.  Better user interface.
+       (menudiag-char-to-item-num, menudiag-item-num-to-char): New
+       functions.
+
 1998-02-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
 
        * leim-list-egg.el: Delete autoload setting for `egg-mode'.
diff --git a/egg.el b/egg.el
index d722a3a..c8403a0 100644 (file)
--- a/egg.el
+++ b/egg.el
@@ -1,21 +1,22 @@
 ;;; egg.el --- EGG Input Method Architecture
 
-;; Copyright (C) 1997 Mule Project, Powered by Electrotechnical
+;; Copyright (C) 1997, 1998 Mule Project, Powered by Electrotechnical
 ;; Laboratory, JAPAN.
 ;; Project Leader: Satoru Tomura <tomura@etl.go.jp>
 
 ;; Author: NIIBE Yutaka <gniibe@mri.co.jp>
+;;         KATAYAMA Yoshio <kate@pfu.co.jp>
 ;; Maintainer: NIIBE Yutaka <gniibe@mri.co.jp>
 ;; Keywords: mule, multilingual, input method
 
 ;; This file will be part of GNU Emacs (in future).
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; EGG 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.
 
-;; GNU Emacs is distributed in the hope that it will be useful,
+;; EGG 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.
 (defvar egg-mode-preference t
   "Non-nil if modefull.")
 
+(defvar egg-default-language "Japanese")
+(defvar egg-last-method-name)
+(make-variable-buffer-local 'egg-last-method-name)
+(defvar egg-mode-line-title)
+(make-variable-buffer-local 'egg-mode-line-title)
+
 ;;;###autoload
-(defun egg-mode (&optional arg)
+(defun egg-mode (&rest arg)
   "Toggle EGG  mode.
 \\[describe-bindings]
 "
   (if (null arg)
       ;; Turn off
       (progn
+       (cond
+        ((its-in-fence-p)
+         (its-exit-mode))
+        ((egg-get-bunsetsu-info (point))
+         (egg-exit-conversion)))
        (setq describe-current-input-method-function nil)
        (setq current-input-method nil)
        (let ((orig-local-map (keymap-parent (current-local-map))))
          (use-local-map orig-local-map))
        (run-hooks 'input-method-inactivate-hook))
     ;; Turn on
+    (if (null (string= (car arg) egg-last-method-name))
+       (progn
+         (funcall (nth 1 arg))
+        (setq egg-default-language its-current-language)))
+    (setq egg-last-method-name (car arg))
     (use-local-map (if egg-mode-preference
                       (egg-modefull-map)
                     (egg-modeless-map)))
     (run-hooks 'input-method-activate-hook))
   (force-mode-line-update))
 
+(defun egg-set-mode-line-title (title)
+  (setq egg-mode-line-title title)
+  (force-mode-line-update))
+
+(defun egg-check-language (lang)
+  (if (null (member lang egg-support-languages))
+      (error "%S is not supported" lang)))
+
 (defun egg-modefull-map ()
   "Generate modefull keymap for EGG mode."  
   (let ((map (make-sparse-keymap))
          (setq ocolumn (current-column))
          (funcall auto-fill-function)))))
 
-(setq its-hira-period "\e$B!#\e(B")    ; ". " "\e$B!%\e(B" "\e$B!#\e(B"
-(setq its-hira-comma  ", ")    ; ", " "\e$B!$\e(B" "\e$B!"\e(B"
-
 (require 'its)
 (require 'menudiag)
 (require 'egg-mlh)
 (defgroup egg nil
   "Tamagotchy --- EGG Versio 4.0")
 
-(load-library "its/hira")
-(setq-default its-current-map its-hira-map)
+;;(load-library "its/hira")
+;;(setq-default its-current-map its-hira-map)
 
 ;;(load-library "egg/wnn")
 ;;(load-library "egg/wnnrpc")
 ;;(load-library "egg/sj3")
 ;;(setq egg-conversion-backend sj3-conversion-backend)
 
+(defvar egg-support-languages nil)
+
+(defun egg-set-support-languages (langs)
+  (while langs
+    (if (null (member (car langs) egg-support-languages))
+       (setq egg-support-languages (cons (car langs) egg-support-languages)))
+    (setq langs (cdr langs))))
+
 (add-hook 'kill-emacs-hook 'egg-kill-emacs-function)
 (defun egg-kill-emacs-function ()
   (egg-finalize-backend))
index cf05bfa..6f059a7 100644 (file)
 
 ;; This file will be part of GNU Emacs (in future).
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; EGG 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.
 
-;; GNU Emacs is distributed in the hope that it will be useful,
+;; EGG 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.
@@ -29,6 +29,8 @@
 
 ;;; Code:
 
+(defconst sj3-support-languages '("Japanese"))
+
 (defconst sj3-conversion-backend
   [ sj3-init
 
 (defun sj3-init ()
   )
 
-(defun sj3-start-conversion (yomi)
+(defun sj3-start-conversion (yomi lang)
   "Convert YOMI string to kanji, and enter conversion mode.
 Return the list of bunsetsu."
   (let ((env (sj3-get-environment)))
@@ -220,10 +222,8 @@ Return the list of bunsetsu."
        (env (sj3bunsetsu-get-env b1))
        yomi1 yomi2
        bunsetsu1 bunsetsu2)
-    (save-match-data
-      (string-match (concat "^\\(" (make-string len ?.) "\\)\\(.*$\\)") yomi)
-      (setq yomi1 (match-string 1 yomi))
-      (setq yomi2 (match-string 2 yomi)))
+    (setq yomi1 (substring yomi 0 len)
+         yomi2 (substring yomi len))
     (setq bunsetsu1
          (sj3rpc-tanbunsetsu-conversion env yomi1))
     ;; Only set once.
@@ -240,7 +240,7 @@ Return the list of bunsetsu."
       (list bunsetsu1))))
 
 ;; XXX: Not implemented yet
-(defun sj3-fini ()
+(defun sj3-fini (lang)
   )
 
 ;;; setup
@@ -249,10 +249,12 @@ Return the list of bunsetsu."
 (load "egg/sj3rpc")
 
 ;;;###autoload
-(defun egg-activate-sj3 (&optional arg)
+(defun egg-activate-sj3 (&rest arg)
   "Activate SJ3 backend of Tamagotchy."
-  (setq egg-conversion-backend sj3-conversion-backend)
-  (egg-mode arg)
-  )
+  (egg-set-support-languages sj3-support-languages)
+  (egg-set-conversion-backend sj3-conversion-backend 
+                             sj3-support-languages
+                             nil)
+  (apply 'egg-mode arg))
 
 ;;; egg/sj3.el ends here.
index 6ae09aa..c92dbb7 100644 (file)
 
 ;; This file will be part of GNU Emacs (in future).
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; EGG 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.
 
-;; GNU Emacs is distributed in the hope that it will be useful,
+;; EGG 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.
@@ -33,7 +33,7 @@
 
 (eval-when-compile
   (require 'egg-com)
-  (load-library "egg/sj3")
+;;  (load-library "egg/sj3")
   (defmacro sj3-const (c)
     (cond ((eq c 'OPEN)            1)
          ((eq c 'CLOSE)           2)
index d043bf0..a07977e 100644 (file)
@@ -1,21 +1,23 @@
 ;;; egg/wnn.el --- WNN Support (high level interface) in Egg
 ;;;                Input Method Architecture
 
-;; Copyright (C) 1997 Mule Project, Powered by Electrotechnical
+;; Copyright (C) 1997, 1998 Mule Project, Powered by Electrotechnical
 ;; Laboratory, JAPAN.
 ;; Project Leader: Satoru Tomura <tomura@etl.go.jp>
 
 ;; Author: NIIBE Yutaka <gniibe@mri.co.jp>
+;;         KATAYAMA Yoshio <kate@pfu.co.jp> ; Korean, Chinese support.
+;;
 ;; Maintainer: NIIBE Yutaka <gniibe@mri.co.jp>
 
-;; This file will be part of GNU Emacs (in future).
+;; This file will be part of EGG (in future).
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; EGG 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.
 
-;; GNU Emacs is distributed in the hope that it will be useful,
+;; EGG 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.
 ;;; Commentary:
 
 ;;; Code:
-
 (defgroup wnn nil
   "Wnn interface for Tamagotchy"
   :group 'egg)
 
+(defconst wnn-support-languages
+  '("Japanese" "Chinese-GB" "Chinese-CNS" "Korean"))
+
 (eval-when-compile
   (defmacro WNN-const (c)
     (cond ((eq c 'BUN_SENTOU) -1)
     wnn-fini
  ])
 
-;; <env> ::= [ <proc> <env-id> <daibunsetsu-info> ]
+;; <env> ::= [ <proc> <env-id> <server-type> <dic-set> <rev-flag>
+;;             <daibunsetsu-info> ]
 
-(defsubst wnnenv-create (proc env-id)
-  (vector proc env-id nil))
+(defsubst wnnenv-create (proc env-id server-type dic-set rev-flag)
+  (vector proc env-id server-type dic-set rev-flag nil))
 
 (defsubst wnnenv-get-proc (env)
   (aref env 0))
 (defsubst wnnenv-get-env-id (env)
   (aref env 1))
 
-(defsubst wnnenv-get-daibunsetsu-info (env)
+(defsubst wnnenv-get-server-type (env)
   (aref env 2))
+
+(defsubst wnnenv-get-dictionary-set (env)
+  (aref env 3))
+
+(defsubst wnnenv-get-reverse-flag (env)
+  (aref env 4))
+
+(defsubst wnnenv-get-daibunsetsu-info (env)
+  (aref env 5))
 (defsubst wnnenv-set-daibunsetsu-info (env d)
-  (aset env 2 d))
+  (aset env 5 d))
 
 ;; <bunsetsu> ::= [ <env> <end> <start> <jiritsugo-end> <dic-no>
 ;;                  <entry> <freq> <right-now> <hinshi> <status>
 (defsubst wnn-bunsetsu-set-zenkouho-pos (bunsetsu zp)
   (aset bunsetsu 18 zp))
 \f
-(defcustom wnn-server "localhost"
-  "Hostname of wnn server"
-  :group 'wnn
-  :type 'string)
-
-(defvar wnn-environment nil
+(defvar wnn-environments nil
   "Environment for WNN kana-kanji conversion")
 
+(defcustom wnn-jserver "localhost" "jserver host" :group 'wnn :type 'string)
+(defcustom wnn-cserver "localhost" "cserver host" :group 'wnn :type 'string)
+(defcustom wnn-tserver "localhost" "tserver host" :group 'wnn :type 'string)
+(defcustom wnn-kserver "localhost" "kserver host" :group 'wnn :type 'string)
+
+;; The port number should be initialized from $WNNLIB/serverdefs by wnn-init
+(defconst wnn-server-info-list
+  ;; language      locale  server  port  stream coding-system hostname
+  '(("Japanese"    "ja_JP" jserver 22273 "Wnn"  fixed-euc-jp wnn-jserver)
+    ("Chinese-GB"  "zh_CN" cserver 22289 "cWnn" fixed-euc-cn wnn-cserver)
+    ("Chinese-CNS" "zh_TW" tserver 22321 "tWnn" fixed-euc-tw wnn-tserver)
+    ("Korean"      "ko_KR" kserver 22305 "kWnn" fixed-euc-kr wnn-kserver)))
+
+(defun wnn-get-server-info (lang)
+  (let (info)
+    (if (null lang)
+       (setq lang its-current-language))
+    (if (setq info (assoc lang wnn-server-info-list)) info
+      (assoc "Japanese" wnn-server-info-list))))
+
+(defsubst wnn-server-locale (info)
+  (nth 1 info))
+
+(defsubst wnn-server-type (info)
+  (nth 2 info))
+
+(defsubst wnn-server-port (info)
+  (nth 3 info))
+
+(defsubst wnn-server-stream-name (info)
+  (nth 4 info))
+
+(defsubst wnn-server-buffer-name (info)
+  (concat " *" (wnn-server-stream-name info) "*"))
+
+(defsubst wnn-server-coding-system (info)
+  (nth 5 info))
+
+(defsubst wnn-server-hostname (info)
+  (symbol-value (nth 6 info)))
+
 (defun wnn-init ()
   )
 
-(defun wnn-start-conversion (yomi)
+(defun wnn-start-conversion (yomi &optional language dic-set reverse)
   "Convert YOMI string to kanji, and enter conversion mode.
 Return the list of bunsetsu."
-  (let* ((env (wnn-get-environment wnn-dictionary-specification))
+  (let* ((server-info (wnn-get-server-info language))
+        (env (wnn-get-environment server-info dic-set reverse))
         (result (wnnrpc-renbunsetsu-conversion env yomi
                                                (WNN-const BUN_SENTOU) "")))
     (wnnenv-set-daibunsetsu-info env (car result))
@@ -177,7 +228,7 @@ Return the list of bunsetsu."
   (let ((hash-table (make-vector 31 0)) ; XXX why 31?
        (l bunsetsu-list)
        (i 0)
-       n sym0 result p b sym)
+       (n 0) sym0 result p b sym)
     (setq sym0 (intern (wnn-get-bunsetsu-converted bunsetsu) hash-table))
     (while l
       (setq b (car l)
@@ -261,10 +312,8 @@ Return the list of bunsetsu."
              prev-fuzokugo "")
       (setq prev-hinshi (wnn-bunsetsu-get-hinshi b0)
            prev-fuzokugo (wnn-bunsetsu-get-fuzokugo b0)))
-    (save-match-data
-      (string-match (concat "^\\(" (make-string len ?.) "\\)\\(.*$\\)") yomi)
-      (setq yomi1 (match-string 1 yomi))
-      (setq yomi2 (match-string 2 yomi)))
+    (setq yomi1 (substring yomi 0 len)
+         yomi2 (substring yomi len))
     (setq bunsetsu1
          (car (wnnrpc-tanbunsetsu-conversion env yomi1
                                              prev-hinshi prev-fuzokugo)))
@@ -275,15 +324,14 @@ Return the list of bunsetsu."
                                        (list b1 b2)
                                      (list b1))))
     (if (< 0 (length yomi2))
-       ;; RENBUNSETSU? XXX
        (setq bunsetsu2
-             (car (wnnrpc-tanbunsetsu-conversion
+             (cdr (wnnrpc-renbunsetsu-conversion
                    env yomi2
                    (wnn-bunsetsu-get-hinshi bunsetsu1)
                    (wnn-bunsetsu-get-fuzokugo bunsetsu1))))
       (setq bunsetsu2 nil))
     (if bunsetsu2
-       (list bunsetsu1 bunsetsu2)
+       (append (list bunsetsu1) bunsetsu2)
       (list bunsetsu1))))
 
 
@@ -299,42 +347,60 @@ Return the list of bunsetsu."
 (defvar wnn-sticky-environment-flag nil
   "*Flag which specifies sticky environment.")
 
-(defun wnn-fini ()                     ; XXX
-  (if (null wnn-environment)
-      nil
-    (condition-case nil
-       (progn
-         (if wnn-sticky-environment-flag
-             (wnnrpc-make-env-sticky wnn-environment)
-           (wnnrpc-make-env-unsticky wnn-environment))
-         (wnnrpc-disconnect wnn-environment))
-      (error nil))
-    (let ((proc (wnnenv-get-proc wnn-environment)))
-      (if (eq (process-status proc) 'open)
-         (progn
-           (wnnrpc-close proc)
-           (kill-buffer (process-buffer proc))
-           (delete-process proc))))
-    (setq wnn-environment nil)))
+(defun wnn-fini (lang)                 ; XXX
+                                       ; tamago-971009 version
+                                       ; argument LANG is still dummy
+  (if wnn-environments
+      (let ((l wnn-environments))
+       (condition-case nil
+           (while l
+             (let ((env (car l)))
+               (if wnn-sticky-environment-flag
+                   (wnnrpc-make-env-sticky env)
+                 (wnnrpc-make-env-unsticky env))
+               (wnnrpc-disconnect env)
+               (setq l (cdr l))))
+         (error nil))
+       (setq l wnn-environments)
+       (while l
+         (let ((proc (wnnenv-get-proc (car l))))
+           (if (eq (process-status proc) 'open)
+               (progn
+                 (wnnrpc-close proc)
+                 (kill-buffer (process-buffer proc)))
+             (setq l (cdr l)))))
+       (setq wnn-environments nil))))
 \f
-;; XXX should be array (index: server) of {C,J,K}server
-(defconst wnn-jserver-port 22273)
 ;;
 (defun wnn-comm-sentinel (proc reason) ; assume it is close
-  (kill-buffer (process-buffer proc))
-  (delete-process proc)
-  (setq wnn-environment nil)
-  (message "WNN: connection closed"))
+                                       ; tamago-971009 version
+  (let ((l wnn-environments)
+       env l1)
+    (kill-buffer (process-buffer proc))
+    ;; delete env from the list.
+    (while l
+      (setq env (car l))
+      (if (eq proc (wnnenv-get-proc env))
+         (progn
+           (if l1
+               (setcdr l1 (cdr l))
+             (setq wnn-environments (cdr l)))
+           (setq l (cdr l)))
+       (setq l1 l
+             l (cdr l))))))
 
 ;;
-(defun wnn-open (hostname language)
+(defun wnn-open (server-info)
   "Establish the connection to WNN server.  Return process object."
-  ;; Specifying language (jserver/cserver/kserver),
-  ;; open the session to WNN server, 
-  (let ((buf (generate-new-buffer " *WNN*"))
-       proc result)
+  ;; Open the session to WNN server, 
+  (let ((buf (generate-new-buffer (wnn-server-buffer-name server-info)))
+       (hostname (wnn-server-hostname server-info))
+       proc result)
     (condition-case result
-       (setq proc (open-network-stream "WNN" buf hostname wnn-jserver-port))
+       (setq proc (open-network-stream (wnn-server-stream-name server-info)
+                                       buf
+                                       hostname
+                                       (wnn-server-port server-info)))
       (error (progn
               (kill-buffer buf)
               (signal (car result) (cdr result)))))
@@ -346,33 +412,141 @@ Return the list of bunsetsu."
       (set-buffer buf)
       (erase-buffer)
       (buffer-disable-undo)
-      (setq enable-multibyte-characters nil))
-    (setq result (wnnrpc-open proc (system-name) (user-login-name)))
+      (setq enable-multibyte-characters nil
+           egg-fixed-euc (wnn-server-coding-system server-info)))
+    (setq result (wnnrpc-open proc
+                             (if (equal hostname "localhost")
+                                 "unix"
+                               (system-name))
+                             (user-login-name)))
     (if (< result 0)
        (let ((msg (wnnrpc-get-error-message (- result))))
          (delete-process proc)
          (kill-buffer buf)
-         (error "Can't open WNN session (%s %s): %s" hostname language msg))
+         (error "Can't open WNN session (%s %S): %s"
+                hostname
+                (wnn-server-type server-info) msg))
       proc)))
 
-(defvar wnn-dictionary-specification
-  '([2 10 2 45 100 200 5 1 40 0 -100 200 -100  200 80 200 200]
-    "pubdic/full.fzk"
-    ["pubdic/kihon.dic"     ("kihon.h")    5 nil t]
-    ["pubdic/setsuji.dic"   ("setsuji.h")  5 nil t]
-    ["pubdic/koyuu.dic"     ("koyuu.h")    1 nil t]
-    ["pubdic/chimei.dic"    ("chimei.h")   1 nil t]
-    ["pubdic/jinmei.dic"    ("jinmei.h")   1 nil t]
-    ["pubdic/special.dic"   ("special.h")  5 nil t]
-    ["pubdic/computer.dic"  ("computer.h") 5 nil t]
-    ["pubdic/symbol.dic"    ("symbol.h")   1 nil t]
-    ["pubdic/tankan.dic"    ("tankan.h")   1 nil t]
-    ["pubdic/bio.dic"       ("bio.h")      1 nil t]
-    ["gerodic/g-jinmei.dic" ("g-jinmei.h") 1 nil t]
-    ["wnncons/tankan2.dic"  ("tankan2.h")  1 nil t]
-    ["wnncons/tankan3.dic"  ("tankan3.h")  1 nil t]
-    [("ud")                 nil            5 t t])
-  "")
+(defvar wnn-dictionary-specification-list
+  '((jserver
+     (nil nil ""
+         [2 10 2 45 100 200 5 1 40 -100 200 -100 200 80 200 200 200]
+         "pubdic/full.fzk"
+         ["pubdic/kihon.dic"     ("kihon.h")    5 nil t]
+         ["pubdic/setsuji.dic"   ("setsuji.h")  5 nil t]
+         ["pubdic/koyuu.dic"     ("koyuu.h")    1 nil t]
+         ["pubdic/chimei.dic"    ("chimei.h")   1 nil t]
+         ["pubdic/jinmei.dic"    ("jinmei.h")   1 nil t]
+         ["pubdic/special.dic"   ("special.h")  5 nil t]
+         ["pubdic/computer.dic"  ("computer.h") 5 nil t]
+         ["pubdic/symbol.dic"    ("symbol.h")   1 nil t]
+         ["pubdic/tankan.dic"    nil            1 nil nil]
+         ["pubdic/bio.dic"       ("bio.h")      1 nil t]
+         ["gerodic/g-jinmei.dic" ("g-jinmei.h") 1 nil t]
+         ["wnncons/tankan2.dic"  nil            1 nil nil]
+         ["wnncons/tankan3.dic"  nil            1 nil nil]
+         [("ud")                 nil            5 t   t])
+     (nil t "R"
+         [2 10 2 45 1 80 5 1 50 -20 400 -10 100 -100 200 0 200]
+         "pubdic/full.fzk"
+         ["pubdic/kihon.dic"     ("kihon.h")    5 nil t]
+         ["pubdic/setsuji.dic"   ("setsuji.h")  5 nil t]
+         ["pubdic/koyuu.dic"     ("koyuu.h")    1 nil t]
+         ["pubdic/chimei.dic"    ("chimei.h")   1 nil t]
+         ["pubdic/jinmei.dic"    ("jinmei.h")   1 nil t]
+         ["pubdic/special.dic"   ("special.h")  5 nil t]
+         ["pubdic/computer.dic"  ("computer.h") 5 nil t]
+         ["pubdic/symbol.dic"    ("symbol.h")   1 nil t]
+         ["pubdic/tankan.dic"    nil            1 nil nil]
+         ["pubdic/bio.dic"       ("bio.h")      1 nil t]
+         ["gerodic/g-jinmei.dic" ("g-jinmei.h") 1 nil t]
+         ["wnncons/tankan2.dic"  nil            1 nil nil]
+         ["wnncons/tankan3.dic"  nil            1 nil nil]
+         [("ud")                 nil            5 t   t]))
+    (cserver
+     (Q   nil "Q"
+         nil
+         "sys/full.con"
+         ["sys/QianMa.dic"       nil            1 nil nil])
+     (W   nil "W"
+         nil
+         "sys/full.con"
+         ["sys/WuBi.dic"         nil            1 nil nil])
+     (nil nil "PZ"
+         [1 5 2 750 10 80 10 5 1000 50 0 -200 0 0 0 16 0]
+         "sys/full.con"
+         ["sys/level_1.dic"      ("level_1.h")  4 nil t]
+         ["sys/level_2.dic"      ("level_2.h")  1 nil t]
+         ["sys/basic.dic"        ("basic.h")    7 nil t]
+         ["sys/computer.dic"     ("computer.h") 4 nil t]
+         ["sys/cwnn.dic"         ("cwnn.h")     4 nil t]
+         [("ud")                 nil            5 t   t])
+     (Q   t "QR"
+         nil
+         "sys/full.conR"
+         ["sys/QianMa.dic"       nil            1 nil nil])
+     (W   t "WR"
+         nil
+         "sys/full.conR"
+         ["sys/WuBi.dic"         nil            1 nil nil])
+     (nil t "PZR"
+         [1 5 2 750 10 80 10 5 1000 50 0 -200 0 0 0 16 0]
+         "sys/full.conR"
+         ["sys/level_1.dic"      ("level_1.h")  4 nil t]
+         ["sys/level_2.dic"      ("level_2.h")  1 nil t]
+         ["sys/basic.dic"        ("basic.h")    7 nil t]
+         ["sys/computer.dic"     ("computer.h") 4 nil t]
+         ["sys/cwnn.dic"         ("cwnn.h")     4 nil t]
+         [("ud")                 nil            5 t   t]))
+    (tserver
+     (nil nil ""
+         [1 5 2 750 10 80 10 5 1000 50 0 -200 0 0 0 16 0]
+         "sys/full.con"
+         ["sys/cns_ch.dic"       ("cns_ch.h")   4 nil t]
+         ["sys/cns_wd.dic"       ("cns_wd.h")   1 nil t]
+         [("ud")                 nil            5 t   t])
+     (nil t "R"
+         [1 5 2 750 10 80 10 5 1000 50 0 -200 0 0 0 16 0]
+         "sys/full.conR"
+         ["sys/cns_ch.dic"       ("cns_ch.h")   4 nil t]
+         ["sys/cns_wd.dic"       ("cns_wd.h")   1 nil t]
+         [("ud")                 nil            5 t   t]))
+    (kserver
+     (nil nil ""
+         [2 5 2 45 200 80 5 1 40 0 400 -100 400 80 200 2 200]
+         "sys/full.fzk"
+         ["sys/hword.dic"        ("hword.h")    5 nil t]
+         ["sys/single.dic"       ("single.h")   1 nil t]
+         [("ud")                 nil            2 t   t])
+     (nil t "R"
+         [2 10 2 45 1 80 5 1 50 -20 400 -10 100 -100 200 0 200]
+         "sys/full.fzk"
+         ["sys/hword.dic"        ("hword.h")    5 nil t]
+         ["sys/single.dic"       ("single.h")   1 nil t]
+         [("ud")                 nil            2 t   t]))))
+
+(defsubst wnn-get-dic-spec (server)
+  (cdr (assoc server wnn-dictionary-specification-list)))
+
+(defsubst wnn-dic-spec-dic-set (spec)
+  (nth 0 spec))
+
+(defsubst wnn-dic-spec-reverse (spec)
+  (nth 1 spec))
+
+(defsubst wnn-dic-spec-name (spec)
+  (nth 2 spec))
+
+(defsubst wnn-dic-spec-param (spec)
+  (nth 3 spec))
+
+(defsubst wnn-dic-spec-fuzokugo (spec)
+  (nth 4 spec))
+
+(defsubst wnn-dic-spec-dic-list (spec)
+  (nthcdr 5 spec))
+
 
 (defcustom wnn-usr-dic-dir (concat "usr/" (user-login-name))
   "*Directory of user dictionary for Wnn."
@@ -520,48 +694,77 @@ On failure, return negate-encoded error code."
        (wnnrpc-open-file proc env-id freqname)) ; XXX: error?
     -1))
 
-(defun wnn-get-environment (dic-spec)
-  "Return WNN Environemt.  If none, create new environment.
-Take one argument DIC-SPEC for dictionary specification."
-  (if wnn-environment
-      wnn-environment
-    (let ((username (user-login-name))
-         (proc (wnn-open wnn-server "ja_JP")))
-      (setq wnn-environment
-           (wnn-create-environment proc username nil dic-spec)))))
-
-(defun wnn-create-environment (proc username reverse-flag spec)
+(defun wnn-get-environment (server-info &optional dic-set reverse)
+  "Return WNN Environemt for the conversion server specified
+by SERVER-INFO.  If none, create new environment.  Optional
+argument DIC-SET specifies dictionary set.  Optional argument
+REVERSE specifies reverse conversion, if non nil."
+  (let ((server-type (wnn-server-type server-info))
+       (env wnn-environments)
+       proc spec e s)
+    (setq reverse (null (null reverse)))
+    (if (catch 'found
+         (while env
+           (setq e (car env))
+           (if (and (eq (wnnenv-get-server-type e) server-type)
+                    (eq (wnnenv-get-dictionary-set e) dic-set)
+                    (eq (wnnenv-get-reverse-flag e) reverse))
+               (throw 'found t))
+           (setq env (cdr env))))
+       e
+      (setq proc (wnn-open server-info)
+           spec (wnn-get-dic-spec server-type))
+      (while spec
+       (setq s (car spec)
+             e (wnn-create-environment proc server-type s)
+             wnn-environments (cons e wnn-environments))
+       (if (and (eq (wnn-dic-spec-dic-set s) dic-set)
+                (eq (wnn-dic-spec-reverse s) reverse))
+           (setq env e))
+       (setq spec (cdr spec)))
+      env)))
+
+(defun wnn-create-environment (proc server-type spec)
   ""
   ;; Create new data structure: something like wnn_buf
   ;; Process, Environment-ID and Daibunsetsu-info.
-  (let (env env-id parameters)
-    (setq env-id (wnnrpc-connect proc username))
+  (let (env-id parameters filename fuzokugo-fid ret dic-set reverse)
+    (setq env-id (wnnrpc-connect proc (wnn-make-env-name spec)))
     (if (< env-id 0)
-       (let ((msg (wnnrpc-get-error-message (- env-id))))
-         (error "Can't connect new WNN environment: %s" msg)))
-    (setq parameters (car spec))
-    (setq spec (cdr spec))
-    (let ((filename (wnn-filename (car spec)))
-         fuzokugo-fid ret)
-      (setq fuzokugo-fid (wnn-open-file proc env-id filename))
-      (if (null fuzokugo-fid)
-         (setq fuzokugo-fid -1)
-       (if (< fuzokugo-fid 0)
-           (let ((msg (wnnrpc-get-error-message (- fuzokugo-fid))))
-             (message "WNN: Can't open fuzokugo file (%s): %s" filename msg)
-             (setq fuzokugo-fid -1))))
-      (setq ret (wnnrpc-set-fuzokugo-file proc env-id fuzokugo-fid))
-      (if (< ret 0)
-         (let ((msg (wnnrpc-get-error-message (- ret))))
-           (message "WNN: Error on setting fuzokugo (%s): %s" filename msg))))
-    (setq spec (cdr spec))
+       (error "Can't connect new WNN environment: %s"
+              (wnnrpc-get-error-message (- env-id))))
+    (setq dic-set (wnn-dic-spec-dic-set spec)
+         reverse (wnn-dic-spec-reverse spec)
+         parameters (wnn-dic-spec-param spec)
+         filename (wnn-filename (wnn-dic-spec-fuzokugo spec))
+         fuzokugo-fid (wnn-open-file proc env-id filename))
+    (if (null fuzokugo-fid)
+       (setq fuzokugo-fid -1)
+      (if (< fuzokugo-fid 0)
+         (progn
+           (message "WNN: Can't open fuzokugo file (%s): %s"
+                    filename
+                    (wnnrpc-get-error-message (- fuzokugo-fid)))
+           (setq fuzokugo-fid -1))))
+    (setq ret (wnnrpc-set-fuzokugo-file proc env-id fuzokugo-fid))
+    (if (< ret 0)
+       (let ((msg (wnnrpc-get-error-message (- ret))))
+         (message "WNN: Error on setting fuzokugo (%s): %s" filename msg)))
+    (setq spec (wnn-dic-spec-dic-list spec))
     (while spec
-      (let ((dic-spec (car spec)))
-       (wnn-set-dictionary proc env-id reverse-flag dic-spec)
-       (setq spec (cdr spec))))
-    (wnnrpc-set-conversion-parameters proc env-id parameters)
-    (setq env (wnnenv-create proc env-id))
-    env))
+      (wnn-set-dictionary proc env-id reverse (car spec))
+      (setq spec (cdr spec)))
+    (if parameters
+       (wnnrpc-set-conversion-parameters proc env-id parameters))
+    (wnnenv-create proc env-id server-type dic-set reverse)))
+
+(defvar wnn-user-name nil)
+
+(defun wnn-make-env-name (spec)
+  (or wnn-user-name
+      (setq wnn-user-name (getenv "WNNUSER"))
+      (setq wnn-user-name (user-login-name)))
+  (concat wnn-user-name (wnn-dic-spec-name spec)))
 
 (defun wnn-update-frequency (env bunsetsu-info-list)
   (let ((l bunsetsu-info-list))
@@ -671,17 +874,18 @@ Take one argument DIC-SPEC for dictionary specification."
     (wnnrpc-add-word env dic-number yomi kanji comment
                     hinshi-id initial-freq)))
 
-
 ;;; setup
 
 (require 'egg)
 (load "egg/wnnrpc")
 
 ;;;###autoload
-(defun egg-activate-wnn (&optional arg)
+(defun egg-activate-wnn (&rest arg)
   "Activate Wnn backend of Tamagotchy."
-  (setq egg-conversion-backend wnn-conversion-backend)
-  (egg-mode arg)
-  )
+  (egg-set-support-languages wnn-support-languages)
+  (egg-set-conversion-backend wnn-conversion-backend
+                             (list (nth 2 arg))
+                             wnn-support-languages)
+  (apply 'egg-mode arg))
 
 ;;; egg/wnn.el ends here.
index 901d088..723453a 100644 (file)
@@ -1,21 +1,23 @@
 ;;; egg/wnnrpc.el --- WNN Support (low level interface) in Egg
 ;;;                   Input Method Architecture
 
-;; Copyright (C) 1997 Mule Project, Powered by Electrotechnical
+;; Copyright (C) 1997, 1998 Mule Project, Powered by Electrotechnical
 ;; Laboratory, JAPAN.
 ;; Project Leader: Satoru Tomura <tomura@etl.go.jp>
 
 ;; Author: NIIBE Yutaka <gniibe@mri.co.jp>
+;;         KATAYAMA Yoshio <kate@pfu.co.jp> ; Korean, Chinese support.
+;;
 ;; Maintainer: NIIBE Yutaka <gniibe@mri.co.jp>
 
 ;; This file will be part of GNU Emacs (in future).
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; EGG 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.
 
-;; GNU Emacs is distributed in the hope that it will be useful,
+;; EGG 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.
@@ -31,7 +33,7 @@
 
 (eval-when-compile
   (require 'egg-com)
-  (load-library "egg/wnn")
+  ;; (load-library "egg/wnn")
   (defmacro wnn-const (c)
     "Macro for WNN constants."
     (cond ((eq c 'JS_VERSION)             0)
          ((eq c 'WNN_MAX_FILE_OF_AN_ENV)  60))))
 
 (defconst wnnrpc-error-message
-  [
-   nil
-   "\e$B%U%!%$%k$,B8:_$7$^$;$s\e(B"
-   nil
-   "\e$B%a%b%j\e(B allocation \e$B$G<:GT$7$^$7$?\e(B"
-   nil
-   "\e$B<-=q$G$O$"$j$^$;$s\e(B"
-   "\e$BIQEY%U%!%$%k$G$O$"$j$^$;$s\e(B"
-   "\e$BIUB08l%U%!%$%k$G$O$"$j$^$;$s\e(B"
-   nil
-   "\e$B<-=q%F!<%V%k$,0lGU$G$9\e(B"
-   "\e$BIQEY%U%!%$%k$,;XDj$5$l$?<-=q$NIQEY%U%!%$%k$G$O$"$j$^$;$s\e(B"
-   nil
-   nil
-   nil
-   nil
-   nil
-   "\e$B%U%!%$%k$,%*!<%W%s$G$-$^$;$s\e(B"
-   "\e$B@5$7$$IQEY%U%!%$%k$G$O$"$j$^$;$s\e(B"
-   "\e$B@5$7$$IUB08l%U%!%$%k$G$O$"$j$^$;$s\e(B"
-   "\e$BIUB08l$N8D?t\e(B, \e$B%Y%/%?D9$5$J$I$,B?2a$.$^$9\e(B"
-   "\e$B$=$NHV9f$N<-=q$O;H$o$l$F$$$^$;$s\e(B"
-   nil
-   nil
-   nil
-   "\e$BIUB08l%U%!%$%k$NFbMF$,@5$7$/$"$j$^$;$s\e(B"
-   "\e$B5?;wIJ;lHV9f$,0[>o$G$9\e(B(hinsi.data \e$B$,@5$7$/$"$j$^$;$s\e(B)"
-   "\e$BL$Dj5A$NIJ;l$,A0C<IJ;l$H$7$FDj5A$5$l$F$$$^$9\e(B"
-   "\e$BIUB08l%U%!%$%k$,FI$_9~$^$l$F$$$^$;$s\e(B"
-   nil
-   nil
-   "\e$B<-=q$N%(%$%s%H%j$,B?2a$.$^$9\e(B"
-   "\e$BJQ49$7$h$&$H$9$kJ8;zNs$,D92a$.$^$9\e(B"
-   "\e$BIUB08l2r@ONN0h$,ITB-$7$F$$$^$9\e(B"
-   nil
-   "\e$B<!8uJdNN0h$,ITB-$7$F$$$^$9\e(B"
-   "\e$B8uJd$,\e(B 1 \e$B$D$b:n$l$^$;$s$G$7$?\e(B"
-   nil
-   nil
-   nil
-   nil
-   "\e$BFI$_$,D92a$.$^$9\e(B"
-   "\e$B4A;z$,D92a$.$^$9\e(B"
-   "\e$B;XDj$5$l$?<-=q$OEPO?2DG=$G$O$"$j$^$;$s\e(B"
-   "\e$BFI$_$ND9$5$,\e(B 0 \e$B$G$9\e(B"
-   "\e$B;XDj$5$l$?<-=q$O5U0z$-2DG=$G$O$"$j$^$;$s\e(B"
-   "\e$B%j!<%I%*%s%j!<$N<-=q$KEPO?\e(B/\e$B:o=|$7$h$&$H$7$^$7$?\e(B"
-   "\e$B4D6-$KB8:_$7$J$$<-=q$KEPO?$7$h$&$H$7$^$7$?\e(B"
-   nil
-   nil
-   "\e$B%j!<%I%*%s%j!<$NIQEY$rJQ99$7$h$&$H$7$^$7$?\e(B"
-   "\e$B;XDj$5$l$?C18l$,B8:_$7$^$;$s\e(B"
-   nil
-   nil
-   nil
-   nil
-   nil
-   nil
-   nil
-   nil
-   nil
-   "\e$B%a%b%j\e(B allocation \e$B$G<:GT$7$^$7$?\e(B"
-   nil
-   nil
-   nil
-   nil
-   nil
-   nil
-   nil
-   "\e$B2?$+$N%(%i!<$,5/$3$j$^$7$?\e(B"
-   "\e$B%P%0$,H/@8$7$F$$$kLOMM$G$9\e(B"
-   "\e$B%5!<%P$,;`$s$G$$$^$9\e(B"
-   "allocation \e$B$K<:GT$7$^$7$?\e(B"
-   "\e$B%5!<%P$H@\B3$G$-$^$;$s$G$7$?\e(B"
-   "\e$BDL?.%W%m%H%3%k$N%P!<%8%g%s$,9g$C$F$$$^$;$s\e(B"
-   "\e$B%/%i%$%"%s%H$N@8@.$7$?4D6-$G$O$"$j$^$;$s\e(B"
-   nil
-   nil
-   nil
-   nil
-   nil
-   "\e$B%G%#%l%/%H%j$r:n$k$3$H$,$G$-$^$;$s\e(B"
-   nil
-   nil
-   nil
-   nil
-   nil
-   nil
-   nil
-   nil
-   nil
-   "\e$B%U%!%$%k$rFI$_9~$`$3$H$,$G$-$^$;$s\e(B"
-   "\e$B%U%!%$%k$r=q$-=P$9$3$H$,$G$-$^$;$s\e(B"
-   "\e$B%/%i%$%"%s%H$NFI$_9~$s$@%U%!%$%k$G$O$"$j$^$;$s\e(B"
-   "\e$B$3$l0J>e%U%!%$%k$rFI$_9~$`$3$H$,$G$-$^$;$s\e(B"
-   "\e$B%Q%9%o!<%I$,4V0c$C$F$$$^$9\e(B"
-   "\e$B%U%!%$%k$,FI$_9~$^$l$F$$$^$9\e(B"
-   "\e$B%U%!%$%k$,:o=|$G$-$^$;$s\e(B"
-   "\e$B%U%!%$%k$,:n@.=PMh$^$;$s\e(B"
-   "WNN \e$B$N%U%!%$%k$G$"$j$^$;$s\e(B"
-   "\e$B%U%!%$%k$N\e(B inode \e$B$H\e(B FILE_UNIQ \e$B$r0lCW$5$;$k;v$,$G$-$^$;$s\e(B"
-   "\e$BIJ;l%U%!%$%k$,Bg$-2a$.$^$9\e(B"
-   "\e$BIJ;l%U%!%$%k$,Bg$-2a$.$^$9\e(B"
-   "\e$BIJ;l%U%!%$%k$,B8:_$7$^$;$s\e(B"
-   "\e$BIJ;l%U%!%$%k$NFbMF$,4V0c$C$F$$$^$9\e(B"
-   nil
-   "\e$BIJ;l%U%!%$%k$,FI$_9~$^$l$F$$$^$;$s\e(B"
-   "\e$BIJ;lL>$,4V0c$C$F$$$^$9\e(B"
-   "\e$BIJ;lHV9f$,4V0c$C$F$$$^$9\e(B"
-   nil
-   "\e$B$=$NA`:n$O%5%]!<%H$5$l$F$$$^$;$s\e(B"
-   "\e$B%Q%9%o!<%I$NF~$C$F$$$k%U%!%$%k$,%*!<%W%s$G$-$^$;$s\e(B"
-   "uumrc \e$B%U%!%$%k$,B8:_$7$^$;$s\e(B"
-   "uumrc \e$B%U%!%$%k$N7A<0$,8m$C$F$$$^$9\e(B"
-   "\e$B$3$l0J>e4D6-$r:n$k$3$H$O$G$-$^$;$s\e(B"
-   "\e$B$3$N%/%i%$%"%s%H$,FI$_9~$s$@%U%!%$%k$G$"$j$^$;$s\e(B"
-   "\e$B<-=q$KIQEY%U%!%$%k$,$D$$$F$$$^$;$s\e(B"
-   "\e$B%Q%9%o!<%I$N%U%!%$%k$,:n@.=PMh$^$;$s\e(B"
-]
+  '(("Japanese" .
+     [
+      nil
+      "\e$B%U%!%$%k$,B8:_$7$^$;$s\e(B"
+      nil
+      "\e$B%a%b%j\e(B allocation \e$B$G<:GT$7$^$7$?\e(B"
+      nil
+      "\e$B<-=q$G$O$"$j$^$;$s\e(B"
+      "\e$BIQEY%U%!%$%k$G$O$"$j$^$;$s\e(B"
+      "\e$BIUB08l%U%!%$%k$G$O$"$j$^$;$s\e(B"
+      nil
+      "\e$B<-=q%F!<%V%k$,0lGU$G$9\e(B"
+      "\e$BIQEY%U%!%$%k$,;XDj$5$l$?<-=q$NIQEY%U%!%$%k$G$O$"$j$^$;$s\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$B%U%!%$%k$,%*!<%W%s$G$-$^$;$s\e(B"
+      "\e$B@5$7$$IQEY%U%!%$%k$G$O$"$j$^$;$s\e(B"
+      "\e$B@5$7$$IUB08l%U%!%$%k$G$O$"$j$^$;$s\e(B"
+      "\e$BIUB08l$N8D?t\e(B, \e$B%Y%/%?D9$5$J$I$,B?2a$.$^$9\e(B"
+      "\e$B$=$NHV9f$N<-=q$O;H$o$l$F$$$^$;$s\e(B"
+      nil
+      nil
+      nil
+      "\e$BIUB08l%U%!%$%k$NFbMF$,@5$7$/$"$j$^$;$s\e(B"
+      "\e$B5?;wIJ;lHV9f$,0[>o$G$9\e(B(hinsi.data \e$B$,@5$7$/$"$j$^$;$s\e(B)"
+      "\e$BL$Dj5A$NIJ;l$,A0C<IJ;l$H$7$FDj5A$5$l$F$$$^$9\e(B"
+      "\e$BIUB08l%U%!%$%k$,FI$_9~$^$l$F$$$^$;$s\e(B"
+      nil
+      nil
+      "\e$B<-=q$N%(%$%s%H%j$,B?2a$.$^$9\e(B"
+      "\e$BJQ49$7$h$&$H$9$kJ8;zNs$,D92a$.$^$9\e(B"
+      "\e$BIUB08l2r@ONN0h$,ITB-$7$F$$$^$9\e(B"
+      nil
+      "\e$B<!8uJdNN0h$,ITB-$7$F$$$^$9\e(B"
+      "\e$B8uJd$,\e(B 1 \e$B$D$b:n$l$^$;$s$G$7$?\e(B"
+      nil
+      nil
+      nil
+      nil
+      "\e$BFI$_$,D92a$.$^$9\e(B"
+      "\e$B4A;z$,D92a$.$^$9\e(B"
+      "\e$B;XDj$5$l$?<-=q$OEPO?2DG=$G$O$"$j$^$;$s\e(B"
+      "\e$BFI$_$ND9$5$,\e(B 0 \e$B$G$9\e(B"
+      "\e$B;XDj$5$l$?<-=q$O5U0z$-2DG=$G$O$"$j$^$;$s\e(B"
+      "\e$B%j!<%I%*%s%j!<$N<-=q$KEPO?\e(B/\e$B:o=|$7$h$&$H$7$^$7$?\e(B"
+      "\e$B4D6-$KB8:_$7$J$$<-=q$KEPO?$7$h$&$H$7$^$7$?\e(B"
+      nil
+      nil
+      "\e$B%j!<%I%*%s%j!<$NIQEY$rJQ99$7$h$&$H$7$^$7$?\e(B"
+      "\e$B;XDj$5$l$?C18l$,B8:_$7$^$;$s\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$B%a%b%j\e(B allocation \e$B$G<:GT$7$^$7$?\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$B2?$+$N%(%i!<$,5/$3$j$^$7$?\e(B"
+      "\e$B%P%0$,H/@8$7$F$$$kLOMM$G$9\e(B"
+      "\e$B%5!<%P$,;`$s$G$$$^$9\e(B"
+      "allocation \e$B$K<:GT$7$^$7$?\e(B"
+      "\e$B%5!<%P$H@\B3$G$-$^$;$s$G$7$?\e(B"
+      "\e$BDL?.%W%m%H%3%k$N%P!<%8%g%s$,9g$C$F$$$^$;$s\e(B"
+      "\e$B%/%i%$%"%s%H$N@8@.$7$?4D6-$G$O$"$j$^$;$s\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$B%G%#%l%/%H%j$r:n$k$3$H$,$G$-$^$;$s\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$B%U%!%$%k$rFI$_9~$`$3$H$,$G$-$^$;$s\e(B"
+      "\e$B%U%!%$%k$r=q$-=P$9$3$H$,$G$-$^$;$s\e(B"
+      "\e$B%/%i%$%"%s%H$NFI$_9~$s$@%U%!%$%k$G$O$"$j$^$;$s\e(B"
+      "\e$B$3$l0J>e%U%!%$%k$rFI$_9~$`$3$H$,$G$-$^$;$s\e(B"
+      "\e$B%Q%9%o!<%I$,4V0c$C$F$$$^$9\e(B"
+      "\e$B%U%!%$%k$,FI$_9~$^$l$F$$$^$9\e(B"
+      "\e$B%U%!%$%k$,:o=|$G$-$^$;$s\e(B"
+      "\e$B%U%!%$%k$,:n@.=PMh$^$;$s\e(B"
+      "WNN \e$B$N%U%!%$%k$G$"$j$^$;$s\e(B"
+      "\e$B%U%!%$%k$N\e(B inode \e$B$H\e(B FILE_UNIQ \e$B$r0lCW$5$;$k;v$,$G$-$^$;$s\e(B"
+      "\e$BIJ;l%U%!%$%k$,Bg$-2a$.$^$9\e(B"
+      "\e$BIJ;l%U%!%$%k$,Bg$-2a$.$^$9\e(B"
+      "\e$BIJ;l%U%!%$%k$,B8:_$7$^$;$s\e(B"
+      "\e$BIJ;l%U%!%$%k$NFbMF$,4V0c$C$F$$$^$9\e(B"
+      nil
+      "\e$BIJ;l%U%!%$%k$,FI$_9~$^$l$F$$$^$;$s\e(B"
+      "\e$BIJ;lL>$,4V0c$C$F$$$^$9\e(B"
+      "\e$BIJ;lHV9f$,4V0c$C$F$$$^$9\e(B"
+      nil
+      "\e$B$=$NA`:n$O%5%]!<%H$5$l$F$$$^$;$s\e(B"
+      "\e$B%Q%9%o!<%I$NF~$C$F$$$k%U%!%$%k$,%*!<%W%s$G$-$^$;$s\e(B"
+      "uumrc \e$B%U%!%$%k$,B8:_$7$^$;$s\e(B"
+      "uumrc \e$B%U%!%$%k$N7A<0$,8m$C$F$$$^$9\e(B"
+      "\e$B$3$l0J>e4D6-$r:n$k$3$H$O$G$-$^$;$s\e(B"
+      "\e$B$3$N%/%i%$%"%s%H$,FI$_9~$s$@%U%!%$%k$G$"$j$^$;$s\e(B"
+      "\e$B<-=q$KIQEY%U%!%$%k$,$D$$$F$$$^$;$s\e(B"
+      "\e$B%Q%9%o!<%I$N%U%!%$%k$,:n@.=PMh$^$;$s\e(B"
+      ])
+    ("Chinese-GB" .
+     [
+      nil
+      "\e$AND<~2;4fTZ\e(B"
+      nil
+      "\e$ADZ4f\e(Balloc\e$AJ'0\\e(B"
+      nil
+      "\e$A2;JGWV5d\e(B"
+      "\e$A2;JGF56HND<~\e(B"
+      "\e$A2;JGND7(ND<~\e(B"
+      nil
+      "\e$AWV5d1m8qBz\e(B"
+      "\e$AF56HND<~#:2;JGV86(5DWV5d5DF56HND<~\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$AND<~2;D\4r?*\e(B"
+      "\e$A2;JGU}H75DF56HND<~\e(B"
+      "\e$A2;JGU}H75DND7(ND<~\e(B"
+      "\e$A8=JtSo5D8vJ}!"OrA?3$6H5H3,9}\e(B"
+      "\e$AUb8v:EBk5DWV5d!"C;SPJ9SC\e(B"
+      nil
+      nil
+      nil
+      "\e$AND7(ND<~5DDZH]2;U}H7\e(B"
+      "\e$APiDb4JPT:EBkRl3#\e(Bcixing.data\e$A2;U}H7\e(B"
+      "\e$AN46(Re5D4JPT!"6(ReAKG06K4JPT\e(B"
+      "\e$AND7(ND<~2;D\6AH!\e(B"
+      nil
+      nil
+      "\e$AWV5d5DOnJ}3,9}\e(B"
+      "\e$A1d;;:sWV7{4.5D3$6H3,9}\e(B"
+      "\e$A8=JtSo=bNvSr2;9;\e(B"
+      nil
+      "\e$A4N:n29Sr2;9;\e(B"
+      "\e$A:n29\e(B 1\e$A8vR2C;SP\e(B"
+      nil
+      nil
+      nil
+      nil
+      "\e$A6ARt3$6H3,9}\e(B"
+      "\e$A::WV3$6H3,9}\e(B"
+      "\e$AV86(5DWV5d!"2;D\5GB<\e(B"
+      "\e$A6ARt5D3$6HJG\e(B0"
+      "\e$AV86(5DWV5d!"2;D\Df2i\e(B"
+      "\e$AV;6A5DWV5d!"5GB<\e(B/\e$AO{3}AK\e(B"
+      "\e$A;7>3VP2;4fTZ5DWV5d!"5GB<AK\e(B"
+      nil
+      nil
+      "\e$AV;6A5DF56H!"1d8|AK\e(B"
+      "\e$AV86(5D5%WV2;4fTZ\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$ADZ4f\e(Balloc\e$AJ'0\\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$ASP3v4m7"Iz\e(B"
+      "\e$A:COsSP#b#u#g7"Iz\e(B"
+      "server\e$AK@AK\e(B"
+      "alloc\e$AJ'0\AK\e(B"
+      "\e$A2;D\:M\e(Bserver\e$AA,=S\e(B"
+      "\e$AM(PE9f3L5D0f1>2;7{\e(B"
+      "\e$A2;JG#c#W#n#nSC;'Iz3I5D;7>3\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$AWSD?B<2;D\44=(\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$AND<~2;D\6AH!\e(B"
+      "\e$AND<~2;D\P43v\e(B"
+      "\e$A2;JG#c#W#n#nSC;'?I6AH!5DND<~\e(B"
+      "\e$ARTIO5DND<~2;D\6AH!\e(B"
+      "password\e$A2;6T\e(B"
+      "\e$AND<~U}TZ6AH!\e(B"
+      "\e$AND<~2;D\O{3}\e(B"
+      "\e$AND<~C;SP44=(3v@4\e(B"
+      "\e$A2;JG#c#W#n#n5DND<~\e(B"
+      "\e$AND<~5D\e(BI-node\e$A:M\e(BFILE_UNIQ\e$A2;D\R;VB\e(B"
+      "\e$A4JPTND<~L+4s\e(B"
+      "\e$A4JPTND<~L+4s\e(B"
+      "\e$A4JPTND<~2;4fTZ\e(B"
+      "\e$A4JPTND<~5DDZH]2;6T\e(B"
+      nil
+      "\e$A4JPTND<~2;D\6AH!\e(B"
+      "\e$A4JPTC{2;6T\e(B"
+      "\e$A4JPT:EBk2;6T\e(B"
+      nil
+      "\e$AUb8v2YWw2;V'3V\e(B"
+      "password\e$A5DJdHkND<~2;D\4r?*\e(B"
+      "uumrc\e$AND<~2;4fTZ\e(B"
+      "uumrc\e$AND<~5DPNJ=4mNs\e(B"
+      "\e$ARTIO;7>32;D\44=(\e(B"
+      "\e$AUb8v#c#W#n#nSC;'!"6AH!5DND<~C;SP\e(B"
+      "\e$AWV5d5DF56HND<~C;SP\e(B"
+      "password\e$A5DND<~C;SP44=(3v@4\e(B"
+      ])
+    ("Chinese-CNS" .
+     [
+      nil
+      "\e$(GEFG5DbGtGc\e(B"
+      nil
+      "\e$(GDyGt\e(Balloc\e$(GFBZu\e(B"
+      nil
+      "\e$(GDbQRGsL(\e(B"
+      "\e$(GDbQRs"PyEFG5\e(B"
+      "\e$(GDbQREFNNEFG5\e(B"
+      nil
+      "\e$(GGsL(OPV*iH\e(B"
+      "\e$(Gs"PyEFG5!3DbQRQ@LyN{GsL(N{s"PyEFG5\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$(GEFG5DbWdFTbd\e(B"
+      "\e$(GDbQRF_m}N{s"PyEFG5\e(B"
+      "\e$(GDbQRF_m}N{EFNNEFG5\e(B"
+      "\e$(GOazhk#N{T6m0!#GWbXO[Pya+b>g4\e(B"
+      "\e$(G]UT6f@n#N{GsL(!#JtH4KpFn\e(B"
+      nil
+      nil
+      nil
+      "\e$(GEFNNEFG5N{DyU)DbF_m}\e(B"
+      "\e$(Gapsib$MLf@n#\,Z&\e(Bcixing.data\e$(GDbF_m}\e(B"
+      "\e$(GF\LyexN{b$ML!#LyexD'P)j&b$ML\e(B"
+      "\e$(GEFNNEFG5DbWd{tL=\e(B"
+      nil
+      nil
+      "\e$(GGsL(N{bzm0b>g4\e(B"
+      "\e$(G|H_PG[Gs\JHkN{O[Pyb>g4\e(B"
+      "\e$(GOazhk#fXN5YQDbY\\e(B"
+      nil
+      "\e$(GH9OlfPYQDbY\\e(B"
+      "\e$(GOlfP\e(B 1\e$(GT6D>JtH4\e(B"
+      nil
+      nil
+      nil
+      nil
+      "\e$(G{tSvO[Pyb>g4\e(B"
+      "\e$(GiGGsO[Pyb>g4\e(B"
+      "\e$(GQ@LyN{GsL(!#DbWd`trg\e(B"
+      "\e$(G{tSvN{O[PyQR\e(B0"
+      "\e$(GQ@LyN{GsL(!#DbWdXKQg\e(B"
+      "\e$(GF7{tN{GsL(!#`trg\e(B/\e$(GV<XfD'\e(B"
+      "\e$(Gt?h:DcDbGtGcN{GsL(!#`trgD'\e(B"
+      nil
+      nil
+      "\e$(GF7{tN{s"Py!#|HJUD'\e(B"
+      "\e$(GQ@LyN{^LGsDbGtGc\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$(GDyGt\e(Balloc\e$(GFBZu\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$(GH4Exrc`uFm\e(B"
+      "\e$(GGob/H4$\$o$a`uFm\e(B"
+      "server\e$(GH;D'\e(B"
+      "alloc\e$(GFBZuD'\e(B"
+      "\e$(GDbWdLO\e(Bserver\e$(G]YZY\e(B"
+      "\e$(G]WOj]=a#N{NjF[Db\J\e(B"
+      "\e$(GDbQR$]$q$h$hFnEBFmH)N{t?h:\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$(GDMFxrgDbWd^6Pz\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$(GEFG5DbWd{tL=\e(B"
+      "\e$(GEFG5DbWdlQEx\e(B"
+      "\e$(GDbQR$]$q$h$hFnEBF+{tL=N{EFG5\e(B"
+      "\e$(GEhD8N{EFG5DbWd{tL=\e(B"
+      "password\e$(GDbhW\e(B"
+      "\e$(GEFG5F_Gc{tL=\e(B"
+      "\e$(GEFG5DbWdV<Xf\e(B"
+      "\e$(GEFG5JtH4^6PzExKt\e(B"
+      "\e$(GDbQR$C$W$h$hN{EFG5\e(B"
+      "\e$(GEFG5N{\e(BI-node\e$(GLO\e(BFILE_UNIQ\e$(GDbWdD!S3\e(B"
+      "\e$(Gb$MLEFG5E4DK\e(B"
+      "\e$(Gb$MLEFG5E4DK\e(B"
+      "\e$(Gb$MLEFG5DbGtGc\e(B"
+      "\e$(Gb$MLEFG5N{DyU)DbhW\e(B"
+      nil
+      "\e$(Gb$MLEFG5DbWd{tL=\e(B"
+      "\e$(Gb$MLGXDbhW\e(B"
+      "\e$(Gb$MLf@n#DbhW\e(B"
+      nil
+      "\e$(G]UT6pgI"DbEEQ=\e(B"
+      "password\e$(GN{rSD+EFG5DbWdFTbd\e(B"
+      "cwnnrc\e$(GEFG5DbGtGc\e(B"
+      "cwnnrc\e$(GEFG5N{J0H"rck(\e(B"
+      "\e$(GEhD8t?h:DbWd^6Pz\e(B"
+      "\e$(G]UT6$C$W$h$hFnEB!#{tL=N{EFG5JtH4\e(B"
+      "\e$(GGsL(N{s"PyEFG5JtH4\e(B"
+      "password\e$(GN{EFG5JtH4^6PzExKt\e(B"
+      ])
+    ("Korean" .
+     [
+      nil
+      "\e$(CH-@O@L\e(B \e$(CA8@gGOAv\e(B \e$(C>J=@4O4Y\e(B"
+      nil
+      "\e$(C8^8p8.\e(B alloc \e$(C?!<-\e(B \e$(C=GFPG_@>4O4Y\e(B"
+      nil
+      "\e$(C;g@|@L\e(B \e$(C>F4U4O4Y\e(B"
+      "\e$(C:s55\e(B \e$(CH-@O@L\e(B \e$(C>F4U4O4Y\e(B"
+      "\e$(C:N<S>n\e(B \e$(CH-@O@L\e(B \e$(C>F4U4O4Y\e(B"
+      nil
+      "\e$(C;g@|\e(B \e$(CEW@L:m@L\e(B \e$(C2K\e(B \e$(CC!@>4O4Y\e(B"
+      "\e$(CAvA$5H\e(B \e$(C;g@|@G\e(B \e$(C:s55\e(B \e$(CH-@O@L\e(B \e$(C>F4U4O4Y\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$(CH-@O@;\e(B \e$(C?-\e(B \e$(C<v\e(B \e$(C>x@>4O4Y\e(B"
+      "\e$(C8B4B\e(B \e$(C:s55\e(B \e$(CH-@O@L\e(B \e$(C>F4U4O4Y\e(B"
+      "\e$(C8B4B\e(B \e$(C:N<S>n\e(B \e$(CH-@O@L\e(B \e$(C>F4U4O4Y\e(B"
+      "\e$(C:N<S>n@G\e(B \e$(C09<v0!\e(B \e$(C3J9+\e(B \e$(C890E3*\e(B \e$(C:$EM@G\e(B \e$(C1f@L0!\e(B \e$(C3J9+\e(B \e$(C1i4O4Y\e(B"
+      "\e$(C1W\e(B \e$(C9xH#@G\e(B \e$(C;g@|@:\e(B \e$(C;g?k5G0m\e(B \e$(C@VAv\e(B \e$(C>J=@4O4Y\e(B"
+      nil
+      nil
+      nil
+      "\e$(C:N<S>n\e(B \e$(CH-@O@G\e(B \e$(C3;?k@L\e(B \e$(C8BAv\e(B \e$(C>J=@4O4Y\e(B"
+      "\e$(C0!;s\e(B \e$(CG0;g@G\e(B \e$(C9xH#0!\e(B \e$(CF2834O4Y\e(B. hinsi.data \e$(C0!\e(B \e$(C8BAv\e(B \e$(C>J=@4O4Y\e(B"
+      "\e$(C9LA$@G@G\e(B \e$(CG0;g0!\e(B \e$(C@|4\\e(B \e$(CG0;g7N\e(B \e$(CA$@G5G>n\e(B \e$(C@V=@4O4Y\e(B"
+      "\e$(C:N<S>n\e(B \e$(CH-@O@L\e(B \e$(C@PGtA.\e(B \e$(C@VAv\e(B \e$(C>J=@4O4Y\e(B"
+      nil
+      nil
+      "\e$(C;g@|@G\e(B \e$(C?#F.8.0!\e(B \e$(C3J9+\e(B \e$(C89=@4O4Y\e(B"
+      "\e$(C:/H/GO7A4B\e(B \e$(C9.@Z?-@L\e(B \e$(C3J9+\e(B \e$(C1i4O4Y\e(B"
+      "\e$(C:N<S>n\e(B \e$(CGX<.\e(B \e$(C?5?*@L\e(B \e$(C:NA7GU4O4Y\e(B"
+      nil
+      "\e$(C4Y@=\e(B \e$(CHD:8\e(B \e$(C?5?*@L\e(B \e$(C:NA7GU4O4Y\e(B"
+      "\e$(CHD:80!\e(B \e$(C>x@>4O4Y\e(B"
+      nil
+      nil
+      nil
+      nil
+      "\e$(CGQ1[@L\e(B \e$(C3J9+\e(B \e$(C1i4O4Y\e(B"
+      "\e$(CGQ@Z0!\e(B \e$(C3J9+\e(B \e$(C1i4O4Y\e(B"
+      "\e$(CAvA$5H\e(B \e$(C;g@|@:\e(B \e$(C5n7O\e(B \e$(C:R0!4I@T4O4Y\e(B"
+      "\e$(CGQ1[@G\e(B \e$(C1f@L0!\e(B 0 \e$(C@T4O4Y\e(B"
+      "\e$(CAvA$5H\e(B \e$(C;g@|@:\e(B \e$(C?*B|A6\e(B \e$(C:R0!4I@T4O4Y\e(B"
+      "\e$(C@P1b@|?k\e(B \e$(C;g@|?!\e(B \e$(C5n7O\e(B/\e$(C<R0E\e(B \e$(CGO7A0m\e(B \e$(CG_@>4O4Y\e(B"
+      "\e$(CA8@gGOAv\e(B \e$(C>J4B\e(B \e$(C;g@|?!\e(B \e$(C5n7O\e(B \e$(CGO7A0m\e(B \e$(CG_@>4O4Y\e(B"
+      nil
+      nil
+      "\e$(C@P1b@|?k\e(B \e$(C:s558&\e(B \e$(C0f=E\e(B \e$(CGO7A0m\e(B \e$(CG_@>4O4Y\e(B"
+      "\e$(CAvA$5H\e(B \e$(C4\>n4B\e(B \e$(CA8@gGOAv\e(B \e$(C>J=@4O4Y\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$(C8^8p8.\e(B alloc \e$(C?!\e(B \e$(C=GFPG_@>4O4Y\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$(C?!7/0!\e(B \e$(C9_;}G_@>4O4Y\e(B"
+      "\e$(C9v1W\e(B(Bug)\e$(C0!\e(B \e$(C9_;}G_@>4O4Y\e(B"
+      "\e$(C<-9v\e(B(Server)\e$(C0!\e(B \e$(CAW>n\e(B \e$(C@V@>4O4Y\e(B"
+      "alloc\e$(C?!\e(B \e$(C=GFPG_@>4O4Y\e(B"
+      "\e$(C<-9v\e(B(Server) \e$(C?M\e(B \e$(CA"CKGR\e(B \e$(C<v\e(B \e$(C>x@>4O4Y\e(B"
+      "\e$(CEk=E\e(B \e$(CGA7NEdD]@G\e(B \e$(C9vA/@L\e(B \e$(C8BAv\e(B \e$(C>J=@4O4Y\e(B"
+      "\e$(CE,6s@L>HF.0!\e(B \e$(C;}<:GQ\e(B \e$(CH/0f@L\e(B \e$(C>F4U4O4Y\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$(C5p7:Ed8.8&\e(B \e$(C885i\e(B \e$(C<v\e(B \e$(C>x@>4O4Y\e(B"
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      nil
+      "\e$(CH-@O\e(B \e$(C@P1b?!\e(B \e$(C=GFPG_@>4O4Y\e(B"
+      "\e$(CH-@O\e(B \e$(C>21b?!\e(B \e$(C=GFPG_@>4O4Y\e(B"
+      "\e$(CE,6s@L>HF.0!\e(B \e$(C@P>n\e(B \e$(C5e80\e(B \e$(CH-@O@L\e(B \e$(C>F4U4O4Y\e(B"
+      "\e$(C4u\e(B \e$(C@L;s@G\e(B \e$(CH-@O@;\e(B \e$(C@P>n\e(B \e$(C5e81\e(B \e$(C<v\e(B \e$(C>x@>4O4Y\e(B"
+      "\e$(CFP=:?v5e0!\e(B \e$(CF2834O4Y\e(B"
+      "\e$(CH-@O@L\e(B \e$(C@PGtA.\e(B \e$(C@V@>4O4Y\e(B"
+      "\e$(CH-@O@;\e(B \e$(C<R0EGR\e(B \e$(C<v\e(B \e$(C>x@>4O4Y\e(B"
+      "\e$(CH-@O@;\e(B \e$(C@[<:GR\e(B \e$(C<v\e(B \e$(C>x@>4O4Y\e(B"
+      "kWnn\e$(C@G\e(B \e$(CH-@O@L\e(B \e$(C>F4U4O4Y\e(B"
+      "\e$(CH-@O@G\e(B I-node \e$(C?M\e(B FILE_UNIQ \e$(C8&\e(B \e$(C@OD!=CE3\e(B \e$(C<v\e(B \e$(C>x@>4O4Y\e(B"
+      "\e$(CG0;g\e(B \e$(CH-@O@G\e(B \e$(CE)1b0!\e(B \e$(C3J9+\e(B \e$(CE.4O4Y\e(B"
+      "\e$(CG0;g\e(B \e$(CH-@O@G\e(B \e$(CE)1b0!\e(B \e$(C3J9+\e(B \e$(CE.4O4Y\e(B"
+      "\e$(CG0;g\e(B \e$(CH-@O@L\e(B \e$(CA8@gGOAv\e(B \e$(C>J=@4O4Y\e(B"
+      "\e$(CG0;g\e(B \e$(CH-@O@G\e(B \e$(C3;?k@L\e(B \e$(CF2834O4Y\e(B"
+      nil
+      "\e$(CG0;g\e(B \e$(CH-@O@L\e(B \e$(C@PGtA.\e(B \e$(C@VAv\e(B \e$(C>J=@4O4Y\e(B"
+      "\e$(CG0;g\e(B \e$(C@L8'@L\e(B \e$(CF2834O4Y\e(B"
+      "\e$(CG0;g\e(B \e$(C9xH#0!\e(B \e$(CF2834O4Y\e(B"
+      nil
+      "\e$(C1W\e(B \e$(CA6@[@:\e(B \e$(CAv?x5GAv\e(B \e$(C>J=@4O4Y\e(B"
+      "\e$(CFP=:?v5e0!\e(B \e$(C5i>n@V4B\e(B \e$(CH-@O@;\e(B \e$(C?-\e(B \e$(C<v\e(B \e$(C>x@>4O4Y\e(B"
+      "uumrc \e$(C@L\e(B \e$(CA8@gGOAv\e(B \e$(C>J=@4O4Y\e(B"
+      "uumrc \e$(C@G\e(B \e$(CG|=D@L\e(B \e$(CF2834O4Y\e(B"
+      "\e$(C@L\e(B \e$(C@L;s\e(B \e$(CH/0f@;\e(B \e$(C@[<:GR\e(B \e$(C<v\e(B \e$(C>x@>4O4Y\e(B"
+      "\e$(CE)6s@L>HF.0!\e(B \e$(C@P>n\e(B \e$(C5e80\e(B \e$(CH-@O@L\e(B \e$(C>F4U4O4Y\e(B"
+      "\e$(C;g@|?!\e(B \e$(C:s55\e(B \e$(CH-@O@L\e(B \e$(CA8@gGOAv\e(B \e$(C>J=@4O4Y\e(B"
+      "\e$(CFP=:?v5e\e(B \e$(CH-@O@;\e(B \e$(C@[<:GR\e(B \e$(C<v\e(B \e$(C>x@>4O4Y\e(B"
+      ]))
   "Array of WNN error messages.  Indexed by error code.")
 
 (defun wnnrpc-get-error-message (errno)
   "Return error message string specified by ERRNO."
-  (or (aref wnnrpc-error-message errno) (format "#%d" errno)))
+  (let ((msg (or (assoc egg-default-language wnnrpc-error-message)
+                (assoc its-current-language wnnrpc-error-message)
+                (assoc "Japanese" wnnrpc-error-message))))
+    (or (aref (cdr msg) errno) (format "#%d" errno))))
 
 (defmacro wnnrpc-call-with-environment (e vlist send-expr &rest receive-exprs)
   (let ((v (append
            `((proc (wnnenv-get-proc ,e))
-             (env-id (wnnenv-get-env-id ,e)))
+             (env-id (wnnenv-get-env-id ,e))
+             (egg-zhuyin its-zhuyin))
            vlist)))
     (list
      'let v
index 089fa66..8eae19b 100644 (file)
@@ -5,8 +5,37 @@
 
 (register-input-method
  "japanese-egg-wnn" "Japanese" 'egg-activate-wnn
- "A\e$B$"\e(B"  "Romaji -> Hiragana -> Kanji&Kana")
+ 'egg-mode-line-title  "Romaji -> Hiragana -> Kanji&Kana"
+ 'its-select-hiragana "Japanese")
 
 (register-input-method
  "japanese-egg-sj3" "Japanese" 'egg-activate-sj3
- "A\e$B$"\e(B"  "Romaji -> Hiragana -> Kanji&Kana")
+ 'egg-mode-line-title  "Romaji -> Hiragana -> Kanji&Kana"
+ 'its-select-hiragana "Japanese")
+
+(register-input-method
+ "chinese-gb-egg-wnn-py" "Chinese-GB" 'egg-activate-wnn
+ 'egg-mode-line-title  "Pinyin -> Simplified Hanzi"
+ 'its-select-pinyin-cn "Chinese-GB")
+
+(register-input-method
+ "chinese-gb-egg-wnn-zy" "Chinese-GB" 'egg-activate-wnn
+ 'egg-mode-line-title  "Zhunyin -> Simplified Hanzi"
+ 'its-select-zhuyin-cn "Chinese-GB")
+
+(register-input-method
+ "chinese-cns-egg-wnn-py" "Chinese-CNS" 'egg-activate-wnn
+ 'egg-mode-line-title  "Pinyin -> Traditional Hanzi"
+ 'its-select-pinyin-tw "Chinese-CNS")
+
+(register-input-method
+ "chinese-cns-egg-wnn-zy" "Chinese-CNS" 'egg-activate-wnn
+ 'egg-mode-line-title  "Zhunyin -> Traditional Hanzi"
+ 'its-select-zhuyin-tw "Chinese-CNS")
+
+(register-input-method
+ "korean-egg-wnn" "Korean" 'egg-activate-wnn
+ 'egg-mode-line-title  "Hangul -> Hanja"
+ 'its-select-hangul "Korean")
+
+(autoload 'egg-mode "egg" "Toggle EGG  mode." t)
index 639401a..a8a57de 100644 (file)
 (defvar menudiag-mode-map
   (let ((map (make-keymap))
        (ch 0))
-    (while (< ch 127)
+    (while (< ch 27)
+      (define-key map (char-to-string ch) 'undefined)
+      (setq ch (1+ ch)))
+    (setq ch 28)
+    (while (< ch 255)
       (define-key map (char-to-string ch) 'undefined)
       (setq ch (1+ ch)))
     (setq ch ?0)
@@ -68,6 +72,8 @@
       (setq ch (1+ ch)))
     (define-key map "\C-a" 'menudiag-beginning-of-line)
     (define-key map "\C-e" 'menudiag-end-of-line)
+    (define-key map "\M-<" 'menudiag-beginning-of-items)
+    (define-key map "\M->" 'menudiag-end-of-items)
     (define-key map "\C-f" 'menudiag-forward-item)
     (define-key map "\C-b" 'menudiag-backward-item)
     (define-key map "\C-n" 'menudiag-next-line)
     (mapconcat
      (function (lambda (item)
                 (setq i (1+ i))
-                (format "  %x.%s" i (menudiag-item-string item))))
+                (format "  %c.%s" (menudiag-item-num-to-char i) 
+                           (menudiag-item-string item))))
      item-list "")))
 
+
+;; ITEM No --> Character
+(defun menudiag-item-num-to-char (num)
+  (let ((char))
+    (cond ((<= num 9)
+           (setq char (+ ?0 num)))
+          (t
+           (setq char (+ ?a (- num 10))))
+          )
+    char))
+
+;; Character --> ITEM No
+(defun menudiag-char-to-item-num (char)
+  (let ((num))
+    (cond ((and (<= ?0 ch) (<= ch ?9))
+           (setq num (- ch ?0)))
+          ((and (<= ?a ch) (<= ch ?z))
+           (setq num (+ 10 (- ch ?a))))
+          ((and (<= ?A ch) (<= ch ?Z))
+           (setq num (+ 10 (- ch ?A))))
+          (t (setq num 1000)))
+    num))
+
+
 (defun menudiag-goto-item ()
   (interactive)
   (let ((ch last-command-char)
        (n 0))
-    (cond ((and (<= ?0 ch) (<= ch ?9))
-          (setq n (- ch ?0)))
-         ((and (<= ?a ch) (<= ch ?z))
-          (setq n (+ 10 (- ch ?a))))
-         ((and (<= ?A ch) (<= ch ?Z))
-          (setq n (+ 10 (- ch ?A)))))
+    (setq n (menudiag-char-to-item-num ch))
     (if (>= n (length line))
        (error "No such item")
       (menudiag-goto-item-internal n))))
       (setq i (1+ i)))
     (goto-char p)))
 
+(defun menudiag-beginning-of-items ()
+  (interactive)
+  (menudiag-goto-line 0)
+  (menudiag-beginning-of-line))
+
+(defun menudiag-end-of-items ()
+  (interactive)
+  (menudiag-goto-line (1- (length selection-list)))
+  (menudiag-end-of-line))
+
 (defun menudiag-beginning-of-line ()
   (interactive)
   (menudiag-goto-item-internal 0))