(japanese-traditionalize-string): Use `selector' instead of
authorMORIOKA Tomohiko <tomo.git@chise.org>
Wed, 20 Nov 2013 03:25:00 +0000 (12:25 +0900)
committerMORIOKA Tomohiko <tomo.git@chise.org>
Wed, 20 Nov 2013 03:25:00 +0000 (12:25 +0900)
`ideo-trans-select-char'.
(japanese-traditionalize-region): Add new optional argument
`selector'.

ideo-trans.el

index 3c8087b..355192a 100644 (file)
                 (setq ret (or (char-feature ret '<-simplified@JP/Jouyou)
                               (char-feature ret '<-simplified@JP))))
               (if (cdr ret)
-                  (ideo-trans-select-char ret (format "%c => " chr))
+                  (funcall selector ret)
                 (car ret)))
              ((setq ret (char-feature chr '=>ucs@jis))
               (decode-char '=ucs@jis ret))
   'japanese-traditionalize-string)
 
 ;;;###autoload
-(defun japanese-traditionalize-region (start end)
+(defun japanese-traditionalize-region (start end &optional selector)
   "Convert Japanese simplified Kanji in the region into traditional characters."
   (interactive "r")
+  (unless selector
+    (setq selector
+         (lambda (chars)
+           (ideo-trans-select-char chars (format "%c => " chr)))))
   (save-excursion
     (save-restriction
       (narrow-to-region start end)
              (progn
                (if (cdr ret)
                    (progn
-                     (setq rret (ideo-trans-select-char ret))
+                     (setq rret (funcall selector ret))
                      (delete-char)
                      (insert rret))
                  (delete-char)