Sync up with egg-980627.
[elisp/egg.git] / egg-mlh.el
index 1a0afe6..1c9aefe 100644 (file)
@@ -6,10 +6,11 @@
 ;; Project Leader: Satoru Tomura <tomura@etl.go.jp>
 
 ;; Author: NIIBE Yutaka <gniibe@mri.co.jp>
+;;         KATAYAMA Yoshio <kate@pfu.co.jp>      ; Multilingual Enhancement
 ;; Maintainer: NIIBE Yutaka <gniibe@mri.co.jp>
 ;; Keywords: mule, multilingual, input method
 
-;; This file will be part of GNU Emacs (in future).
+;; This file is part of EGG.
 
 ;; EGG is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
 
 ;;; Code:
 
+(defvar mlh-default-backend "wnn")
+
 (defun mlh-space-bar-backward-henkan ()
   "If the character preceding point is / (slash),
 Do `mlh-backward-henkan'.  Then, invoke appropriate conversion, if needed.
 Or else, execute command that space-bar invokes usually."
   (interactive)
   (let ((henkan-begin nil)
-        (inhibit-henkan t))
-    (its-select-hiragana)    ;; force to Japanese
+        (inhibit-henkan t)
+        (its-disable-special-action t))
+    (if (null (assq 'Japanese egg-conversion-backend-alist))
+       (progn
+          (setq egg-mode-preference nil)
+          (activate-input-method (concat "japanese-egg-" mlh-default-backend)))
+      ;; force to Japanese
+      (its-select-hiragana))
     (mlh-backward-henkan)
     (if henkan-begin
         (if (or inhibit-henkan (= henkan-begin (point)))
@@ -515,8 +524,8 @@ CHAR.  MNEMONIC             CONVERSION SCHEME
   (setq inhibit-henkan nil)
   (goto-char end-marker)
   (forward-char -2)
-  (let (its-current-map its-current-language egg-mode-line-title)
-    (its-select-hangul)
+  (let (its-current-map its-current-language)
+    (its-select-hangul t)
     (its-translate-region-internal beg (point)))
   (delete-region (point) end-marker)
   (if (null henkan-begin)
@@ -530,8 +539,8 @@ CHAR.  MNEMONIC             CONVERSION SCHEME
   (setq inhibit-henkan nil)
   (goto-char end-marker)
   (forward-char -2)
-  (let (its-current-map its-current-language egg-mode-line-title)
-    (its-select-pinyin-cn)
+  (let (its-current-map its-current-language)
+    (its-select-pinyin-cn t)
     (its-translate-region-internal beg (point)))
   (delete-region (point) end-marker)
   (if (null henkan-begin)
@@ -545,8 +554,8 @@ CHAR.  MNEMONIC             CONVERSION SCHEME
   (setq inhibit-henkan nil)
   (goto-char end-marker)
   (forward-char -2)
-  (let (its-current-map its-current-language egg-mode-line-title)
-    (its-select-pinyin-tw)
+  (let (its-current-map its-current-language)
+    (its-select-pinyin-tw t)
     (its-translate-region-internal beg (point)))
   (delete-region (point) end-marker)
   (if (null henkan-begin)