Revert last change following loadup.el change.
[emacs.git] / leim / quail / japanese.el
blobef9de406e5e239f95704d7d65f3fc1732aa26909
1 ;;; quail/japanese.el --- Quail package for inputting Japanese
3 ;; Copyright (C) 1997 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
6 ;; Keywords: multilingual, input method, Japanese
8 ;; This file is part of GNU Emacs.
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.
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.
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.
25 ;;; Code:
27 (require 'quail)
28 (require 'kkc)
30 (defvar quail-japanese-use-double-n nil
31 "If non-nil, use type \"nn\" to insert \e$B$s\e(B.")
33 ;; Update Quail translation region while considering Japanese bizarre
34 ;; translation rules.
35 (defun quail-japanese-update-translation (control-flag)
36 (if (null control-flag)
37 (setq quail-current-str
38 (if (/= (aref quail-current-key 0) ?q)
39 (or quail-current-str quail-current-key)
40 ""))
41 (if (integerp control-flag)
42 (if (= control-flag 0)
43 (setq quail-current-str (aref quail-current-key 0))
44 (cond ((= (aref quail-current-key 0) ?n)
45 (setq quail-current-str ?\e$B$s\e(B)
46 (if (and quail-japanese-use-double-n
47 (= (aref quail-current-key 1) ?n))
48 (setq control-flag t)))
49 ((= (aref quail-current-key 0) (aref quail-current-key 1))
50 (setq quail-current-str ?\e$B$C\e(B))
52 (setq quail-current-str (aref quail-current-key 0))))
53 (if (integerp control-flag)
54 (setq unread-command-events
55 (list (aref quail-current-key control-flag)))))))
56 control-flag)
58 ;; Flag to control the behavior of `quail-japanese-toggle-kana'.
59 (defvar quail-japanese-kana-state nil)
60 (make-variable-buffer-local 'quail-japanese-kana-state)
62 ;; Convert Hiragana <-> Katakana in the current translation region.
63 (defun quail-japanese-toggle-kana ()
64 (interactive)
65 (setq quail-translating nil)
66 (let ((start (overlay-start quail-conv-overlay))
67 (end (overlay-end quail-conv-overlay)))
68 (setq quail-japanese-kana-state
69 (if (eq last-command this-command)
70 (not quail-japanese-kana-state)))
71 (if quail-japanese-kana-state
72 (japanese-hiragana-region start end)
73 (japanese-katakana-region start end))
74 (setq quail-conversion-str
75 (buffer-substring (overlay-start quail-conv-overlay)
76 (overlay-end quail-conv-overlay)))))
78 ;; Convert Hiragana in the current translation region to Kanji by KKC
79 ;; (Kana Kanji Converter) utility.
80 (defun quail-japanese-kanji-kkc ()
81 (interactive)
82 (when (= (char-before (overlay-end quail-conv-overlay)) ?n)
83 ;; The last char is `n'. We had better convert it to `\e$B$s\e(B'
84 ;; before kana-kanji conversion.
85 (goto-char (overlay-end quail-conv-overlay))
86 (delete-char -1)
87 (insert ?\e$B$s\e(B))
88 (let* ((from (copy-marker (overlay-start quail-conv-overlay)))
89 (len (- (overlay-end quail-conv-overlay) from)))
90 (quail-delete-overlays)
91 (setq quail-current-str nil)
92 (unwind-protect
93 (let ((result (kkc-region from (+ from len))))
94 (move-overlay quail-conv-overlay from (point))
95 (setq quail-conversion-str (buffer-substring from (point)))
96 (if (= (+ from result) (point))
97 (setq quail-converting nil))
98 (setq quail-translating nil))
99 (set-marker from nil))))
101 (defun quail-japanese-self-insert-and-switch-to-alpha (key idx)
102 (quail-delete-region)
103 (setq unread-command-events (list (aref key (1- idx))))
104 (quail-japanese-switch-package "q" 1))
106 (defvar quail-japanese-switch-table
107 '((?z . "japanese-zenkaku")
108 (?k . "japanese-hankaku-kana")
109 (?h . "japanese")
110 (?q . ("japanese-ascii"))))
112 (defvar quail-japanese-package-saved nil)
113 (make-variable-buffer-local 'quail-japanese-package-saved)
114 (put 'quail-japanese-package-saved 'permanent-local t)
116 (defun quail-japanese-switch-package (key idx)
117 (quail-delete-region)
118 (setq quail-current-str nil
119 quail-converting nil
120 quail-conversion-str "")
121 (let ((pkg (cdr (assq (aref key (1- idx)) quail-japanese-switch-table))))
122 (if (null pkg)
123 (quail-error "No package to be switched")
124 (if (stringp pkg)
125 (activate-input-method pkg)
126 (if (string= (car pkg) current-input-method)
127 (if quail-japanese-package-saved
128 (activate-input-method quail-japanese-package-saved))
129 (setq quail-japanese-package-saved current-input-method)
130 (activate-input-method (car pkg))))))
131 (throw 'quail-tag nil))
133 ;; \e$B%m!<%^;zF~NO5Z$S2>L>4A;zJQ49$K$h$kF|K\8lF~NO%a%=%C%I\e(B
135 ;; \e$B$3$NF~NO%a%=%C%I$G$NF|K\8l$NF~NO$OFs$D$N%9%F!<%8!V%m!<%^;z2>L>JQ49!W\e(B
136 ;; \e$B$H!V2>L>4A;zJQ49!W$+$i$J$k!#:G=i$O%m!<%^;z2>L>JQ49$N%9%F!<%8$G!"%9\e(B
137 ;; \e$B%Z!<%9%-!<$r2!$9$3$H$K$h$j!"<!$N%9%F!<%8!V2>L>4A;zJQ49!W$X?J$`!#\e(B
139 ;; \e$B!V%m!<%^;z2>L>JQ49!W\e(B
141 ;; \e$BJ?2>L>$O>.J8;z%-!<!JNs!K$rBG$D$3$H$K$h$jF~NO!#6gFIE@!"3g8LN`$OBP1~\e(B
142 ;; \e$B$9$k1Q;z%-!<$rBG$D$3$H$K$h$jF~NO!#$=$NB>$N%7%s%\%k$O\e(B `z' \e$B$KB3$1$F2?\e(B
143 ;; \e$B$l$+$N%-!<$rBG$D$3$H$K$h$jF~NO!#2<$KA4$F$N2DG=$J%-!<%7!<%1%s%9%j%9\e(B
144 ;; \e$B%H%"%C%W$5$l$F$$$k!#F~NO$5$l$?J8;z$O2<@~$G<($5$l$k!#\e(B
146 ;; \e$B$5$i$K0J2<$N%-!<$GFCJL$J=hM}$r9T$&!#\e(B
148 ;; K \e$BJ?2>L>$rJR2>L>$K!"$"$k$$$OJR2>L>$rJ?2>L>$KJQ49\e(B
149 ;; qq \e$B$3$NF~NO%a%=%C%I$H\e(B `japanese-ascii' \e$BF~NO%a%=%C%I$r%H%0%k@ZBX\e(B
150 ;; qz `japanese-zenkaku' \e$BF~NO%a%=%C%I$K%7%U%H\e(B
151 ;; qh \e$B$HBG$F$P85$KLa$k\e(B
152 ;; RET \e$B8=:_$NF~NOJ8;zNs$r3NDj\e(B
153 ;; SPC \e$B2>L>4A;zJQ49$K?J$`\e(B
155 ;; `japanese-ascii' \e$BF~NO%a%=%C%I$O\e(B ASCII \e$BJ8;z$rF~NO$9$k$N$K;H$&!#$3$l\e(B
156 ;; \e$B$OF~NO%a%=%C%I$r%*%U$K$9$k$N$H$[$H$s$IF1$8$G$"$k!#0[$J$k$N$O\e(B qq \e$B$H\e(B
157 ;; \e$BBG$D$3$H$K$h$j!"\e(B`japanese' \e$BF~NO%a%=%C%I$KLa$l$kE@$G$"$k!#\e(B
159 ;; `japanese-zenkaku' \e$BF~NO%a%=%C%I$OA43Q1Q?t;z$rF~NO$9$k$N$K;H$&!#\e(B
161 ;; \e$B!V%m!<%^;z2>L>JQ49!W%9%F!<%8$G$N%-!<%7!<%1%s%9$N%j%9%H$O:G8e$KIU$1\e(B
162 ;; \e$B$F$"$k!#\e(B
164 ;; \e$B!V2>L>4A;zJQ49!W\e(B
166 ;; \e$B$3$N%9%F!<%8$G$O!"A0%9%F!<%8$GF~NO$5$l$?J8;zNs$r2>L>4A;zJQ49$9$k!#\e(B
167 ;; \e$BJQ49$5$l$?J8;zNs$O!"CmL\J8@a!JH?E>I=<(!K$H;D$j$NF~NO!J2<@~I=<(!K$K\e(B
168 ;; \e$BJ,$1$i$l$k!#CmL\J8@a$KBP$7$F$O0J2<$N%3%^%s%I$,;H$($k!#\e(B
170 ;; SPC, C-n kkc-next
171 ;; \e$B<!$NJQ498uJd$rI=<(\e(B
172 ;; kkc-show-conversion-list-count \e$B0J>eB3$1$FBG$F$P!"JQ498uJd%j%9\e(B
173 ;; \e$B%H$r%(%3!<%(%j%"$KI=<(\e(B
174 ;; C-p kkc-prev
175 ;; \e$BA0$NJQ498uJd$rI=<(\e(B
176 ;; kkc-show-conversion-list-count \e$B0J>eB3$1$FBG$F$P!"JQ498uJd%j%9\e(B
177 ;; \e$B%H$r%(%3!<%(%j%"$KI=<(\e(B
178 ;; l kkc-show-conversion-list-or-next-group
179 ;; \e$B:G9b#1#08D$^$G$NJQ498uJd$r%(%3!<%(%j%"$KI=<(!#\e(B
180 ;; \e$BB3$1$FBG$?$l$l$P!"<!$N#1#08uJd$rI=<(!#\e(B
181 ;; L kkc-show-conversion-list-or-prev-group
182 ;; \e$B:G9b#1#08D$^$G$NJQ498uJd$r%(%3!<%(%j%"$KI=<(!#\e(B
183 ;; \e$BB3$1$FBG$?$l$l$P!"A0$N#1#08uJd$rI=<(!#\e(B
184 ;; 0..9 kkc-select-from-list
185 ;; \e$BBG$?$l$??t;z$NJQ498uJd$rA*Br\e(B
186 ;; H kkc-hiragana
187 ;; \e$BCmL\J8@a$rJ?2>L>$KJQ49\e(B
188 ;; K kkc-katakana
189 ;; \e$BCmL\J8@a$rJR2>L>$KJQ49\e(B
190 ;; C-o kkc-longer
191 ;; \e$BCmL\J8@a$r8e$m$K0lJ8;z?-$P$9\e(B
192 ;; C-i kkc-shorter
193 ;; \e$BCmL\J8@a$r8e$m$+$i0lJ8;z=L$a$k\e(B
194 ;; C-f kkc-next-phrase
195 ;; \e$BCmL\J8@a$r3NDj$5$;$k!#$b$7;D$j$NF~NO$,$^$@$"$l$P!":G=i$NJ8@a$r\e(B
196 ;; \e$BA*Br$7!"$=$l$rCmL\J8@a$H$7!"$=$N:G=i$NJQ498uJd$rI=<($9$k!#\e(B
197 ;; DEL, C-c kkc-cancel
198 ;; \e$B2>L>4A;zJQ49$r%-%c%s%;%k$7!"%m!<%^;z2>L>JQ49$N%9%F!<%8$KLa$k!#\e(B
199 ;; return kkc-terminate
200 ;; \e$BA4J8@a$r3NDj$5$;$k!#\e(B
201 ;; C-SPC, C-@ kkc-first-char-only
202 ;; \e$B:G=i$NJ8;z$r3NDj$5$;!";D$j$O:o=|$9$k!#\e(B
203 ;; C-h kkc-help
204 ;; \e$B$3$l$i$N%-!<%P%$%s%I$N%j%9%H$rI=<($9$k!#$"\e(B
206 (quail-define-package
207 "japanese" "Japanese" "A\e$B$"\e(B"
209 "Japanese input method by Roman transliteration and Kana-Kanji conversion.
211 When you use this input method, text entry proceeds in two stages:
212 Roman-Kana transliteration and Kana-Kanji conversion. When you start
213 to enter text, you are in the first stage, Roman-Kana transliteration.
214 Type SPC to proceed to the next stage, Kana-Kanji conversion.
216 :: Roman-Kana transliteration ::
218 You can input any Hiragana character as a sequence of lower-case
219 letters, Japanese punctuation characters by typing punctuation keys,
220 Japanese symbols by typing `z' followed by another key. See below for
221 a list of all available sequences. The characters you input are
222 underlined.
224 In addition, the following keys provide special effects:
226 K Change Hiragana to Katakana or Katakana to Hiragana.
227 qq Toggle between this input method and the input method `japanese-ascii'.
228 qz Shift to the input method `japanese-zenkaku'.
229 Typing \"qh\" will put you back to this input method.
230 RET Accept the current character sequence.
231 SPC Proceed to the next stage, Kana-Kanji conversion.
233 The input method `japanese-ascii' is used to enter ASCII characters.
234 This is almost the same as turning off the input method. The only
235 difference is that typing `qq' will put you back into the Japanese
236 input method.
238 The input method `japanese-zenkaku' is used to enter full width
239 JISX0208 characters corresponding to typed ASCII characters.
241 List of the all key sequences for Roman-Kana transliteration is shown
242 at the tail.
244 :: Kana-Kanji conversion ::
246 You can convert the current Japanese characters (underlined) to
247 Kana-Kanji mixed text. In this stage, the converted text is divided
248 into two parts, the current phrase (highlighted) and the remaining
249 input (underlined). The following commands can be used on the
250 current phrase.
252 SPC, C-n kkc-next
253 Show the next candidate for the current phrase.
254 If successively typed `kkc-show-conversion-list-count' times,
255 conversion candidates are shown in the echo area.
256 C-p kkc-prev
257 Show the previous candidate for the current phrase.
258 If successively typed `kkc-show-conversion-list-count' times,
259 conversion candidates are shown in the echo area.
260 l kkc-show-conversion-list-or-next-group
261 Show at most 10 candidates for the current phrase in echo area.
262 If typed repeatedly, show the next 10 candidates.
263 L kkc-show-conversion-list-or-prev-group
264 Show at most 10 candidates for the current phrase in echo area.
265 If typed repeatedly, show the previous 10 candidates.
266 0..9 kkc-select-from-list
267 Select a candidate corresponding to the typed number.
268 H kkc-hiragana
269 Convert the current phrase to Hiragana
270 K kkc-katakana
271 Convert the current phrase to Katakana
272 C-o kkc-longer
273 Extend the current phrase; pull in the first character of
274 the remaining input.
275 C-i kkc-shorter
276 Contract the current phrase; drop its last character
277 back into the remaining input.
278 C-f kkc-next-phrase
279 Accept the current phrase. If there remains input, select
280 the first phrase as the current one, and show the first
281 candidate for the conversion.
282 DEL, C-c kkc-cancel
283 Cancel the conversion, shift back to the Roman-Kana
284 transliteration.
285 return kkc-terminate
286 Accept the whole conversion.
287 C-SPC, C-@ kkc-first-char-only
288 Accept the first character of the current conversion,
289 delete the remaining input.
290 C-h kkc-help
291 List these key bindings.
293 nil t t nil nil nil nil nil
294 'quail-japanese-update-translation
295 '(("K" . quail-japanese-toggle-kana)
296 (" " . quail-japanese-kanji-kkc)
297 ("\C-m" . quail-no-conversion)
298 ([return] . quail-no-conversion))
301 (quail-define-rules
303 ( "a" "\e$B$"\e(B") ( "i" "\e$B$$\e(B") ( "u" "\e$B$&\e(B") ( "e" "\e$B$(\e(B") ( "o" "\e$B$*\e(B")
304 ("ka" "\e$B$+\e(B") ("ki" "\e$B$-\e(B") ("ku" "\e$B$/\e(B") ("ke" "\e$B$1\e(B") ("ko" "\e$B$3\e(B")
305 ("sa" "\e$B$5\e(B") ("si" "\e$B$7\e(B") ("su" "\e$B$9\e(B") ("se" "\e$B$;\e(B") ("so" "\e$B$=\e(B")
306 ("ta" "\e$B$?\e(B") ("ti" "\e$B$A\e(B") ("tu" "\e$B$D\e(B") ("te" "\e$B$F\e(B") ("to" "\e$B$H\e(B")
307 ("na" "\e$B$J\e(B") ("ni" "\e$B$K\e(B") ("nu" "\e$B$L\e(B") ("ne" "\e$B$M\e(B") ("no" "\e$B$N\e(B")
308 ("ha" "\e$B$O\e(B") ("hi" "\e$B$R\e(B") ("hu" "\e$B$U\e(B") ("he" "\e$B$X\e(B") ("ho" "\e$B$[\e(B")
309 ("ma" "\e$B$^\e(B") ("mi" "\e$B$_\e(B") ("mu" "\e$B$`\e(B") ("me" "\e$B$a\e(B") ("mo" "\e$B$b\e(B")
310 ("ya" "\e$B$d\e(B") ("yu" "\e$B$f\e(B") ("yo" "\e$B$h\e(B")
311 ("ra" "\e$B$i\e(B") ("ri" "\e$B$j\e(B") ("ru" "\e$B$k\e(B") ("re" "\e$B$l\e(B") ("ro" "\e$B$m\e(B")
312 ("la" "\e$B$i\e(B") ("li" "\e$B$j\e(B") ("lu" "\e$B$k\e(B") ("le" "\e$B$l\e(B") ("lo" "\e$B$m\e(B")
313 ("wa" "\e$B$o\e(B") ("wi" "\e$B$p\e(B") ("wu" "\e$B$&\e(B") ("we" "\e$B$q\e(B") ("wo" "\e$B$r\e(B")
314 ("n'" "\e$B$s\e(B")
315 ("ga" "\e$B$,\e(B") ("gi" "\e$B$.\e(B") ("gu" "\e$B$0\e(B") ("ge" "\e$B$2\e(B") ("go" "\e$B$4\e(B")
316 ("za" "\e$B$6\e(B") ("zi" "\e$B$8\e(B") ("zu" "\e$B$:\e(B") ("ze" "\e$B$<\e(B") ("zo" "\e$B$>\e(B")
317 ("da" "\e$B$@\e(B") ("di" "\e$B$B\e(B") ("du" "\e$B$E\e(B") ("de" "\e$B$G\e(B") ("do" "\e$B$I\e(B")
318 ("ba" "\e$B$P\e(B") ("bi" "\e$B$S\e(B") ("bu" "\e$B$V\e(B") ("be" "\e$B$Y\e(B") ("bo" "\e$B$\\e(B")
319 ("pa" "\e$B$Q\e(B") ("pi" "\e$B$T\e(B") ("pu" "\e$B$W\e(B") ("pe" "\e$B$Z\e(B") ("po" "\e$B$]\e(B")
321 ("kya" ["\e$B$-$c\e(B"]) ("kyu" ["\e$B$-$e\e(B"]) ("kye" ["\e$B$-$'\e(B"]) ("kyo" ["\e$B$-$g\e(B"])
322 ("sya" ["\e$B$7$c\e(B"]) ("syu" ["\e$B$7$e\e(B"]) ("sye" ["\e$B$7$'\e(B"]) ("syo" ["\e$B$7$g\e(B"])
323 ("sha" ["\e$B$7$c\e(B"]) ("shu" ["\e$B$7$e\e(B"]) ("she" ["\e$B$7$'\e(B"]) ("sho" ["\e$B$7$g\e(B"])
324 ("cha" ["\e$B$A$c\e(B"]) ("chu" ["\e$B$A$e\e(B"]) ("che" ["\e$B$A$'\e(B"]) ("cho" ["\e$B$A$g\e(B"])
325 ("tya" ["\e$B$A$c\e(B"]) ("tyu" ["\e$B$A$e\e(B"]) ("tye" ["\e$B$A$'\e(B"]) ("tyo" ["\e$B$A$g\e(B"])
326 ("nya" ["\e$B$K$c\e(B"]) ("nyu" ["\e$B$K$e\e(B"]) ("nye" ["\e$B$K$'\e(B"]) ("nyo" ["\e$B$K$g\e(B"])
327 ("hya" ["\e$B$R$c\e(B"]) ("hyu" ["\e$B$R$e\e(B"]) ("hye" ["\e$B$R$'\e(B"]) ("hyo" ["\e$B$R$g\e(B"])
328 ("mya" ["\e$B$_$c\e(B"]) ("myu" ["\e$B$_$e\e(B"]) ("mye" ["\e$B$_$'\e(B"]) ("myo" ["\e$B$_$g\e(B"])
329 ("rya" ["\e$B$j$c\e(B"]) ("ryu" ["\e$B$j$e\e(B"]) ("rye" ["\e$B$j$'\e(B"]) ("ryo" ["\e$B$j$g\e(B"])
330 ("lya" ["\e$B$j$c\e(B"]) ("lyu" ["\e$B$j$e\e(B"]) ("lye" ["\e$B$j$'\e(B"]) ("lyo" ["\e$B$j$g\e(B"])
331 ("gya" ["\e$B$.$c\e(B"]) ("gyu" ["\e$B$.$e\e(B"]) ("gye" ["\e$B$.$'\e(B"]) ("gyo" ["\e$B$.$g\e(B"])
332 ("zya" ["\e$B$8$c\e(B"]) ("zyu" ["\e$B$8$e\e(B"]) ("zye" ["\e$B$8$'\e(B"]) ("zyo" ["\e$B$8$g\e(B"])
333 ("jya" ["\e$B$8$c\e(B"]) ("jyu" ["\e$B$8$e\e(B"]) ("jye" ["\e$B$8$'\e(B"]) ("jyo" ["\e$B$8$g\e(B"])
334 ( "ja" ["\e$B$8$c\e(B"]) ( "ju" ["\e$B$8$e\e(B"]) ( "je" ["\e$B$8$'\e(B"]) ( "jo" ["\e$B$8$g\e(B"])
335 ("bya" ["\e$B$S$c\e(B"]) ("byu" ["\e$B$S$e\e(B"]) ("bye" ["\e$B$S$'\e(B"]) ("byo" ["\e$B$S$g\e(B"])
336 ("pya" ["\e$B$T$c\e(B"]) ("pyu" ["\e$B$T$e\e(B"]) ("pye" ["\e$B$T$'\e(B"]) ("pyo" ["\e$B$T$g\e(B"])
338 ("kwa" ["\e$B$/$n\e(B"]) ("kwi" ["\e$B$/$#\e(B"]) ("kwe" ["\e$B$/$'\e(B"]) ("kwo" ["\e$B$/$)\e(B"])
339 ("tsa" ["\e$B$D$!\e(B"]) ("tsi" ["\e$B$D$#\e(B"]) ("tse" ["\e$B$D$'\e(B"]) ("tso" ["\e$B$D$)\e(B"])
340 ( "fa" ["\e$B$U$!\e(B"]) ( "fi" ["\e$B$U$#\e(B"]) ( "fe" ["\e$B$U$'\e(B"]) ( "fo" ["\e$B$U$)\e(B"])
341 ("gwa" ["\e$B$0$n\e(B"]) ("gwi" ["\e$B$0$#\e(B"]) ("gwe" ["\e$B$0$'\e(B"]) ("gwo" ["\e$B$0$)\e(B"])
343 ("dyi" ["\e$B$G$#\e(B"]) ("dyu" ["\e$B$I$%\e(B"]) ("dye" ["\e$B$G$'\e(B"]) ("dyo" ["\e$B$I$)\e(B"])
344 ("xwi" ["\e$B$&$#\e(B"]) ("xwe" ["\e$B$&$'\e(B"]) ("xwo" ["\e$B$&$)\e(B"])
346 ("shi" "\e$B$7\e(B") ("tyi" ["\e$B$F$#\e(B"]) ("chi" "\e$B$A\e(B") ("tsu" "\e$B$D\e(B") ("ji" "\e$B$8\e(B")
347 ("fu" "\e$B$U\e(B")
348 ("ye" ["\e$B$$$'\e(B"])
350 ("va" ["\e$B%t$!\e(B"]) ("vi" ["\e$B%t$#\e(B"]) ("vu" "\e$B%t\e(B") ("ve" ["\e$B%t$'\e(B"]) ("vo" ["\e$B%t$)\e(B"])
352 ("xa" "\e$B$!\e(B") ("xi" "\e$B$#\e(B") ("xu" "\e$B$%\e(B") ("xe" "\e$B$'\e(B") ("xo" "\e$B$)\e(B")
353 ("xtu" "\e$B$C\e(B") ("xya" "\e$B$c\e(B") ("xyu" "\e$B$e\e(B") ("xyo" "\e$B$g\e(B") ("xwa" "\e$B$n\e(B")
354 ("xka" "\e$B%u\e(B") ("xke" "\e$B%v\e(B")
356 ("1" "\e$B#1\e(B") ("2" "\e$B#2\e(B") ("3" "\e$B#3\e(B") ("4" "\e$B#4\e(B") ("5" "\e$B#5\e(B")
357 ("6" "\e$B#6\e(B") ("7" "\e$B#7\e(B") ("8" "\e$B#8\e(B") ("9" "\e$B#9\e(B") ("0" "\e$B#0\e(B")
359 ("!" "\e$B!*\e(B") ("@" "\e$B!w\e(B") ("#" "\e$B!t\e(B") ("$" "\e$B!p\e(B") ("%" "\e$B!s\e(B")
360 ("^" "\e$B!0\e(B") ("&" "\e$B!u\e(B") ("*" "\e$B!v\e(B") ("(" "\e$B!J\e(B") (")" "\e$B!K\e(B")
361 ("-" "\e$B!<\e(B") ("=" "\e$B!a\e(B") ("`" "\e$B!.\e(B") ("\\" "\e$B!o\e(B") ("|" "\e$B!C\e(B")
362 ("_" "\e$B!2\e(B") ("+" "\e$B!\\e(B") ("~" "\e$B!1\e(B") ("[" "\e$B!V\e(B") ("]" "\e$B!W\e(B")
363 ("{" "\e$B!P\e(B") ("}" "\e$B!Q\e(B") (":" "\e$B!'\e(B") (";" "\e$B!(\e(B") ("\"" "\e$B!I\e(B")
364 ("'" "\e$B!G\e(B") ("." "\e$B!#\e(B") ("," "\e$B!"\e(B") ("<" "\e$B!c\e(B") (">" "\e$B!d\e(B")
365 ("?" "\e$B!)\e(B") ("/" "\e$B!?\e(B")
367 ("z1" "\e$B!{\e(B") ("z!" "\e$B!|\e(B")
368 ("z2" "\e$B"&\e(B") ("z@" "\e$B"'\e(B")
369 ("z3" "\e$B"$\e(B") ("z#" "\e$B"%\e(B")
370 ("z4" "\e$B""\e(B") ("z$" "\e$B"#\e(B")
371 ("z5" "\e$B!~\e(B") ("z%" "\e$B"!\e(B")
372 ("z6" "\e$B!y\e(B") ("z^" "\e$B!z\e(B")
373 ("z7" "\e$B!}\e(B") ("z&" "\e$B!r\e(B")
374 ("z8" "\e$B!q\e(B") ("z*" "\e$B!_\e(B")
375 ("z9" "\e$B!i\e(B") ("z(" "\e$B!Z\e(B")
376 ("z0" "\e$B!j\e(B") ("z)" "\e$B![\e(B")
377 ("z-" "\e$B!A\e(B") ("z_" "\e$B!h\e(B")
378 ("z=" "\e$B!b\e(B") ("z+" "\e$B!^\e(B")
379 ("z\\" "\e$B!@\e(B") ("z|" "\e$B!B\e(B")
380 ("z`" "\e$B!-\e(B") ("z~" "\e$B!/\e(B")
382 ("zq" "\e$B!T\e(B") ("zQ" "\e$B!R\e(B")
383 ("zw" "\e$B!U\e(B") ("zW" "\e$B!S\e(B")
384 ("zr" "\e$B!9\e(B") ("zR" "\e$B!8\e(B")
385 ("zt" "\e$B!:\e(B") ("zT" "\e$B!x\e(B")
386 ("zp" "\e$B")\e(B") ("zP" "\e$B",\e(B")
387 ("z[" "\e$B!X\e(B") ("z{" "\e$B!L\e(B")
388 ("z]" "\e$B!Y\e(B") ("z}" "\e$B!M\e(B")
390 ("zs" "\e$B!3\e(B") ("zS" "\e$B!4\e(B")
391 ("zd" "\e$B!5\e(B") ("zD" "\e$B!6\e(B")
392 ("zf" "\e$B!7\e(B") ("zF" "\e$B"*\e(B")
393 ("zg" "\e$B!>\e(B") ("zG" "\e$B!=\e(B")
394 ("zh" "\e$B"+\e(B")
395 ("zj" "\e$B"-\e(B")
396 ("zk" "\e$B",\e(B")
397 ("zl" "\e$B"*\e(B")
398 ("z;" "\e$B!+\e(B") ("z:" "\e$B!,\e(B")
399 ("z\'" "\e$B!F\e(B") ("z\"" "\e$B!H\e(B")
401 ("zx" [":-"]) ("zX" [":-)"])
402 ("zc" "\e$B!;\e(B") ("zC" "\e$B!n\e(B")
403 ("zv" "\e$B"(\e(B") ("zV" "\e$B!`\e(B")
404 ("zb" "\e$B!k\e(B") ("zB" "\e$B"+\e(B")
405 ("zn" "\e$B!l\e(B") ("zN" "\e$B"-\e(B")
406 ("zm" "\e$B!m\e(B") ("zM" "\e$B".\e(B")
407 ("z," "\e$B!E\e(B") ("z<" "\e$B!e\e(B")
408 ("z." "\e$B!D\e(B") ("z>" "\e$B!f\e(B")
409 ("z/" "\e$B!&\e(B") ("z?" "\e$B!g\e(B")
411 ("\\\\" quail-japanese-self-insert-and-switch-to-alpha)
412 ("{{" quail-japanese-self-insert-and-switch-to-alpha)
413 ("}}" quail-japanese-self-insert-and-switch-to-alpha)
415 ("qq" quail-japanese-switch-package)
416 ("qz" quail-japanese-switch-package)
420 (quail-define-package
421 "japanese-ascii" "Japanese" "Aa"
423 "Temporary ASCII input mode used within the input method `japanese'.
424 Type \"qq\" to go back to previous input method."
425 nil t t)
427 (quail-define-rules ("qq" quail-japanese-switch-package))
429 (quail-define-package
430 "japanese-zenkaku" "Japanese" "\e$B#A\e(B"
432 "Japanese zenkaku alpha numeric character input method.
433 ---- Special key bindings ----
434 qq: toggle between this input method and the input method `japanese-ascii'.
435 qh: shift to the input method `japanese',
436 typing \"qz\" puts you back to this input method.
438 nil t t)
440 (quail-define-rules
442 (" " "\e$B!!\e(B") ("!" "\e$B!*\e(B") ("\"" "\e$B!m\e(B") ("#" "\e$B!t\e(B")
443 ("$" "\e$B!p\e(B") ("%" "\e$B!s\e(B") ("&" "\e$B!u\e(B") ("'" "\e$B!l\e(B")
444 ("(" "\e$B!J\e(B") (")" "\e$B!K\e(B") ("*" "\e$B!v\e(B") ("+" "\e$B!\\e(B")
445 ("," "\e$B!$\e(B") ("-" "\e$B!]\e(B") ("." "\e$B!%\e(B") ("/" "\e$B!?\e(B")
446 ("0" "\e$B#0\e(B") ("1" "\e$B#1\e(B") ("2" "\e$B#2\e(B") ("3" "\e$B#3\e(B")
447 ("4" "\e$B#4\e(B") ("5" "\e$B#5\e(B") ("6" "\e$B#6\e(B") ("7" "\e$B#7\e(B")
448 ("8" "\e$B#8\e(B") ("9" "\e$B#9\e(B") (":" "\e$B!'\e(B") (";" "\e$B!(\e(B")
449 ("<" "\e$B!c\e(B") ("=" "\e$B!a\e(B") (">" "\e$B!d\e(B") ("?" "\e$B!)\e(B")
450 ("@" "\e$B!w\e(B") ("A" "\e$B#A\e(B") ("B" "\e$B#B\e(B") ("C" "\e$B#C\e(B")
451 ("D" "\e$B#D\e(B") ("E" "\e$B#E\e(B") ("F" "\e$B#F\e(B") ("G" "\e$B#G\e(B")
452 ("H" "\e$B#H\e(B") ("I" "\e$B#I\e(B") ("J" "\e$B#J\e(B") ("K" "\e$B#K\e(B")
453 ("L" "\e$B#L\e(B") ("M" "\e$B#M\e(B") ("N" "\e$B#N\e(B") ("O" "\e$B#O\e(B")
454 ("P" "\e$B#P\e(B") ("Q" "\e$B#Q\e(B") ("R" "\e$B#R\e(B") ("S" "\e$B#S\e(B")
455 ("T" "\e$B#T\e(B") ("U" "\e$B#U\e(B") ("V" "\e$B#V\e(B") ("W" "\e$B#W\e(B")
456 ("X" "\e$B#X\e(B") ("Y" "\e$B#Y\e(B") ("Z" "\e$B#Z\e(B") ("[" "\e$B!N\e(B")
457 ("\\" "\e$B!o\e(B") ("]" "\e$B!O\e(B") ("^" "\e$B!0\e(B") ("_" "\e$B!2\e(B")
458 ("`" "\e$B!F\e(B") ("a" "\e$B#a\e(B") ("b" "\e$B#b\e(B") ("c" "\e$B#c\e(B")
459 ("d" "\e$B#d\e(B") ("e" "\e$B#e\e(B") ("f" "\e$B#f\e(B") ("g" "\e$B#g\e(B")
460 ("h" "\e$B#h\e(B") ("i" "\e$B#i\e(B") ("j" "\e$B#j\e(B") ("k" "\e$B#k\e(B")
461 ("l" "\e$B#l\e(B") ("m" "\e$B#m\e(B") ("n" "\e$B#n\e(B") ("o" "\e$B#o\e(B")
462 ("p" "\e$B#p\e(B") ("q" "\e$B#q\e(B") ("r" "\e$B#r\e(B") ("s" "\e$B#s\e(B")
463 ("t" "\e$B#t\e(B") ("u" "\e$B#u\e(B") ("v" "\e$B#v\e(B") ("w" "\e$B#w\e(B")
464 ("x" "\e$B#x\e(B") ("y" "\e$B#y\e(B") ("z" "\e$B#z\e(B") ("{" "\e$B!P\e(B")
465 ("|" "\e$B!C\e(B") ("}" "\e$B!Q\e(B") ("~" "\e$B!A\e(B")
467 ("qq" quail-japanese-switch-package)
468 ("qh" quail-japanese-switch-package)
471 (defun quail-japanese-hankaku-update-translation (control-flag)
472 (setq control-flag
473 (quail-japanese-update-translation control-flag))
474 (if (or (and (stringp quail-current-str)
475 (> (length quail-current-str) 0))
476 (integerp quail-current-str))
477 (setq quail-current-str (japanese-hankaku quail-current-str)))
478 control-flag)
480 (quail-define-package
481 "japanese-hankaku-kana"
482 "Japanese" "\e(I1\e(B"
484 "Japanese hankaku katakana input method by Roman transliteration.
485 ---- Special key bindings ----
486 qq: toggle between this input method and the input method `japanese-ascii'.
488 nil t t nil nil nil nil nil
489 'quail-japanese-hankaku-update-translation)
491 ;; Use the same map as that of `japanese'.
492 (setcar (cdr (cdr quail-current-package))
493 (nth 2 (assoc "japanese" quail-package-alist)))
495 (quail-define-package
496 "japanese-hiragana" "Japanese" "\e$B$"\e(B"
498 "Japanese hiragana input method by Roman transliteration."
499 nil t t nil nil nil nil nil
500 'quail-japanese-update-translation)
502 ;; Use the same map as that of `japanese'.
503 (setcar (cdr (cdr quail-current-package))
504 (nth 2 (assoc "japanese" quail-package-alist)))
506 ;; Update Quail translation region while converting Hiragana to Katakana.
507 (defun quail-japanese-katakana-update-translation (control-flag)
508 (setq control-flag
509 (quail-japanese-update-translation control-flag))
510 (if (or (and (stringp quail-current-str)
511 (> (length quail-current-str) 0))
512 (integerp quail-current-str))
513 (setq quail-current-str (japanese-katakana quail-current-str)))
514 control-flag)
516 (quail-define-package
517 "japanese-katakana" "Japanese" "\e$B%"\e(B"
519 "Japanese katakana input method by Roman transliteration."
520 nil t t nil nil nil nil nil
521 'quail-japanese-katakana-update-translation)
523 ;; Use the same map as that of `japanese'.
524 (setcar (cdr (cdr quail-current-package))
525 (nth 2 (assoc "japanese" quail-package-alist)))