(japanese-simplify-region): New function.
authortomo <tomo>
Mon, 25 Jul 2005 00:13:04 +0000 (00:13 +0000)
committertomo <tomo>
Mon, 25 Jul 2005 00:13:04 +0000 (00:13 +0000)
ideo-trans.el

index 3edfdec..dad8d0b 100644 (file)
                (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)