From: kate Date: Mon, 23 Feb 1998 04:45:57 +0000 (+0000) Subject: mlh multilingualization X-Git-Tag: egg-980304~2^2~9 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e243a5db750b83a4914a91ebbee72acd6edb0487;p=elisp%2Fegg.git mlh multilingualization --- diff --git a/ChangeLog b/ChangeLog index 9989248..269c0fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +1998-02-21 KATAYAMA Yoshio + + * its.el (its-ins/del-SYL-batch): Set its-lang property. + (its-translate-region): Remove its-lang property from translated + text. + (its-translate-region-internal): New function. Retain its-lang + property on translated text. + + * egg-mlh.el (mlh-space-bar-backward-henkan): Force base language + to Japanese. + + (mlh-hangul mlh-zhongwen-tw mlh-zhongwen): New functions for + conversion functions. + 1998-02-20 KATAYAMA Yoshio * its.el (its-restart): New function. diff --git a/egg-mlh.el b/egg-mlh.el index 588e9db..1a0afe6 100644 --- a/egg-mlh.el +++ b/egg-mlh.el @@ -39,6 +39,7 @@ Or else, execute command that space-bar invokes usually." (interactive) (let ((henkan-begin nil) (inhibit-henkan t)) + (its-select-hiragana) ;; force to Japanese (mlh-backward-henkan) (if henkan-begin (if (or inhibit-henkan (= henkan-begin (point))) @@ -46,7 +47,6 @@ Or else, execute command that space-bar invokes usually." (progn (message "Converting...") (sit-for 0) - (put-text-property henkan-begin (point) 'its-lang "Japanese") (egg-convert-region henkan-begin (point)) (message "") )) (setq this-command 'self-insert-command) @@ -91,7 +91,7 @@ Or else, execute command that space-bar invokes usually." (?q . mlh-quit) ; (?r . mlh-) (?s . mlh-small-letter) -; (?t . mlh-) + (?t . mlh-zhongwen-tw) (?u . mlh-kanji) ; (?v . mlh-) (?w . mlh-white-space) @@ -444,7 +444,7 @@ CHAR. MNEMONIC CONVERSION SCHEME (setq beg (point)) (goto-char end-marker) (forward-char -1) - (its-translate-region beg (point)) + (its-translate-region-internal beg (point)) (delete-region (point) end-marker) (if (null henkan-begin) (setq henkan-begin beg))) @@ -456,7 +456,7 @@ CHAR. MNEMONIC CONVERSION SCHEME (setq beg (point)) (goto-char end-marker) (forward-char -2) - (its-translate-region beg (point)) + (its-translate-region-internal beg (point)) (delete-region (point) end-marker) (setq henkan-begin (point))) @@ -478,7 +478,7 @@ CHAR. MNEMONIC CONVERSION SCHEME (setq beg (point)) (goto-char end-marker) (forward-char -2) - (its-translate-region beg (point)) + (its-translate-region-internal beg (point)) (insert (mlh-hira-to-kata (prog1 (buffer-substring beg (point)) @@ -507,5 +507,50 @@ CHAR. MNEMONIC CONVERSION SCHEME (setq i (+ i 3))) result)) +(defun mlh-hangul () + (forward-char -1) + (skip-chars-backward "a-zEO-RTW,.[]") + (mlh-backward-henkan) + (setq beg (point)) + (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) + (its-translate-region-internal beg (point))) + (delete-region (point) end-marker) + (if (null henkan-begin) + (setq henkan-begin beg))) + +(defun mlh-zhongwen () + (forward-char -1) + (skip-chars-backward "a-z0-4 ,.[]") + (mlh-backward-henkan) + (setq beg (point)) + (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) + (its-translate-region-internal beg (point))) + (delete-region (point) end-marker) + (if (null henkan-begin) + (setq henkan-begin beg))) + +(defun mlh-zhongwen-tw () + (forward-char -1) + (skip-chars-backward "a-z0-4,.[]") + (mlh-backward-henkan) + (setq beg (point)) + (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) + (its-translate-region-internal beg (point))) + (delete-region (point) end-marker) + (if (null henkan-begin) + (setq henkan-begin beg))) + (provide 'egg-mlh) ;;; egg-mlh.el ends here. diff --git a/its.el b/its.el index 56bab98..0978ba7 100644 --- a/its.el +++ b/its.el @@ -719,16 +719,25 @@ Return last state." (defvar its-translation-result nil "") (defun its-ins/del-SYL-batch (newsyl oldsyl) + (let (output) (its-update-latest-SYL newsyl) (if (and newsyl (consp (cdr newsyl)) (not (its-kst-p (its-get-kst/t newsyl)))) - ;; DSYL - (setq its-translation-result - (cons (its-get-output newsyl) its-translation-result)))) - -(defun its-translate-region (start end &optional map) + (progn + ;; DSYL + (setq output (its-get-output newsyl)) + (put-text-property 0 (length output) + 'its-lang its-current-language output) + (setq its-translation-result + (cons output its-translation-result)))))) + +(defun its-translate-region (start end) (interactive "r") + (its-translate-region-internal start end) + (remove-text-properties start (point) '(its-lang nil))) + +(defun its-translate-region-internal (start end) (setq its-translation-result nil) (goto-char start) (let ((i 0)