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