changeset 23722:b0c66c87b29b

(japanese-zenkaku-region): New optional arg KATAKANA-ONLY.
author Kenichi Handa <handa@m17n.org>
date Mon, 16 Nov 1998 06:26:27 +0000
parents e593fb9c68c3
children b706421adbd5
files lisp/language/japan-util.el
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/language/japan-util.el	Mon Nov 16 06:26:27 1998 +0000
+++ b/lisp/language/japan-util.el	Mon Nov 16 06:26:27 1998 +0000
@@ -291,16 +291,20 @@
 				       hankaku)))))))
 
 ;;;###autoload
-(defun japanese-zenkaku-region (from to)
+(defun japanese-zenkaku-region (from to &optional katakana-only)
   "Convert hankaku' chars in the region to Japanese `zenkaku' chars.
 `Zenkaku' chars belong to `japanese-jisx0208'
-`Hankaku' chars belong to `ascii' or `japanese-jisx0201-kana'."
-  (interactive "r")
+`Hankaku' chars belong to `ascii' or `japanese-jisx0201-kana'.
+Optional argument KATAKANA-ONLY non-nil means to convert only KATAKANA char."
+  (interactive "r\nP")
   (save-restriction
     (narrow-to-region from to)
     (save-excursion
       (goto-char (point-min))
-      (while (re-search-forward "\\ca\\|\\ck" nil t)
+      (while (or (and katakana-only
+		      (re-search-forward "\\ck" nil t))
+		 (and (not katakana-only)
+		      (re-search-forward "\\ca\\|\\ck" nil t)))
 	(let* ((hankaku (preceding-char))
 	       (composition (get-char-code-property hankaku 'kana-composition))
 	       next slot)