;; 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.
(let ((henkan-begin nil)
(inhibit-henkan t)
(its-disable-special-action t))
- (its-select-hiragana) ;; force to Japanese
+ (if (null egg-conversion-backend)
+ (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)))
(egg-do-auto-fill)
- (progn
- (message "Converting...")
- (sit-for 0)
- (egg-convert-region henkan-begin (point))
- (message "") ))
+ (egg-convert-region henkan-begin (point)))
(setq this-command 'self-insert-command)
(call-interactively 'self-insert-command))))
(goto-char end-marker)
(forward-char -2)
(its-translate-region-internal beg (point))
- (insert (mlh-hira-to-kata
- (prog1
- (buffer-substring beg (point))
- (delete-region beg (point)))))
+ (japanese-katakana-region beg (point))
(delete-region (point) end-marker)
(if (null henkan-begin)
(setq henkan-begin beg)))
(if (null henkan-begin)
(setq henkan-begin beg)))
-(defun mlh-hira-to-kata (str)
- "Convert hiragana to katakana in STR."
- (let ((result (copy-sequence str))
- (i 0))
- (while (setq i (string-match "[\e$B$!\e(B-\e$B$s\e(B]" str i))
- (aset result (1+ i) ?\245)
- (setq i (+ i 3)))
- result))
-
(defun mlh-hangul ()
(forward-char -1)
(skip-chars-backward "a-zEO-RTW,.[]")