Mercurial > emacs
annotate lisp/language/japan-util.el @ 19272:4ae9e21631b2
(setup-japanese-environment): Do not
change sendmail-coding-system and rmail-file-coding-system.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Sun, 10 Aug 1997 04:09:49 +0000 |
parents | f8aebb949291 |
children | 63415fa4039d |
rev | line source |
---|---|
17315
a3ca5e15c82a
Fix the format of the first line.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1 ;;; japan-util.el --- utilities for Japanese |
17052 | 2 |
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. | |
18377
8b4a66c66dd6
Change copyright notice.
Richard M. Stallman <rms@gnu.org>
parents:
18309
diff
changeset
|
4 ;; Licensed to the Free Software Foundation. |
17052 | 5 |
6 ;; Keywords: mule, multilingual, Japanese | |
7 | |
8 ;; This file is part of GNU Emacs. | |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
12 ;; the Free Software Foundation; either version 2, or (at your option) | |
13 ;; any later version. | |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
17071 | 21 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
23 ;; Boston, MA 02111-1307, USA. | |
17052 | 24 |
25 ;;; Code: | |
26 | |
17993
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
27 ;;;###autoload |
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
28 (defun setup-japanese-environment () |
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
29 "Setup multilingual environment (MULE) for Japanese." |
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
30 (interactive) |
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
31 (setup-english-environment) |
19137
f8aebb949291
(setup-japanese-environment): Do not
Kenichi Handa <handa@m17n.org>
parents:
19088
diff
changeset
|
32 |
18203
0745f30aec66
Adjusted for coding system name change.
Kenichi Handa <handa@m17n.org>
parents:
17993
diff
changeset
|
33 (setq coding-category-iso-8-2 'japanese-iso-8bit) |
17993
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
34 |
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
35 (set-coding-priority |
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
36 '(coding-category-iso-7 |
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
37 coding-category-iso-8-2 |
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
38 coding-category-sjis |
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
39 coding-category-iso-8-1 |
18790
5b263fdf71a2
(setup-japanese-environment): Adjusted for the change of coding
Kenichi Handa <handa@m17n.org>
parents:
18415
diff
changeset
|
40 coding-category-iso-7-else |
5b263fdf71a2
(setup-japanese-environment): Adjusted for the change of coding
Kenichi Handa <handa@m17n.org>
parents:
18415
diff
changeset
|
41 coding-category-iso-8-else |
17993
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
42 coding-category-emacs-mule)) |
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
43 |
19137
f8aebb949291
(setup-japanese-environment): Do not
Kenichi Handa <handa@m17n.org>
parents:
19088
diff
changeset
|
44 (set-default-coding-systems |
f8aebb949291
(setup-japanese-environment): Do not
Kenichi Handa <handa@m17n.org>
parents:
19088
diff
changeset
|
45 (if (eq system-type 'ms-dos) |
f8aebb949291
(setup-japanese-environment): Do not
Kenichi Handa <handa@m17n.org>
parents:
19088
diff
changeset
|
46 'japanese-shift-jis |
f8aebb949291
(setup-japanese-environment): Do not
Kenichi Handa <handa@m17n.org>
parents:
19088
diff
changeset
|
47 'iso-2022-7bit)) |
17993
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
48 |
18790
5b263fdf71a2
(setup-japanese-environment): Adjusted for the change of coding
Kenichi Handa <handa@m17n.org>
parents:
18415
diff
changeset
|
49 (setq default-input-method "japanese") |
19088
a162ad4fde2e
(setup-japanese-environment): Set default value of default-input-method.
Kenichi Handa <handa@m17n.org>
parents:
18790
diff
changeset
|
50 (setq-default default-input-method "japanese") |
17993
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
51 |
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
52 ) |
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
53 |
17052 | 54 (defconst japanese-kana-table |
55 '((?$B$"(B ?$B%"(B ?(I1(B) (?$B$$(B ?$B%$(B ?(I2(B) (?$B$&(B ?$B%&(B ?(I3(B) (?$B$((B ?$B%((B ?(I4(B) (?$B$*(B ?$B%*(B ?(I5(B) | |
56 (?$B$+(B ?$B%+(B ?(I6(B) (?$B$-(B ?$B%-(B ?(I7(B) (?$B$/(B ?$B%/(B ?(I8(B) (?$B$1(B ?$B%1(B ?(I9(B) (?$B$3(B ?$B%3(B ?(I:(B) | |
57 (?$B$5(B ?$B%5(B ?(I;(B) (?$B$7(B ?$B%7(B ?(I<(B) (?$B$9(B ?$B%9(B ?(I=(B) (?$B$;(B ?$B%;(B ?(I>(B) (?$B$=(B ?$B%=(B ?(I?(B) | |
58 (?$B$?(B ?$B%?(B ?(I@(B) (?$B$A(B ?$B%A(B ?(IA(B) (?$B$D(B ?$B%D(B ?(IB(B) (?$B$F(B ?$B%F(B ?(IC(B) (?$B$H(B ?$B%H(B ?(ID(B) | |
59 (?$B$J(B ?$B%J(B ?(IE(B) (?$B$K(B ?$B%K(B ?(IF(B) (?$B$L(B ?$B%L(B ?(IG(B) (?$B$M(B ?$B%M(B ?(IH(B) (?$B$N(B ?$B%N(B ?(II(B) | |
60 (?$B$O(B ?$B%O(B ?(IJ(B) (?$B$R(B ?$B%R(B ?(IK(B) (?$B$U(B ?$B%U(B ?(IL(B) (?$B$X(B ?$B%X(B ?(IM(B) (?$B$[(B ?$B%[(B ?(IN(B) | |
61 (?$B$^(B ?$B%^(B ?(IO(B) (?$B$_(B ?$B%_(B ?(IP(B) (?$B$`(B ?$B%`(B ?(IQ(B) (?$B$a(B ?$B%a(B ?(IR(B) (?$B$b(B ?$B%b(B ?(IS(B) | |
62 (?$B$d(B ?$B%d(B ?(IT(B) (?$B$f(B ?$B%f(B ?(IU(B) (?$B$h(B ?$B%h(B ?(IV(B) | |
63 (?$B$i(B ?$B%i(B ?(IW(B) (?$B$j(B ?$B%j(B ?(IX(B) (?$B$k(B ?$B%k(B ?(IY(B) (?$B$l(B ?$B%l(B ?(IZ(B) (?$B$m(B ?$B%m(B ?(I[(B) | |
64 (?$B$o(B ?$B%o(B ?(I\(B) (?$B$p(B ?$B%p(B nil) (?$B$q(B ?$B%q(B nil) (?$B$r(B ?$B%r(B ?(I&(B) | |
65 (?$B$s(B ?$B%s(B ?(I](B) | |
66 (?$B$,(B ?$B%,(B "(I6^(B") (?$B$.(B ?$B%.(B "(I7^(B") (?$B$0(B ?$B%0(B "(I8^(B") (?$B$2(B ?$B%2(B "(I9^(B") (?$B$4(B ?$B%4(B "(I:^(B") | |
67 (?$B$6(B ?$B%6(B "(I;^(B") (?$B$8(B ?$B%8(B "(I<^(B") (?$B$:(B ?$B%:(B "(I=^(B") (?$B$<(B ?$B%<(B "(I>^(B") (?$B$>(B ?$B%>(B "(I?^(B") | |
68 (?$B$@(B ?$B%@(B "(I@^(B") (?$B$B(B ?$B%B(B "(IA^(B") (?$B$E(B ?$B%E(B "(IB^(B") (?$B$G(B ?$B%G(B "(IC^(B") (?$B$I(B ?$B%I(B "(ID^(B") | |
69 (?$B$P(B ?$B%P(B "(IJ^(B") (?$B$S(B ?$B%S(B "(IK^(B") (?$B$V(B ?$B%V(B "(IL^(B") (?$B$Y(B ?$B%Y(B "(IM^(B") (?$B$\(B ?$B%\(B "(IN^(B") | |
70 (?$B$Q(B ?$B%Q(B "(IJ_(B") (?$B$T(B ?$B%T(B "(IK_(B") (?$B$W(B ?$B%W(B "(IL_(B") (?$B$Z(B ?$B%Z(B "(IM_(B") (?$B$](B ?$B%](B "(IN_(B") | |
71 (?$B$!(B ?$B%!(B ?(I'(B) (?$B$#(B ?$B%#(B ?(I((B) (?$B$%(B ?$B%%(B ?(I)(B) (?$B$'(B ?$B%'(B ?(I*(B) (?$B$)(B ?$B%)(B ?(I+(B) | |
72 (?$B$C(B ?$B%C(B ?(I/(B) | |
73 (?$B$c(B ?$B%c(B ?(I,(B) (?$B$e(B ?$B%e(B ?(I-(B) (?$B$g(B ?$B%g(B ?(I.(B) | |
74 (?$B$n(B ?$B%n(B nil) | |
75 (nil ?$B%t(B "(I3^(B") (nil ?$B%u(B nil) (nil ?$B%v(B nil)) | |
76 "Japanese JISX0208 Kana character table. | |
77 Each element is of the form (HIRAGANA KATAKANA HANKAKU-KATAKANA), where | |
78 HIRAGANA and KATAKANA belong to `japanese-jisx0208', | |
79 HANKAKU-KATAKANA belongs to `japanese-jisx0201-kana'.") | |
80 | |
81 ;; Put properties 'katakana, 'hiragana, and 'jix0201 to each Japanese | |
82 ;; kana characters for conversion among them. | |
83 (let ((l japanese-kana-table) | |
84 slot hiragana katakana jisx0201) | |
85 (while l | |
86 (setq slot (car l) | |
87 hiragana (car slot) katakana (nth 1 slot) jisx0201 (nth 2 slot) | |
88 l (cdr l)) | |
89 (if hiragana | |
90 (progn | |
91 (put-char-code-property hiragana 'katakana katakana) | |
92 (put-char-code-property katakana 'hiragana hiragana) | |
93 (if jisx0201 | |
94 (progn | |
95 (put-char-code-property hiragana 'jisx0201 jisx0201) | |
96 (if (integerp jisx0201) | |
97 (put-char-code-property jisx0201 'hiragana hiragana)))))) | |
98 (if jisx0201 | |
99 (progn | |
100 (put-char-code-property katakana 'jisx0201 jisx0201) | |
101 (if (integerp jisx0201) | |
102 (put-char-code-property jisx0201 'katakana katakana)))))) | |
103 | |
104 (defconst japanese-symbol-table | |
105 '((?\$B!!(B ?\ ) (?$B!"(B ?, ?(I$(B) (?$B!#(B ?. ?(I!(B) (?$B!$(B ?, ?(I$(B) (?$B!%(B ?. ?(I!(B) (?$B!&(B nil ?(I%(B) | |
106 (?$B!'(B ?:) (?$B!((B ?\;) (?$B!)(B ??) (?$B!*(B ?!) (?$B!+(B nil ?(I^(B) (?$B!,(B nil ?(I_(B) | |
107 (?$B!-(B ?') (?$B!.(B ?`) (?$B!0(B ?^) (?$B!2(B ?_) (?$B!<(B ?-) (?$B!=(B ?-) (?$B!>(B ?-) | |
108 (?$B!?(B ?/) (?$B!@(B ?\\) (?$B!A(B ?~) (?$B!C(B ?|) (?$B!F(B ?`) (?$B!G(B ?') (?$B!H(B ?\") (?$B!I(B ?\") | |
109 (?\$B!J(B ?\() (?\$B!K(B ?\)) (?\$B!N(B ?[) (?\$B!O(B ?]) (?\$B!P(B ?{) (?\$B!Q(B ?}) | |
110 (?$B!R(B ?<) (?$B!S(B ?>) (?$B!\(B ?+) (?$B!](B ?-) (?$B!a(B ?=) (?$B!c(B ?<) (?$B!d(B ?>) | |
111 (?$B!l(B ?') (?$B!m(B ?\") (?$B!o(B ?\\) (?$B!p(B ?$) (?$B!s(B ?%) (?$B!t(B ?#) (?$B!u(B ?&) (?$B!v(B ?*) | |
112 (?$B!w(B ?@)) | |
113 "Japanese JISX0208 symbol character table. | |
114 Each element is of the form (SYMBOL ASCII HANKAKU), where SYMBOL | |
115 belongs to `japanese-jisx0208', ASCII belongs to `ascii', and HANKAKU | |
116 belongs to `japanese-jisx0201-kana'.") | |
117 | |
118 ;; Put properties 'jisx0208, 'jisx0201, and 'ascii to each Japanese | |
119 ;; symbol and ASCII characters for conversion among them. | |
120 (let ((l japanese-symbol-table) | |
121 slot jisx0208 ascii jisx0201) | |
122 (while l | |
123 (setq slot (car l) | |
124 jisx0208 (car slot) ascii (nth 1 slot) jisx0201 (nth 2 slot) | |
125 l (cdr l)) | |
126 (if ascii | |
127 (progn | |
128 (put-char-code-property jisx0208 'ascii ascii) | |
129 (put-char-code-property ascii 'jisx0208 jisx0208))) | |
130 (if jisx0201 | |
131 (progn | |
132 (put-char-code-property jisx0208 'jisx0201 jisx0201) | |
133 (put-char-code-property jisx0201 'jisx0208 jisx0208))))) | |
134 | |
135 (defconst japanese-alpha-numeric-table | |
136 '((?$B#0(B . ?0) (?$B#1(B . ?1) (?$B#2(B . ?2) (?$B#3(B . ?3) (?$B#4(B . ?4) | |
137 (?$B#5(B . ?5) (?$B#6(B . ?6) (?$B#7(B . ?7) (?$B#8(B . ?8) (?$B#9(B . ?9) | |
138 (?$B#A(B . ?A) (?$B#B(B . ?B) (?$B#C(B . ?C) (?$B#D(B . ?D) (?$B#E(B . ?E) | |
139 (?$B#F(B . ?F) (?$B#G(B . ?G) (?$B#H(B . ?H) (?$B#I(B . ?I) (?$B#J(B . ?J) | |
140 (?$B#K(B . ?K) (?$B#L(B . ?L) (?$B#M(B . ?M) (?$B#N(B . ?N) (?$B#O(B . ?O) | |
141 (?$B#P(B . ?P) (?$B#Q(B . ?Q) (?$B#R(B . ?R) (?$B#S(B . ?S) (?$B#T(B . ?T) | |
142 (?$B#U(B . ?U) (?$B#V(B . ?V) (?$B#W(B . ?W) (?$B#X(B . ?X) (?$B#Y(B . ?Y) (?$B#Z(B . ?Z) | |
143 (?$B#a(B . ?a) (?$B#b(B . ?b) (?$B#c(B . ?c) (?$B#d(B . ?d) (?$B#e(B . ?e) | |
144 (?$B#f(B . ?f) (?$B#g(B . ?g) (?$B#h(B . ?h) (?$B#i(B . ?i) (?$B#j(B . ?j) | |
145 (?$B#k(B . ?k) (?$B#l(B . ?l) (?$B#m(B . ?m) (?$B#n(B . ?n) (?$B#o(B . ?o) | |
146 (?$B#p(B . ?p) (?$B#q(B . ?q) (?$B#r(B . ?r) (?$B#s(B . ?s) (?$B#t(B . ?t) | |
147 (?$B#u(B . ?u) (?$B#v(B . ?v) (?$B#w(B . ?w) (?$B#x(B . ?x) (?$B#y(B . ?y) (?$B#z(B . ?z)) | |
148 "Japanese JISX0208 alpha numeric character table. | |
149 Each element is of the form (ALPHA-NUMERIC ASCII), where ALPHA-NUMERIC | |
150 belongs to `japanese-jisx0208', ASCII belongs to `ascii'.") | |
151 | |
152 ;; Put properties 'jisx0208 and 'ascii to each Japanese alpha numeric | |
153 ;; and ASCII characters for conversion between them. | |
154 (let ((l japanese-alpha-numeric-table) | |
155 slot jisx0208 ascii) | |
156 (while l | |
157 (setq slot (car l) | |
158 jisx0208 (car slot) ascii (cdr slot) | |
159 l (cdr l)) | |
160 (put-char-code-property jisx0208 'ascii ascii) | |
161 (put-char-code-property ascii 'jisx0208 jisx0208))) | |
162 | |
163 ;; Convert string STR by FUNC and return a resulting string. | |
164 (defun japanese-string-conversion (str func &rest args) | |
165 (let ((buf (get-buffer-create " *Japanese work*"))) | |
166 (save-excursion | |
167 (set-buffer buf) | |
168 (erase-buffer) | |
169 (insert str) | |
170 (apply func 1 (point) args) | |
171 (buffer-string)))) | |
172 | |
173 ;;;###autoload | |
174 (defun japanese-katakana (obj &optional hankaku) | |
175 "Convert argument to Katakana and return that. | |
176 The argument may be a character or string. The result has the same type. | |
177 The argument object is not altered--the value is a copy. | |
178 Optional argument HANKAKU t means to convert to `hankaku' Katakana | |
179 \(`japanese-jisx0201-kana'), in which case return value | |
180 may be a string even if OBJ is a character if two Katakanas are | |
181 necessary to represent OBJ." | |
182 (if (stringp obj) | |
183 (japanese-string-conversion obj 'japanese-katakana-region hankaku) | |
184 (or (get-char-code-property obj (if hankaku 'jisx0201 'katakana)) | |
185 obj))) | |
186 | |
187 ;;;###autoload | |
188 (defun japanese-hiragana (obj) | |
189 "Convert argument to Hiragana and return that. | |
190 The argument may be a character or string. The result has the same type. | |
191 The argument object is not altered--the value is a copy." | |
192 (if (stringp obj) | |
193 (japanese-string-conversion obj 'japanese-hiragana-region) | |
194 (or (get-char-code-property obj 'hiragana) | |
195 obj))) | |
196 | |
197 ;;;###autoload | |
198 (defun japanese-hankaku (obj &optional ascii-only) | |
199 "Convert argument to `hankaku' and return that. | |
200 The argument may be a character or string. The result has the same type. | |
201 The argument object is not altered--the value is a copy. | |
202 Optional argument ASCII-ONLY non-nil means to return only ASCII character." | |
203 (if (stringp obj) | |
204 (japanese-string-conversion obj 'japanese-hankaku-region ascii-only) | |
205 (or (get-char-code-property obj 'ascii) | |
206 (and (not ascii-only) | |
207 (get-char-code-property obj 'jisx0201)) | |
208 obj))) | |
209 | |
210 ;;;###autoload | |
211 (defun japanese-zenkaku (obj) | |
212 "Convert argument to `zenkaku' and return that. | |
213 The argument may be a character or string. The result has the same type. | |
214 The argument object is not altered--the value is a copy." | |
215 (if (stringp obj) | |
216 (japanese-string-conversion obj 'japanese-zenkaku-region) | |
217 (or (get-char-code-property obj 'jisx0208) | |
218 obj))) | |
219 | |
220 ;;;###autoload | |
221 (defun japanese-katakana-region (from to &optional hankaku) | |
222 "Convert Japanese `hiragana' chars in the region to `katakana' chars. | |
223 Optional argument HANKAKU t means to convert to `hankaku katakana' character | |
224 of which charset is `japanese-jisx0201-kana'." | |
225 (interactive "r\nP") | |
226 (save-restriction | |
227 (narrow-to-region from to) | |
228 (goto-char (point-min)) | |
229 (while (re-search-forward "\\cH\\|\\cK" nil t) | |
230 (let* ((hira (preceding-char)) | |
231 (kata (japanese-katakana hira hankaku))) | |
232 (if kata | |
233 (progn | |
234 (delete-region (match-beginning 0) (match-end 0)) | |
235 (insert kata))))))) | |
236 | |
237 ;;;###autoload | |
238 (defun japanese-hiragana-region (from to) | |
239 "Convert Japanese `katakana' chars in the region to `hiragana' chars." | |
240 (interactive "r") | |
241 (save-restriction | |
242 (narrow-to-region from to) | |
243 (goto-char (point-min)) | |
244 (while (re-search-forward "\\cK\\|\\ck" nil t) | |
245 (let* ((kata (preceding-char)) | |
246 (hira (japanese-hiragana kata))) | |
247 (if hira | |
248 (progn | |
249 (delete-region (match-beginning 0) (match-end 0)) | |
250 (insert hira))))))) | |
251 | |
252 ;;;###autoload | |
253 (defun japanese-hankaku-region (from to &optional ascii-only) | |
254 "Convert Japanese `zenkaku' chars in the region to `hankaku' chars. | |
255 `Zenkaku' chars belong to `japanese-jisx0208' | |
256 `Hankaku' chars belong to `ascii' or `japanese-jisx0201-kana'. | |
257 Optional argument ASCII-ONLY non-nil means to convert only to ASCII char." | |
258 (interactive "r\nP") | |
259 (save-restriction | |
260 (narrow-to-region from to) | |
261 (goto-char (point-min)) | |
262 (while (re-search-forward "\\cj" nil t) | |
263 (let* ((zenkaku (preceding-char)) | |
264 (hankaku (japanese-hankaku zenkaku ascii-only))) | |
265 (if hankaku | |
266 (progn | |
267 (delete-region (match-beginning 0) (match-end 0)) | |
268 (insert hankaku))))))) | |
269 | |
270 ;;;###autoload | |
271 (defun japanese-zenkaku-region (from to) | |
272 "Convert hankaku' chars in the region to Japanese `zenkaku' chars. | |
273 `Zenkaku' chars belong to `japanese-jisx0208' | |
274 `Hankaku' chars belong to `ascii' or `japanese-jisx0201-kana'." | |
275 (interactive "r") | |
276 (save-restriction | |
277 (narrow-to-region from to) | |
278 (goto-char (point-min)) | |
279 (while (re-search-forward "\\ca\\|\\ck" nil t) | |
280 (let* ((hankaku (preceding-char)) | |
281 (zenkaku (japanese-zenkaku hankaku))) | |
282 (if zenkaku | |
283 (progn | |
284 (delete-region (match-beginning 0) (match-end 0)) | |
285 (insert zenkaku))))))) | |
286 | |
287 ;;;###autoload | |
288 (defun read-hiragana-string (prompt &optional initial-input) | |
289 "Read a Hiragana string from the minibuffer, prompting with string PROMPT. | |
290 If non-nil, second arg INITIAL-INPUT is a string to insert before reading." | |
18415
1cf4e09c841d
(read-hiragana-string): Call read-multilingual-string correctly.
Richard M. Stallman <rms@gnu.org>
parents:
18377
diff
changeset
|
291 (read-multilingual-string prompt initial-input "quail-ja-hiragana")) |
17052 | 292 |
293 ;; | |
18309
bd8b521f5218
Provide XXX-util instead of
Kenichi Handa <handa@m17n.org>
parents:
18203
diff
changeset
|
294 (provide 'japan-util) |
17052 | 295 |
296 ;;; japan-util.el ends here |