Mercurial > emacs
annotate leim/quail/japanese.el @ 18856:03eeb83520d8
(custom-group-value-create) <tree>: Don't distinguish
unloaded groups; use [+] for them.
(customize-browse): Fix top-of-buffer doc text.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 18 Jul 1997 18:59:20 +0000 |
parents | 05dcf4a48ded |
children | ae9924361448 |
rev | line source |
---|---|
18673 | 1 ;;; quail/japanese.el --- Quail package for inputting Japanese |
2 | |
3 ;; Copyright (C) 1997 Electrotechnical Laboratory, JAPAN. | |
4 ;; Licensed to the Free Software Foundation. | |
5 | |
6 ;; Keywords: multilingual, input method, 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 | |
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. | |
24 | |
25 ;;; Code: | |
26 | |
27 (require 'quail) | |
28 (require 'kkc) | |
29 | |
30 ;; Update Quail translation region for Japanese bizarre translation | |
31 ;; rules. | |
32 (defun quail-japanese-update-translation (control-flag) | |
33 (cond ((eq control-flag t) | |
34 (insert quail-current-str) | |
35 (quail-terminate-translation)) | |
36 ((null control-flag) | |
37 (if (/= (aref quail-current-key 0) ?q) | |
38 (insert (or quail-current-str quail-current-key)))) | |
39 (t ; i.e. (numberp control-flag) | |
40 (cond ((= (aref quail-current-key 0) ?n) | |
41 (insert ?$B$s(B)) | |
42 ((= (aref quail-current-key 0) (aref quail-current-key 1)) | |
43 (insert ?$B$C(B)) | |
44 (t | |
45 (insert (aref quail-current-key 0)))) | |
46 (setq unread-command-events | |
47 (list (aref quail-current-key control-flag))) | |
48 (quail-terminate-translation)))) | |
49 | |
50 ;; Flag to control the behavior of `quail-japanese-toggle-kana'. | |
51 (defvar quail-japanese-kana-state nil) | |
52 (make-variable-buffer-local 'quail-japanese-kana-state) | |
53 | |
54 ;; Convert Hiragana <-> Katakana in the current translation region. | |
55 (defun quail-japanese-toggle-kana () | |
56 (interactive) | |
57 (if (quail-point-in-conversion-region) | |
58 (let ((start (overlay-start quail-conv-overlay)) | |
59 (end (overlay-end quail-conv-overlay))) | |
60 (setq quail-japanese-kana-state | |
61 (if (eq last-command this-command) | |
62 (not quail-japanese-kana-state))) | |
63 (if quail-japanese-kana-state | |
64 (japanese-hiragana-region start end) | |
65 (japanese-katakana-region start end)) | |
66 (goto-char (overlay-end quail-conv-overlay)) | |
67 (setq quail-exit-conversion-mode t)) | |
68 ;; When this command is invoked, the point is not in a valid | |
69 ;; region. Try the event which invoked this command again out of | |
70 ;; conversion mode. | |
71 (setq unread-command-events (list last-command-event)) | |
72 (throw 'exit nil))) | |
73 | |
74 ;; Convert Hiragana in the current translation region to Kanji by KKC | |
75 ;; (Kana Kanji Converter) utility. | |
76 (defun quail-japanese-kanji-kkc () | |
77 (interactive) | |
78 (if (quail-point-in-conversion-region) | |
79 (let ((from (overlay-start quail-conv-overlay)) | |
80 (to (overlay-end quail-conv-overlay)) | |
81 newfrom) | |
82 (delete-overlay quail-overlay) | |
83 (delete-overlay quail-conv-overlay) | |
84 (unwind-protect | |
85 (setq newfrom (kkc-region from to)) | |
86 ;; Activate the original (or shrinked) conversion region | |
87 ;; again. | |
88 (if newfrom | |
89 ;; `kkc-region' is canceled. | |
90 (move-overlay quail-conv-overlay newfrom (point)) | |
91 ;; `kkc-region' is terminated normally. | |
92 (move-overlay quail-conv-overlay from (point)) | |
93 (throw 'exit nil)))) | |
94 ;; When this command is invoked, the point is not in a valid | |
95 ;; region. Try the event which invoked this command again out of | |
96 ;; conversion mode. | |
97 (setq unread-command-events (list last-command-event)) | |
98 (throw 'exit nil))) | |
99 | |
100 (defun quail-japanese-self-insert-and-switch-to-alpha (key idx) | |
101 (quail-delete-region) | |
102 (setq unread-command-events (list (aref key (1- idx)))) | |
103 (quail-japanese-switch-package "q" 1)) | |
104 | |
105 (defvar quail-japanese-switch-table | |
106 '((?z . "japanese-zenkaku") | |
107 (?k . "japanese-hankaku-kana") | |
108 (?h . "japanese") | |
109 (?q . ("japanese-ascii")))) | |
110 | |
111 (defvar quail-japanese-package-saved nil) | |
112 (make-variable-buffer-local 'quail-japanese-package-saved) | |
113 (put 'quail-japanese-package-saved 'permanent-local t) | |
114 | |
115 (defun quail-japanese-switch-package (key idx) | |
116 (let ((pkg (cdr (assq (aref key (1- idx)) quail-japanese-switch-table)))) | |
117 (if (null pkg) | |
118 (error "No package to be switched") | |
119 (quail-delete-region) | |
120 (if (stringp pkg) | |
121 (select-input-method pkg) | |
122 (if (string= (car pkg) current-input-method) | |
123 (if quail-japanese-package-saved | |
124 (select-input-method quail-japanese-package-saved)) | |
125 (setq quail-japanese-package-saved current-input-method) | |
126 (select-input-method (car pkg)))) | |
127 (throw 'quail-tag nil)))) | |
128 | |
129 (quail-define-package | |
130 "japanese" "Japanese" "A$B$"(B" | |
131 nil | |
132 "Romaji -> Hiragana -> Kanji&Kana | |
133 ---- Special key bindings ---- | |
134 qq: toggle between input methods `japanese' and `japanese-ascii' | |
135 qz: use `japanese-zenkaku' package, \"qh\" puts you back to `japanese' | |
18804
05dcf4a48ded
Doc-string of Quail package japanese modified.
Kenichi Handa <handa@m17n.org>
parents:
18673
diff
changeset
|
136 K: toggle converting region between Katakana and Hiragana |
18673 | 137 SPC: convert to Kanji&Kana |
138 z: insert one Japanese symbol according to a key which follows | |
139 " | |
140 nil t t nil nil nil nil nil | |
141 'quail-japanese-update-translation | |
142 '(("K" . quail-japanese-toggle-kana) | |
143 (" " . quail-japanese-kanji-kkc) | |
144 ("\C-m" . quail-no-conversion) | |
145 ([return] . quail-no-conversion)) | |
146 ) | |
147 | |
148 (quail-define-rules | |
149 | |
150 ( "a" "$B$"(B") ( "i" "$B$$(B") ( "u" "$B$&(B") ( "e" "$B$((B") ( "o" "$B$*(B") | |
151 ("ka" "$B$+(B") ("ki" "$B$-(B") ("ku" "$B$/(B") ("ke" "$B$1(B") ("ko" "$B$3(B") | |
152 ("sa" "$B$5(B") ("si" "$B$7(B") ("su" "$B$9(B") ("se" "$B$;(B") ("so" "$B$=(B") | |
153 ("ta" "$B$?(B") ("ti" "$B$A(B") ("tu" "$B$D(B") ("te" "$B$F(B") ("to" "$B$H(B") | |
154 ("na" "$B$J(B") ("ni" "$B$K(B") ("nu" "$B$L(B") ("ne" "$B$M(B") ("no" "$B$N(B") | |
155 ("ha" "$B$O(B") ("hi" "$B$R(B") ("hu" "$B$U(B") ("he" "$B$X(B") ("ho" "$B$[(B") | |
156 ("ma" "$B$^(B") ("mi" "$B$_(B") ("mu" "$B$`(B") ("me" "$B$a(B") ("mo" "$B$b(B") | |
157 ("ya" "$B$d(B") ("yu" "$B$f(B") ("yo" "$B$h(B") | |
158 ("ra" "$B$i(B") ("ri" "$B$j(B") ("ru" "$B$k(B") ("re" "$B$l(B") ("ro" "$B$m(B") | |
159 ("la" "$B$i(B") ("li" "$B$j(B") ("lu" "$B$k(B") ("le" "$B$l(B") ("lo" "$B$m(B") | |
160 ("wa" "$B$o(B") ("wi" "$B$p(B") ("wu" "$B$&(B") ("we" "$B$q(B") ("wo" "$B$r(B") | |
161 ("n'" "$B$s(B") | |
162 ("ga" "$B$,(B") ("gi" "$B$.(B") ("gu" "$B$0(B") ("ge" "$B$2(B") ("go" "$B$4(B") | |
163 ("za" "$B$6(B") ("zi" "$B$8(B") ("zu" "$B$:(B") ("ze" "$B$<(B") ("zo" "$B$>(B") | |
164 ("da" "$B$@(B") ("di" "$B$B(B") ("du" "$B$E(B") ("de" "$B$G(B") ("do" "$B$I(B") | |
165 ("ba" "$B$P(B") ("bi" "$B$S(B") ("bu" "$B$V(B") ("be" "$B$Y(B") ("bo" "$B$\(B") | |
166 ("pa" "$B$Q(B") ("pi" "$B$T(B") ("pu" "$B$W(B") ("pe" "$B$Z(B") ("po" "$B$](B") | |
167 | |
168 ("kya" ["$B$-$c(B"]) ("kyu" ["$B$-$e(B"]) ("kye" ["$B$-$'(B"]) ("kyo" ["$B$-$g(B"]) | |
169 ("sya" ["$B$7$c(B"]) ("syu" ["$B$7$e(B"]) ("sye" ["$B$7$'(B"]) ("syo" ["$B$7$g(B"]) | |
170 ("sha" ["$B$7$c(B"]) ("shu" ["$B$7$e(B"]) ("she" ["$B$7$'(B"]) ("sho" ["$B$7$g(B"]) | |
171 ("cha" ["$B$A$c(B"]) ("chu" ["$B$A$e(B"]) ("che" ["$B$A$'(B"]) ("cho" ["$B$A$g(B"]) | |
172 ("tya" ["$B$A$c(B"]) ("tyu" ["$B$A$e(B"]) ("tye" ["$B$A$'(B"]) ("tyo" ["$B$A$g(B"]) | |
173 ("nya" ["$B$K$c(B"]) ("nyu" ["$B$K$e(B"]) ("nye" ["$B$K$'(B"]) ("nyo" ["$B$K$g(B"]) | |
174 ("hya" ["$B$R$c(B"]) ("hyu" ["$B$R$e(B"]) ("hye" ["$B$R$'(B"]) ("hyo" ["$B$R$g(B"]) | |
175 ("mya" ["$B$_$c(B"]) ("myu" ["$B$_$e(B"]) ("mye" ["$B$_$'(B"]) ("myo" ["$B$_$g(B"]) | |
176 ("rya" ["$B$j$c(B"]) ("ryu" ["$B$j$e(B"]) ("rye" ["$B$j$'(B"]) ("ryo" ["$B$j$g(B"]) | |
177 ("lya" ["$B$j$c(B"]) ("lyu" ["$B$j$e(B"]) ("lye" ["$B$j$'(B"]) ("lyo" ["$B$j$g(B"]) | |
178 ("gya" ["$B$.$c(B"]) ("gyu" ["$B$.$e(B"]) ("gye" ["$B$.$'(B"]) ("gyo" ["$B$.$g(B"]) | |
179 ("zya" ["$B$8$c(B"]) ("zyu" ["$B$8$e(B"]) ("zye" ["$B$8$'(B"]) ("zyo" ["$B$8$g(B"]) | |
180 ("jya" ["$B$8$c(B"]) ("jyu" ["$B$8$e(B"]) ("jye" ["$B$8$'(B"]) ("jyo" ["$B$8$g(B"]) | |
181 ( "ja" ["$B$8$c(B"]) ( "ju" ["$B$8$e(B"]) ( "je" ["$B$8$'(B"]) ( "jo" ["$B$8$g(B"]) | |
182 ("bya" ["$B$S$c(B"]) ("byu" ["$B$S$e(B"]) ("bye" ["$B$S$'(B"]) ("byo" ["$B$S$g(B"]) | |
183 ("pya" ["$B$T$c(B"]) ("pyu" ["$B$T$e(B"]) ("pye" ["$B$T$'(B"]) ("pyo" ["$B$T$g(B"]) | |
184 | |
185 ("kwa" ["$B$/$n(B"]) ("kwi" ["$B$/$#(B"]) ("kwe" ["$B$/$'(B"]) ("kwo" ["$B$/$)(B"]) | |
186 ("tsa" ["$B$D$!(B"]) ("tsi" ["$B$D$#(B"]) ("tse" ["$B$D$'(B"]) ("tso" ["$B$D$)(B"]) | |
187 ( "fa" ["$B$U$!(B"]) ( "fi" ["$B$U$#(B"]) ( "fe" ["$B$U$'(B"]) ( "fo" ["$B$U$)(B"]) | |
188 ("gwa" ["$B$0$n(B"]) ("gwi" ["$B$0$#(B"]) ("gwe" ["$B$0$'(B"]) ("gwo" ["$B$0$)(B"]) | |
189 | |
190 ("dyi" ["$B$G$#(B"]) ("dyu" ["$B$I$%(B"]) ("dye" ["$B$G$'(B"]) ("dyo" ["$B$I$)(B"]) | |
191 ("xwi" ["$B$&$#(B"]) ("xwe" ["$B$&$'(B"]) ("xwo" ["$B$&$)(B"]) | |
192 | |
193 ("shi" "$B$7(B") ("tyi" ["$B$F$#(B"]) ("chi" "$B$A(B") ("tsu" "$B$D(B") ("ji" "$B$8(B") | |
194 ("fu" "$B$U(B") | |
195 ("ye" ["$B$$$'(B"]) | |
196 | |
197 ("va" ["$B%t$!(B"]) ("vi" ["$B%t$#(B"]) ("vu" "$B%t(B") ("ve" ["$B%t$'(B"]) ("vo" ["$B%t$)(B"]) | |
198 | |
199 ("xa" "$B$!(B") ("xi" "$B$#(B") ("xu" "$B$%(B") ("xe" "$B$'(B") ("xo" "$B$)(B") | |
200 ("xtu" "$B$C(B") ("xya" "$B$c(B") ("xyu" "$B$e(B") ("xyo" "$B$g(B") ("xwa" "$B$n(B") | |
201 ("xka" "$B%u(B") ("xke" "$B%v(B") | |
202 | |
203 ("1" "$B#1(B") ("2" "$B#2(B") ("3" "$B#3(B") ("4" "$B#4(B") ("5" "$B#5(B") | |
204 ("6" "$B#6(B") ("7" "$B#7(B") ("8" "$B#8(B") ("9" "$B#9(B") ("0" "$B#0(B") | |
205 | |
206 ("!" "$B!*(B") ("@" "$B!w(B") ("#" "$B!t(B") ("$" "$B!p(B") ("%" "$B!s(B") | |
207 ("^" "$B!0(B") ("&" "$B!u(B") ("*" "$B!v(B") ("(" "$B!J(B") (")" "$B!K(B") | |
208 ("-" "$B!<(B") ("=" "$B!a(B") ("`" "$B!.(B") ("\\" "$B!o(B") ("|" "$B!C(B") | |
209 ("_" "$B!2(B") ("+" "$B!\(B") ("~" "$B!1(B") ("[" "$B!V(B") ("]" "$B!W(B") | |
210 ("{" "$B!P(B") ("}" "$B!Q(B") (":" "$B!'(B") (";" "$B!((B") ("\"" "$B!I(B") | |
211 ("'" "$B!G(B") ("." "$B!#(B") ("," "$B!"(B") ("<" "$B!c(B") (">" "$B!d(B") | |
212 ("?" "$B!)(B") ("/" "$B!?(B") | |
213 | |
214 ("z1" "$B!{(B") ("z!" "$B!|(B") | |
215 ("z2" "$B"&(B") ("z@" "$B"'(B") | |
216 ("z3" "$B"$(B") ("z#" "$B"%(B") | |
217 ("z4" "$B""(B") ("z$" "$B"#(B") | |
218 ("z5" "$B!~(B") ("z%" "$B"!(B") | |
219 ("z6" "$B!y(B") ("z^" "$B!z(B") | |
220 ("z7" "$B!}(B") ("z&" "$B!r(B") | |
221 ("z8" "$B!q(B") ("z*" "$B!_(B") | |
222 ("z9" "$B!i(B") ("z(" "$B!Z(B") | |
223 ("z0" "$B!j(B") ("z)" "$B![(B") | |
224 ("z-" "$B!A(B") ("z_" "$B!h(B") | |
225 ("z=" "$B!b(B") ("z+" "$B!^(B") | |
226 ("z\\" "$B!@(B") ("z|" "$B!B(B") | |
227 ("z`" "$B!-(B") ("z~" "$B!/(B") | |
228 | |
229 ("zq" "$B!T(B") ("zQ" "$B!R(B") | |
230 ("zw" "$B!U(B") ("zW" "$B!S(B") | |
231 ("zr" "$B!9(B") ("zR" "$B!8(B") | |
232 ("zt" "$B!:(B") ("zT" "$B!x(B") | |
233 ("zp" "$B")(B") ("zP" "$B",(B") | |
234 ("z[" "$B!X(B") ("z{" "$B!L(B") | |
235 ("z]" "$B!Y(B") ("z}" "$B!M(B") | |
236 | |
237 ("zs" "$B!3(B") ("zS" "$B!4(B") | |
238 ("zd" "$B!5(B") ("zD" "$B!6(B") | |
239 ("zf" "$B!7(B") ("zF" "$B"*(B") | |
240 ("zg" "$B!>(B") ("zG" "$B!=(B") | |
241 ("zh" "$B"+(B") | |
242 ("zj" "$B"-(B") | |
243 ("zk" "$B",(B") | |
244 ("zl" "$B"*(B") | |
245 ("z;" "$B!+(B") ("z:" "$B!,(B") | |
246 ("z\'" "$B!F(B") ("z\"" "$B!H(B") | |
247 | |
248 ("zx" ":-") ("zX" ":-)") | |
249 ("zc" "$B!;(B") ("zC" "$B!n(B") | |
250 ("zv" "$B"((B") ("zV" "$B!`(B") | |
251 ("zb" "$B!k(B") ("zB" "$B"+(B") | |
252 ("zn" "$B!l(B") ("zN" "$B"-(B") | |
253 ("zm" "$B!m(B") ("zM" "$B".(B") | |
254 ("z," "$B!E(B") ("z<" "$B!e(B") | |
255 ("z." "$B!D(B") ("z>" "$B!f(B") | |
256 ("z/" "$B!&(B") ("z?" "$B!g(B") | |
257 | |
258 ("\\\\" quail-japanese-self-insert-and-switch-to-alpha) | |
259 ("{{" quail-japanese-self-insert-and-switch-to-alpha) | |
260 ("}}" quail-japanese-self-insert-and-switch-to-alpha) | |
261 | |
262 ("qq" quail-japanese-switch-package) | |
263 ("qz" quail-japanese-switch-package) | |
264 | |
265 ) | |
266 | |
267 (quail-define-package | |
268 "japanese-ascii" "Japanese" "Aa" | |
269 nil | |
270 "Temporary ASCII input mode while using Quail package `japanese' | |
271 Type \"qq\" to go back to previous package." | |
272 nil t t) | |
273 | |
274 (quail-define-rules ("qq" quail-japanese-switch-package)) | |
275 | |
276 (quail-define-package | |
277 "japanese-zenkaku" "Japanese" "$B#A(B" | |
278 nil | |
279 "Japanese zenkaku alpha numeric character input method | |
280 ---- Special key bindings ---- | |
281 qq: toggle between `japanese-zenkaku' and `japanese-ascii' | |
282 qh: use `japanese' package, \"qz\" puts you back to `japanese-zenkaku' | |
283 " | |
284 nil t t) | |
285 | |
286 (quail-define-rules | |
287 | |
288 (" " "$B!!(B") ("!" "$B!*(B") ("\"" "$B!m(B") ("#" "$B!t(B") | |
289 ("$" "$B!p(B") ("%" "$B!s(B") ("&" "$B!u(B") ("'" "$B!l(B") | |
290 ("(" "$B!J(B") (")" "$B!K(B") ("*" "$B!v(B") ("+" "$B!\(B") | |
291 ("," "$B!$(B") ("-" "$B!](B") ("." "$B!%(B") ("/" "$B!?(B") | |
292 ("0" "$B#0(B") ("1" "$B#1(B") ("2" "$B#2(B") ("3" "$B#3(B") | |
293 ("4" "$B#4(B") ("5" "$B#5(B") ("6" "$B#6(B") ("7" "$B#7(B") | |
294 ("8" "$B#8(B") ("9" "$B#9(B") (":" "$B!'(B") (";" "$B!((B") | |
295 ("<" "$B!c(B") ("=" "$B!a(B") (">" "$B!d(B") ("?" "$B!)(B") | |
296 ("@" "$B!w(B") ("A" "$B#A(B") ("B" "$B#B(B") ("C" "$B#C(B") | |
297 ("D" "$B#D(B") ("E" "$B#E(B") ("F" "$B#F(B") ("G" "$B#G(B") | |
298 ("H" "$B#H(B") ("I" "$B#I(B") ("J" "$B#J(B") ("K" "$B#K(B") | |
299 ("L" "$B#L(B") ("M" "$B#M(B") ("N" "$B#N(B") ("O" "$B#O(B") | |
300 ("P" "$B#P(B") ("Q" "$B#Q(B") ("R" "$B#R(B") ("S" "$B#S(B") | |
301 ("T" "$B#T(B") ("U" "$B#U(B") ("V" "$B#V(B") ("W" "$B#W(B") | |
302 ("X" "$B#X(B") ("Y" "$B#Y(B") ("Z" "$B#Z(B") ("[" "$B!N(B") | |
303 ("\\" "$B!o(B") ("]" "$B!O(B") ("^" "$B!0(B") ("_" "$B!2(B") | |
304 ("`" "$B!F(B") ("a" "$B#a(B") ("b" "$B#b(B") ("c" "$B#c(B") | |
305 ("d" "$B#d(B") ("e" "$B#e(B") ("f" "$B#f(B") ("g" "$B#g(B") | |
306 ("h" "$B#h(B") ("i" "$B#i(B") ("j" "$B#j(B") ("k" "$B#k(B") | |
307 ("l" "$B#l(B") ("m" "$B#m(B") ("n" "$B#n(B") ("o" "$B#o(B") | |
308 ("p" "$B#p(B") ("q" "$B#q(B") ("r" "$B#r(B") ("s" "$B#s(B") | |
309 ("t" "$B#t(B") ("u" "$B#u(B") ("v" "$B#v(B") ("w" "$B#w(B") | |
310 ("x" "$B#x(B") ("y" "$B#y(B") ("z" "$B#z(B") ("{" "$B!P(B") | |
311 ("|" "$B!C(B") ("}" "$B!Q(B") ("~" "$B!A(B") | |
312 | |
313 ("qq" quail-japanese-switch-package) | |
314 ("qh" quail-japanese-switch-package) | |
315 ) | |
316 | |
317 (defun quail-japanese-hankaku-update-translation (control-flag) | |
318 (cond ((eq control-flag t) | |
319 (insert (japanese-hankaku quail-current-str)) | |
320 (quail-terminate-translation)) | |
321 ((null control-flag) | |
322 (insert (if quail-current-str | |
323 (japanese-hankaku quail-current-str) | |
324 quail-current-key))) | |
325 (t ; i.e. (numberp control-flag) | |
326 (cond ((= (aref quail-current-key 0) ?n) | |
327 (insert ?(I](B)) | |
328 ((= (aref quail-current-key 0) (aref quail-current-key 1)) | |
329 (insert ?(I/(B)) | |
330 (t | |
331 (insert (aref quail-current-key 0)))) | |
332 (setq unread-command-events | |
333 (list (aref quail-current-key control-flag))) | |
334 (quail-terminate-translation)))) | |
335 | |
336 | |
337 (quail-define-package | |
338 "japanese-hankaku-kana" | |
339 "Japanese" "(I1(B" | |
340 nil | |
341 "Japanese hankaku katakana input method by Roman transliteration | |
342 ---- Special key bindings ---- | |
343 qq: toggle between `japanese-hankaku-kana' and `japanese-ascii' | |
344 " | |
345 nil t t nil nil nil nil nil | |
346 'quail-japanese-hankaku-update-translation) | |
347 | |
348 ;; Use the same map as that of `japanese'. | |
349 (setcar (cdr (cdr quail-current-package)) | |
350 (nth 2 (assoc "japanese" quail-package-alist))) | |
351 | |
352 (quail-define-package | |
353 "japanese-hiragana" "Japanese" "$B$"(B" | |
354 nil | |
355 "Japanese hiragana input method by Roman transliteration" | |
356 nil t t nil nil nil nil nil | |
357 'quail-japanese-update-translation) | |
358 | |
359 ;; Use the same map as that of `japanese'. | |
360 (setcar (cdr (cdr quail-current-package)) | |
361 (nth 2 (assoc "japanese" quail-package-alist))) | |
362 | |
363 ;; Update Quail translation region while converting Hiragana to Katakana. | |
364 (defun quail-japanese-katakana-update-translation (control-flag) | |
365 (cond ((eq control-flag t) | |
366 (insert (japanese-katakana quail-current-str)) | |
367 (quail-terminate-translation)) | |
368 ((null control-flag) | |
369 (insert (if quail-current-str | |
370 (japanese-katakana quail-current-str) | |
371 quail-current-key))) | |
372 (t ; i.e. (numberp control-flag) | |
373 (cond ((= (aref quail-current-key 0) ?n) | |
374 (insert ?$B%s(B)) | |
375 ((= (aref quail-current-key 0) (aref quail-current-key 1)) | |
376 (insert ?$B%C(B)) | |
377 (t | |
378 (insert (aref quail-current-key 0)))) | |
379 (setq unread-command-events | |
380 (list (aref quail-current-key control-flag))) | |
381 (quail-terminate-translation)))) | |
382 | |
383 (quail-define-package | |
384 "japanese-katakana" "Japanese" "$B%"(B" | |
385 nil | |
386 "Japanese katakana input method by Roman transliteration" | |
387 nil t t nil nil nil nil nil | |
388 'quail-japanese-katakana-update-translation) | |
389 | |
390 ;; Use the same map as that of `japanese'. | |
391 (setcar (cdr (cdr quail-current-package)) | |
392 (nth 2 (assoc "japanese" quail-package-alist))) |