From cc0feadfb70b090ec65e49bca471781b958c8870 Mon Sep 17 00:00:00 2001 From: tomo Date: Mon, 25 Jul 2005 00:13:04 +0000 Subject: [PATCH] (japanese-simplify-region): New function. --- ideo-trans.el | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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) -- 1.7.10.4