From: tomo Date: Mon, 25 Jul 2005 00:13:04 +0000 (+0000) Subject: (japanese-simplify-region): New function. X-Git-Tag: chise-base-0_23~11 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc0feadfb70b090ec65e49bca471781b958c8870;p=chise%2Ftomoyo-tools.git (japanese-simplify-region): New function. --- diff --git a/ideo-trans.el b/ideo-trans.el index 3edfdec..dad8d0b 100644 --- a/ideo-trans.el +++ b/ideo-trans.el @@ -249,6 +249,34 @@ (forward-char)))))))) ;;;###autoload +(defun japanese-simplify-region (start end) + (interactive "r") + (save-excursion + (save-restriction + (narrow-to-region start end) + (goto-char start) + (let (chr ret rret) + (while (and (skip-chars-forward "\x00-\xFF") + (not (eobp))) + (setq chr (char-after)) + (if (setq ret (or (get-char-attribute chr '->simplified@JP/Jouyou) + (get-char-attribute chr '->simplified@jp-jouyou) + (get-char-attribute chr '->simplified@JP) + (get-char-attribute chr '->simplified@jp) + (get-char-attribute chr '->jp-simplified) + (get-char-attribute chr '->simplified))) + (progn + (if (cdr ret) + (progn + (setq rret (ideo-trans-select-char ret)) + (delete-char) + (insert rret)) + (delete-char) + (insert (car ret)))) + (or (eobp) + (forward-char)))))))) + +;;;###autoload (define-obsolete-function-alias 'ideo-translate-japanese-region-into-traditional 'japanese-traditionalize-region)