Mercurial > emacs
annotate lisp/international/titdic-cnv.el @ 109641:944013d7f38b
src/ChangeLog: Fix entry.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Fri, 06 Aug 2010 02:44:56 +0200 |
parents | 1d1d5d9bd884 |
children | cda2045a5ee8 |
rev | line source |
---|---|
46670 | 1 ;;; titdic-cnv.el --- convert cxterm dictionary (TIT format) to Quail package -*- coding:iso-2022-7bit; -*- |
17052 | 2 |
74544 | 3 ;; Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, |
106815 | 4 ;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
74605
6ee41fdd69ff
Update AIST copyright years.
Kenichi Handa <handa@m17n.org>
parents:
74544
diff
changeset
|
5 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
106815 | 6 ;; 2005, 2006, 2007, 2008, 2009, 2010 |
62274 | 7 ;; National Institute of Advanced Industrial Science and Technology (AIST) |
8 ;; Registration Number H14PRO021 | |
89483 | 9 ;; Copyright (C) 2003 |
10 ;; National Institute of Advanced Industrial Science and Technology (AIST) | |
11 ;; Registration Number H13PRO009 | |
17052 | 12 |
13 ;; Keywords: Quail, TIT, cxterm | |
14 | |
15 ;; This file is part of GNU Emacs. | |
16 | |
94664
889bc336b89b
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
17 ;; GNU Emacs is free software: you can redistribute it and/or modify |
17052 | 18 ;; it under the terms of the GNU General Public License as published by |
94664
889bc336b89b
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
19 ;; the Free Software Foundation, either version 3 of the License, or |
889bc336b89b
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
20 ;; (at your option) any later version. |
17052 | 21 |
22 ;; GNU Emacs is distributed in the hope that it will be useful, | |
23 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
24 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
25 ;; GNU General Public License for more details. | |
26 | |
27 ;; You should have received a copy of the GNU General Public License | |
94664
889bc336b89b
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
28 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
17052 | 29 |
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37888
diff
changeset
|
30 ;;; Commentary: |
17052 | 31 |
18555 | 32 ;; Convert cxterm dictionary (of TIT format) to quail-package. |
17052 | 33 ;; |
34 ;; Usage (within Emacs): | |
18555 | 35 ;; M-x titdic-convert<CR>CXTERM-DICTIONARY-NAME<CR> |
17052 | 36 ;; Usage (from shell): |
18555 | 37 ;; % emacs -batch -l titdic-cnv -f batch-titdic-convert\ |
17052 | 38 ;; [-dir DIR] [DIR | FILE] ... |
39 ;; | |
40 ;; When you run titdic-convert within Emacs, you have a chance to | |
41 ;; modify arguments of `quail-define-package' before saving the | |
42 ;; converted file. For instance, you are likely to modify TITLE, | |
43 ;; DOCSTRING, and KEY-BINDINGS. | |
44 | |
18555 | 45 ;; Cxterm dictionary file (*.tit) is a line-oriented text (English, |
17052 | 46 ;; Chinese, Japanese, and Korean) file. The whole file contains of |
47 ;; two parts, the definition part (`header' here after) followed by | |
48 ;; the dictionary part (`body' here after). All lines begin with | |
49 ;; leading '#' are ignored. | |
50 ;; | |
51 ;; Each line in the header part has two fields, KEY and VALUE. These | |
52 ;; fields are separated by one or more white characters. | |
53 ;; | |
54 ;; Each line in the body part has two fields, KEYSEQ and TRANSLATIONS. | |
55 ;; These fields are separated by one or more white characters. | |
56 ;; | |
57 ;; See the manual page of `tit2cit' of cxterm distribution for more | |
58 ;; detail. | |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
59 ;; |
37261 | 60 ;; Near the end of this file, we also have a few other tools to convert |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
61 ;; miscellaneous dictionaries. |
17052 | 62 |
63 ;;; Code: | |
64 | |
65 (require 'quail) | |
66 | |
18555 | 67 ;; List of values of key "ENCODE:" and the corresponding Emacs |
17052 | 68 ;; coding-system and language environment name. |
69 (defvar tit-encode-list | |
17098
8917133b7e82
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
70 '(("GB" euc-china "Chinese-GB") |
8917133b7e82
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
71 ("BIG5" cn-big5 "Chinese-BIG5") |
8917133b7e82
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
72 ("JIS" euc-japan "Japanese") |
18555 | 73 ("KS" euc-kr "Korean"))) |
74 | |
31548
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
75 ;; Alist of input method names and the corresponding title and extra |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
76 ;; docstring. For each of input method generated from TIT dictionary, |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
77 ;; a docstring is automatically generated from the comments in the |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
78 ;; dictionary. The extra docstring in this alist is to add more |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
79 ;; information. |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
80 ;; The command describe-input-method shows the automatically generated |
46670 | 81 ;; docstring, then an extra docstring while replacing the form \<VAR> |
31548
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
82 ;; by the value of variable VAR. For instance, the form |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
83 ;; \<quail-translation-docstring> is replaced by a description about |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
84 ;; how to select a translation from a list of candidates. |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
85 |
31425
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
86 (defvar quail-cxterm-package-ext-info |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
87 '(("chinese-4corner" "$(0(?-F(B") |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
88 ("chinese-array30" "$(0#R#O(B") |
31548
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
89 ("chinese-ccdospy" "$AKuF4(B" |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
90 "Pinyin base input method for Chinese charset GB2312 \(`chinese-gb2312'). |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
91 |
46670 | 92 Pinyin is the standard Roman transliteration method for Chinese. |
31548
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
93 For the detail of Pinyin system, see the documentation of the input |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
94 method `chinese-py'. |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
95 |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
96 This input method works almost the same way as `chinese-py'. The |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
97 difference is that you type a single key for these Pinyin spelling. |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
98 Pinyin: zh en eng ang ch an ao ai ong sh ing yu($A(9(B) |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
99 keyseq: a f g h i j k l s u y v |
46670 | 100 For example: |
31548
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
101 Chinese: $A0!(B $A9{(B $AVP(B $AND(B $A9b(B $ASq(B $AH+(B |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
102 Pinyin: a guo zhong wen guang yu quan |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
103 Keyseq: a1 guo4 as1 wf4 guh1 yu..6 qvj6 |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
104 |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
105 \\<quail-translation-docstring> |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
106 |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
107 For double-width GB2312 characters correponding to ASCII, use the |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
108 input method `chinese-qj'.") |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
109 |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
110 ("chinese-ecdict" "$(05CKH(B" |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
111 "In this input method, you enter a Chinese (Big5) charactere or word |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
112 by typing the corresponding English word. For example, if you type |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
113 \"computer\", \"$(0IZH+(B\" is input. |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
114 |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
115 \\<quail-translation-docstring>") |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
116 |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
117 ("chinese-etzy" "$(06/0D(B" |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
118 "Zhuyin base input method for Chinese Big5 characters (`chinese-big5-1', |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
119 `chinese-big5-2'). |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
120 |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
121 Zhuyin is a kind of phonetic symbol. One to three Zhuyin symbols |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
122 compose one Chinese character. |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
123 |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
124 In this input method, you enter a Chinese character by first typing |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
125 keys corresponding to Zhuyin symbols (see the above table) followed by |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
126 SPC, 1, 2, 3, or 4 specifing a tone (SPC:$(0?v(N(B, 1:$(0M=Vy(B, 2:$(0Dm(N(B, 3: $(0&9Vy(B, |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
127 4:$(0(+Vy(B). |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
128 |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
129 \\<quail-translation-docstring>") |
31425
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
130 |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
131 ("chinese-punct-b5" "$(0O:(BB" |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
132 "Input method for Chinese punctuations and symbols of Big5 |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
133 \(`chinese-big5-1' and `chinese-big5-2').") |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
134 |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
135 ("chinese-punct" "$A1j(BG" |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
136 "Input method for Chinese punctuations and symbols of GB2312 |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
137 \(`chinese-gb2312').") |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
138 |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
139 ("chinese-py-b5" "$(03<(BB" |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
140 "Pinyin base input method for Chinese Big5 characters |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
141 \(`chinese-big5-1', `chinese-big5-2'). |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
142 |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
143 This input method works almost the same way as `chinese-py' (which |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
144 see). |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
145 |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
146 This input method supports only Han characters. The more convenient |
31481
e9e907d10d80
(quail-cxterm-package-ext-info): Fix doc strings of chinese-py-b5,
Eli Zaretskii <eliz@gnu.org>
parents:
31425
diff
changeset
|
147 method is `chinese-py-punct-b5', which is the combination of this |
e9e907d10d80
(quail-cxterm-package-ext-info): Fix doc strings of chinese-py-b5,
Eli Zaretskii <eliz@gnu.org>
parents:
31425
diff
changeset
|
148 method and `chinese-punct-b5' and which supports both Han characters |
e9e907d10d80
(quail-cxterm-package-ext-info): Fix doc strings of chinese-py-b5,
Eli Zaretskii <eliz@gnu.org>
parents:
31425
diff
changeset
|
149 and punctuation/symbols. |
31425
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
150 |
31481
e9e907d10d80
(quail-cxterm-package-ext-info): Fix doc strings of chinese-py-b5,
Eli Zaretskii <eliz@gnu.org>
parents:
31425
diff
changeset
|
151 For double-width Big5 characters corresponding to ASCII, use the input |
31425
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
152 method `chinese-qj-b5'. |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
153 |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
154 The input method `chinese-py' and `chinese-tonepy' are also Pinyin |
31481
e9e907d10d80
(quail-cxterm-package-ext-info): Fix doc strings of chinese-py-b5,
Eli Zaretskii <eliz@gnu.org>
parents:
31425
diff
changeset
|
155 based, but for the character set GB2312 (`chinese-gb2312').") |
31425
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
156 |
31548
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
157 ("chinese-qj-b5" "$(0)A(BB") |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
158 |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
159 ("chinese-qj" "$AH+(BG") |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
160 |
31425
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
161 ("chinese-sw" "$AJWN2(B" |
31548
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
162 "Radical base input method for Chinese charset GB2312 (`chinese-gb2312'). |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
163 |
32277
d589b182b25a
(quail-cxterm-package-ext-info): Fix typos in doc strings.
Eli Zaretskii <eliz@gnu.org>
parents:
31548
diff
changeset
|
164 In this input method, you enter a Chinese character by typing two |
d589b182b25a
(quail-cxterm-package-ext-info): Fix typos in doc strings.
Eli Zaretskii <eliz@gnu.org>
parents:
31548
diff
changeset
|
165 keys. The first key corresponds to the first ($AJW(B) radical, the second |
d589b182b25a
(quail-cxterm-package-ext-info): Fix typos in doc strings.
Eli Zaretskii <eliz@gnu.org>
parents:
31548
diff
changeset
|
166 key corresponds to the last ($AN2(B) radical. The correspondence of keys |
d589b182b25a
(quail-cxterm-package-ext-info): Fix typos in doc strings.
Eli Zaretskii <eliz@gnu.org>
parents:
31548
diff
changeset
|
167 and radicals is as below: |
31548
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
168 |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
169 first radical: |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
170 a b c d e f g h i j k l m n o p q r s t u v w x y z |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
171 $APD(B $AZ"(B $AJ,(B $AX<(B $A;p(B $A?Z(B $A^P(B $Ac_(B $AZ%(B $A\3(B $AXi(B $AD>(B $Alj(B $Ab;(B $ATB(B $Afy(B $AJ/(B $AMu(B $A0K(B $AX/(B $AHU(B $AeA(B $Aak(B $AVq(B $AR;(B $AHK(B |
31548
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
172 last radical: |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
173 a b c d e f g h i j k l m n o p q r s t u v w x y z |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
174 $ASV(B $AI=(B $AMA(B $A56(B $AZb(B $A?Z(B $ARB(B $Aqb(B $A4s(B $A6!(B $A[L(B $Ala(B $AJ.(B $A4u(B $AXg(B $ACE(B $A=q(B $AX-(B $AE.(B $ARR(B $A`m(B $AP!(B $A3'(B $A3f(B $A_.(B $A27(B |
31548
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
175 |
36995
eba40b9dc09b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36684
diff
changeset
|
176 \\<quail-translation-docstring>") |
31548
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
177 |
31425
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
178 ("chinese-tonepy" "$A5wF4(B" |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
179 "Pinyin base input method for Chinese charset GB2312 (`chinese-gb2312'). |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
180 |
48760
0006966fe2dc
(titdic-convert): Process the header part in multibyte mode.
Kenichi Handa <handa@m17n.org>
parents:
48666
diff
changeset
|
181 Pinyin is the standard roman transliteration method for Chinese. |
32277
d589b182b25a
(quail-cxterm-package-ext-info): Fix typos in doc strings.
Eli Zaretskii <eliz@gnu.org>
parents:
31548
diff
changeset
|
182 For the details of Pinyin system, see the documentation of the input |
31425
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
183 method `chinese-py'. |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
184 |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
185 This input method works almost the same way as `chinese-py'. The |
31548
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
186 difference is that you must type 1..5 after each Pinyin spelling to |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
187 specify a tone (1:$ARuF=(B, 2:$AQtF=(B, 3:$AIOIy(B, 4$AOBIy(B, 5:$AGaIy(B). |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
188 |
36995
eba40b9dc09b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36684
diff
changeset
|
189 \\<quail-translation-docstring> |
31548
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
190 |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
191 For instance, to input $ADc(B, you type \"n i 3 3\", the first \"n i\" is |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
192 a Pinyin, the next \"3\" specifies tone, and the last \"3\" selects |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
193 the third character from the candidate list. |
31425
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
194 |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
195 For double-width GB2312 characters correponding to ASCII, use the |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
196 input method `chinese-qj'.") |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
197 |
31548
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
198 ("chinese-zozy" "$(0I\0D(B" |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
199 "Zhuyin base input method for Chinese Big5 characters (`chinese-big5-1', |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
200 `chinese-big5-2'). |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
201 |
32277
d589b182b25a
(quail-cxterm-package-ext-info): Fix typos in doc strings.
Eli Zaretskii <eliz@gnu.org>
parents:
31548
diff
changeset
|
202 Zhuyin is a kind of a phonetic symbol. One to three Zhuyin symbols |
31548
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
203 compose a Chinese character. |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
204 |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
205 In this input method, you enter a Chinese character by first typing |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
206 keys corresponding to Zhuyin symbols (see the above table) followed by |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
207 SPC, 6, 3, 4, or 7 specifing a tone (SPC:$(0?v(N(B, 6:$(0Dm(N(B, 3:$(0&9Vy(B, 4:$(0(+Vy(B, |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
208 7:$(0M=Vy(B). |
c8f1f4614a02
(quail-cxterm-package-ext-info): Add extra docstrings for
Kenichi Handa <handa@m17n.org>
parents:
31481
diff
changeset
|
209 |
36995
eba40b9dc09b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36684
diff
changeset
|
210 \\<quail-translation-docstring>"))) |
17052 | 211 |
212 ;; Return a value of the key in the current line. | |
213 (defsubst tit-read-key-value () | |
52408
0fda57976189
(tit-read-key-value): Include \r in regexp.
Jason Rumney <jasonr@gnu.org>
parents:
52401
diff
changeset
|
214 (if (looking-at "[^ \t\r\n]+") |
17052 | 215 (car (read-from-string (concat "\"" (match-string 0) "\""))))) |
216 | |
217 ;; Return an appropriate quail-package filename from FILENAME (TIT | |
18555 | 218 ;; dictionary filename). For instance, ".../ZOZY.tit" -> "ZOZY.el". |
219 (defun tit-make-quail-package-file-name (filename &optional dirname) | |
17052 | 220 (expand-file-name |
18555 | 221 (concat (file-name-nondirectory (substring filename 0 -4)) ".el") |
17052 | 222 dirname)) |
223 | |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
224 ;; This value is nil if we are processing phrase dictionary. |
44449
d43b78a12997
(tit-dictionary): Use defvar for non-constants.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38414
diff
changeset
|
225 (defvar tit-dictionary t) |
17052 | 226 (defvar tit-encode nil) |
227 (defvar tit-default-encode "GB") | |
228 | |
229 ;; Generate elements of KEY-BINDINGS arg for `quail-define-package' so | |
230 ;; that each characters in KEYS invokes FUNCTION-SYMBOL. | |
231 (defun tit-generate-key-bindings (keys function-symbol) | |
232 (let ((len (length keys)) | |
233 (i 0) | |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
234 (first t) |
17052 | 235 key) |
236 (while (< i len) | |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
237 (or first (princ "\n ")) |
17052 | 238 (setq key (aref keys i)) |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
239 (if (if (< key ?\ ) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
240 (eq (lookup-key quail-translation-keymap |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
241 (char-to-string key)) |
17052 | 242 'quail-execute-non-quail-command) |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
243 (<= key 127)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
244 (progn |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
245 (princ (cons (cond ((< key ?\ ) (format "\"\\C-%c\"" (+ key ?@))) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
246 ((< key 127) (format "\"%c\"" key)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
247 (t "\"\\C-?\"")) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
248 function-symbol)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
249 (setq first nil))) |
17052 | 250 (setq i (1+ i))))) |
251 | |
252 ;; Analyze header part of TIT dictionary and generate an appropriate | |
253 ;; `quail-define-package' function call. | |
254 (defun tit-process-header (filename) | |
255 (message "Processing header part...") | |
256 (goto-char (point-min)) | |
257 | |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
258 ;; At first, generate header part of the Quail package while |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
259 ;; collecting information from the original header. |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
260 (let ((package (concat |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
261 "chinese-" |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
262 (substring (downcase (file-name-nondirectory filename)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
263 0 -4))) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
264 ;; TIT keywords and the corresponding default values. |
17052 | 265 (tit-multichoice t) |
266 (tit-prompt "") | |
267 (tit-comments nil) | |
268 (tit-backspace "\010\177") | |
269 (tit-deleteall "\015\025") | |
270 (tit-moveright ".>") | |
271 (tit-moveleft ",<") | |
272 (tit-keyprompt nil)) | |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
273 |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
274 (princ ";; Quail package `") |
75496 | 275 (princ package) |
90743 | 276 (princ (format "' -*- coding:%s; " coding-system-for-write)) |
75496 | 277 (princ "byte-compile-disable-print-circle:t; -*-\n") |
46670 | 278 (princ ";; Generated by the command `titdic-convert'\n;;\tDate: ") |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
279 (princ (current-time-string)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
280 (princ "\n;;\tOriginal TIT dictionary file: ") |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
281 (princ (file-name-nondirectory filename)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
282 (princ "\n\n;;; Comment:\n\n") |
21503
d08387c742bb
(titdic-convert): Message improved.
Kenichi Handa <handa@m17n.org>
parents:
21081
diff
changeset
|
283 (princ ";; Byte-compile this file again after any modification.\n\n") |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
284 (princ ";;; Start of the header of original TIT dictionary.\n\n") |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
285 |
17052 | 286 (while (not (eobp)) |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
287 (let ((ch (following-char)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
288 (pos (point))) |
17052 | 289 (cond ((= ch ?C) ; COMMENT |
290 (cond ((looking-at "COMMENT") | |
291 (let ((pos (match-end 0))) | |
292 (end-of-line) | |
102001
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
293 (setq tit-comments |
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
294 (cons (buffer-substring-no-properties pos (point)) |
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
295 tit-comments)))))) |
17052 | 296 ((= ch ?M) ; MULTICHOICE, MOVERIGHT, MOVELEFT |
297 (cond ((looking-at "MULTICHOICE:[ \t]*") | |
298 (goto-char (match-end 0)) | |
299 (setq tit-multichoice (looking-at "YES"))) | |
300 ((looking-at "MOVERIGHT:[ \t]*") | |
301 (goto-char (match-end 0)) | |
302 (setq tit-moveright (tit-read-key-value))) | |
303 ((looking-at "MOVELEFT:[ \t]*") | |
304 (goto-char (match-end 0)) | |
305 (setq tit-moveleft (tit-read-key-value))))) | |
306 ((= ch ?P) ; PROMPT | |
307 (cond ((looking-at "PROMPT:[ \t]*") | |
308 (goto-char (match-end 0)) | |
31425
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
309 (setq tit-prompt (tit-read-key-value)) |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
310 ;; Some TIT dictionaies that are encoded by |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
311 ;; euc-china contains invalid character at the tail. |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
312 (let* ((last (aref tit-prompt (1- (length tit-prompt)))) |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
313 (split (split-char last))) |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
314 (if (or (eq (nth 1 split) 32) |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
315 (eq (nth 2 split) 32)) |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
316 (setq tit-prompt (substring tit-prompt 0 -1))))))) |
17052 | 317 ((= ch ?B) ; BACKSPACE, BEGINDICTIONARY, |
318 ; BEGINPHRASE | |
319 (cond ((looking-at "BACKSPACE:[ \t]*") | |
320 (goto-char (match-end 0)) | |
321 (setq tit-backspace (tit-read-key-value))) | |
322 ((looking-at "BEGINDICTIONARY") | |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
323 (setq tit-dictionary t)) |
17052 | 324 ((looking-at "BEGINPHRASE") |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
325 (setq tit-dictionary nil)))) |
17052 | 326 ((= ch ?K) ; KEYPROMPT |
327 (cond ((looking-at "KEYPROMPT(\\(.*\\)):[ \t]*") | |
328 (let ((key-char (match-string 1))) | |
329 (goto-char (match-end 0)) | |
19943
23ada3fdbc8b
(tit-process-header): Convert argument of KEYPROMPT if it contains an escape.
Richard M. Stallman <rms@gnu.org>
parents:
19431
diff
changeset
|
330 (if (string-match "\\\\[0-9]+" key-char) |
23ada3fdbc8b
(tit-process-header): Convert argument of KEYPROMPT if it contains an escape.
Richard M. Stallman <rms@gnu.org>
parents:
19431
diff
changeset
|
331 (setq key-char |
23ada3fdbc8b
(tit-process-header): Convert argument of KEYPROMPT if it contains an escape.
Richard M. Stallman <rms@gnu.org>
parents:
19431
diff
changeset
|
332 (car (read-from-string (format "\"%s\"" |
23ada3fdbc8b
(tit-process-header): Convert argument of KEYPROMPT if it contains an escape.
Richard M. Stallman <rms@gnu.org>
parents:
19431
diff
changeset
|
333 key-char))))) |
17052 | 334 (setq tit-keyprompt |
335 (cons (cons key-char (tit-read-key-value)) | |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
336 tit-keyprompt))))))) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
337 (end-of-line) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
338 (princ ";; ") |
102001
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
339 (princ (buffer-substring-no-properties pos (point))) |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
340 (princ "\n") |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
341 (forward-line 1))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
342 |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
343 (princ "\n;;; End of the header of original TIT dictionary.\n\n") |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
344 (princ ";;; Code:\n\n(require 'quail)\n\n") |
17052 | 345 |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
346 (princ "(quail-define-package ") |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
347 ;; Args NAME, LANGUAGE, TITLE |
31425
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
348 (let ((title (nth 1 (assoc package quail-cxterm-package-ext-info)))) |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
349 (princ "\"") |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
350 (princ package) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
351 (princ "\" \"") |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
352 (princ (nth 2 (assoc tit-encode tit-encode-list))) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
353 (princ "\" \"") |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
354 (princ (or title |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
355 (if (string-match "[:$A!K$(0!(!J(B]+\\([^:$A!K$(0!(!K(B]+\\)" tit-prompt) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
356 (substring tit-prompt (match-beginning 1) (match-end 1)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
357 tit-prompt))) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
358 (princ "\"\n")) |
17052 | 359 |
360 ;; Arg GUIDANCE | |
361 (if tit-keyprompt | |
362 (progn | |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
363 (princ " '(") |
17052 | 364 (while tit-keyprompt |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
365 (princ " ") |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
366 (princ (format "(%d . \"%s\")\n" |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
367 (string-to-char (car (car tit-keyprompt))) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
368 (cdr (car tit-keyprompt)))) |
17052 | 369 (setq tit-keyprompt (cdr tit-keyprompt))) |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
370 (princ ")")) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
371 (princ " t\n")) |
17052 | 372 |
373 ;; Arg DOCSTRING | |
31425
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
374 (let ((doc (concat tit-prompt "\n")) |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
375 (comments (if tit-comments |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
376 (mapconcat 'identity (nreverse tit-comments) "\n"))) |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
377 (doc-ext (nth 2 (assoc package quail-cxterm-package-ext-info)))) |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
378 (if comments |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
379 (setq doc (concat doc "\n" comments "\n"))) |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
380 (if doc-ext |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
381 (setq doc (concat doc "\n" doc-ext "\n"))) |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
382 (prin1 doc) |
3ab020a4847b
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
21503
diff
changeset
|
383 (terpri)) |
17052 | 384 |
385 ;; Arg KEY-BINDINGS | |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
386 (princ " '(") |
17052 | 387 (tit-generate-key-bindings tit-backspace 'quail-delete-last-char) |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
388 (princ "\n ") |
17052 | 389 (tit-generate-key-bindings tit-deleteall 'quail-abort-translation) |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
390 (princ "\n ") |
17052 | 391 (tit-generate-key-bindings tit-moveright 'quail-next-translation) |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
392 (princ "\n ") |
17052 | 393 (tit-generate-key-bindings tit-moveleft 'quail-prev-translation) |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
394 (princ ")\n") |
17052 | 395 |
396 ;; Args FORGET-TRANSLATION, DETERMINISTIC, KBD-TRANSLATE, SHOW-LAYOUT. | |
397 ;; The remaining args are all nil. | |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
398 (princ " nil") |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
399 (princ (if tit-multichoice " nil" " t")) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
400 (princ (if tit-keyprompt " t t)\n\n" " nil nil)\n\n")))) |
17052 | 401 |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
402 (defsubst tit-flush-translations (key translations) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
403 (if (string-match "\\\\[0-9][0-9][0-9]" key) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
404 (let ((newkey (concat (substring key 0 (match-beginning 0)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
405 (car (read-from-string |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
406 (concat "\"" (match-string 0 key) "\""))))) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
407 (idx (match-end 0))) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
408 (while (string-match "\\\\[0-9][0-9][0-9]" key idx) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
409 (setq newkey (concat |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
410 newkey |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
411 (substring key idx (match-beginning 0)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
412 (car (read-from-string |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
413 (concat "\"" (match-string 0 key) "\""))))) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
414 (setq idx (match-end 0))) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
415 (setq key (concat newkey (substring key idx))))) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
416 (prin1 (list key (if tit-dictionary translations |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
417 (vconcat (nreverse translations))))) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
418 (princ "\n")) |
17052 | 419 |
420 ;; Convert body part of TIT dictionary into `quail-define-rules' | |
421 ;; function call. | |
422 (defun tit-process-body () | |
423 (message "Formatting translation rules...") | |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
424 (let* ((template (list nil nil)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
425 (second (cdr template)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
426 (prev-key "") |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
427 ch key translations pos) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
428 (princ "(quail-define-rules\n") |
17052 | 429 (while (null (eobp)) |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
430 (setq ch (following-char)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
431 (if (or (= ch ?#) (= ch ?\n)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
432 (forward-line 1) |
17052 | 433 (setq pos (point)) |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
434 (skip-chars-forward "^ \t\n") |
102001
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
435 (setq key (buffer-substring-no-properties pos (point))) |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
436 (skip-chars-forward " \t") |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
437 (setq ch (following-char)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
438 (if (or (= ch ?#) (= ch ?\n)) |
18796
ab40b57484c1
(tit-process-body): Ignore vacant entries.
Kenichi Handa <handa@m17n.org>
parents:
18555
diff
changeset
|
439 ;; This entry contains no translations. Let's ignore it. |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
440 (forward-line 1) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
441 (or (string= key prev-key) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
442 (progn |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
443 (if translations |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
444 (tit-flush-translations prev-key translations)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
445 (setq translations nil |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
446 prev-key key))) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
447 (if tit-dictionary |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
448 (progn |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
449 (setq pos (point)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
450 (skip-chars-forward "^ \t#\n") |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
451 (setq translations |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
452 (if translations |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
453 (concat translations |
102001
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
454 (buffer-substring-no-properties pos (point))) |
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
455 (buffer-substring-no-properties pos (point))))) |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
456 (while (not (eolp)) |
18796
ab40b57484c1
(tit-process-body): Ignore vacant entries.
Kenichi Handa <handa@m17n.org>
parents:
18555
diff
changeset
|
457 (setq pos (point)) |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
458 (skip-chars-forward "^ \t\n") |
102001
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
459 (setq translations (cons (buffer-substring-no-properties |
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
460 pos (point)) |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
461 translations)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
462 (skip-chars-forward " \t") |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
463 (setq ch (following-char)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
464 (if (= ch ?#) (end-of-line)))) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
465 (forward-line 1)))) |
18796
ab40b57484c1
(tit-process-body): Ignore vacant entries.
Kenichi Handa <handa@m17n.org>
parents:
18555
diff
changeset
|
466 |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
467 (if translations |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
468 (tit-flush-translations prev-key translations)) |
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
469 (princ ")\n"))) |
17052 | 470 |
471 ;;;###autoload | |
472 (defun titdic-convert (filename &optional dirname) | |
473 "Convert a TIT dictionary of FILENAME into a Quail package. | |
474 Optional argument DIRNAME if specified is the directory name under which | |
475 the generated Quail package is saved." | |
476 (interactive "FTIT dictionary file: ") | |
90030
f624e8fd4723
(tit-process-header): Fix embedded
Kenichi Handa <handa@m17n.org>
parents:
89943
diff
changeset
|
477 (let ((coding-system-for-write nil)) |
46670 | 478 (with-temp-file (tit-make-quail-package-file-name filename dirname) |
479 (let ((standard-output (current-buffer))) | |
480 (with-temp-buffer | |
481 (set-buffer-multibyte nil) | |
75788
9099b36e6499
(titdic-convert): Force files be
Kenichi Handa <handa@m17n.org>
parents:
75504
diff
changeset
|
482 ;; Here we must use `raw-text' instead of `no-conversion' to |
9099b36e6499
(titdic-convert): Force files be
Kenichi Handa <handa@m17n.org>
parents:
75504
diff
changeset
|
483 ;; enable auto-decoding of eol format (CRLF->LF). |
9099b36e6499
(titdic-convert): Force files be
Kenichi Handa <handa@m17n.org>
parents:
75504
diff
changeset
|
484 (let ((coding-system-for-read 'raw-text)) |
46670 | 485 (insert-file-contents (expand-file-name filename))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
486 |
46670 | 487 ;; Decode the buffer contents from the encoding specified by a |
488 ;; value of the key "ENCODE:". | |
489 (if (not (search-forward "\nBEGIN" nil t)) | |
490 (error "TIT dictionary doesn't have body part")) | |
491 (let ((limit (point)) | |
492 coding-system slot) | |
493 (goto-char (point-min)) | |
494 (if (re-search-forward "^ENCODE:[ \t]*" limit t) | |
495 (progn | |
496 (goto-char (match-end 0)) | |
497 (setq tit-encode (tit-read-key-value))) | |
498 (setq tit-encode tit-default-encode)) | |
499 (setq slot (assoc tit-encode tit-encode-list)) | |
500 (if (not slot) | |
501 (error "Invalid ENCODE: value in TIT dictionary")) | |
502 (setq coding-system (nth 1 slot)) | |
503 (message "Decoding with coding system %s..." coding-system) | |
504 (goto-char (point-min)) | |
90030
f624e8fd4723
(tit-process-header): Fix embedded
Kenichi Handa <handa@m17n.org>
parents:
89943
diff
changeset
|
505 (decode-coding-region (point-min) (point-max) coding-system) |
90753 | 506 ;; Explicitly set eol format to `unix'. |
507 (setq coding-system-for-write | |
508 (coding-system-change-eol-conversion coding-system 'unix)) | |
90030
f624e8fd4723
(tit-process-header): Fix embedded
Kenichi Handa <handa@m17n.org>
parents:
89943
diff
changeset
|
509 (remove-text-properties (point-min) (point-max) '(charset nil))) |
46670 | 510 |
88452
ec21f1e8ca97
(titdic-convert): Read into a unibyte buffer then make the buffer
Kenichi Handa <handa@m17n.org>
parents:
88408
diff
changeset
|
511 (set-buffer-multibyte t) |
46670 | 512 ;; Set point the starting position of the body part. |
20840
1842af0263da
Many codes re-written to adjust for
Kenichi Handa <handa@m17n.org>
parents:
20795
diff
changeset
|
513 (goto-char (point-min)) |
46670 | 514 (if (not (search-forward "\nBEGIN" nil t)) |
515 (error "TIT dictionary can't be decoded correctly")) | |
17052 | 516 |
88408
4135242fe433
(titdic-convert): Bind coding-system-for-write to 'iso-2022-7bit.
Kenichi Handa <handa@m17n.org>
parents:
38414
diff
changeset
|
517 ;; Process the header part. |
46670 | 518 (forward-line 1) |
519 (narrow-to-region (point-min) (point)) | |
520 (tit-process-header filename) | |
521 (widen) | |
17052 | 522 |
89483 | 523 ;; Process the body part |
46670 | 524 (tit-process-body)))))) |
17052 | 525 |
526 ;;;###autoload | |
18831
e6f6c2712a5f
(batch-titdic-convert): Add optional arg FORCE.
Kenichi Handa <handa@m17n.org>
parents:
18796
diff
changeset
|
527 (defun batch-titdic-convert (&optional force) |
17052 | 528 "Run `titdic-convert' on the files remaining on the command line. |
529 Use this from the command line, with `-batch'; | |
530 it won't work in an interactive Emacs. | |
531 For example, invoke \"emacs -batch -f batch-titdic-convert XXX.tit\" to | |
532 generate Quail package file \"xxx.el\" from TIT dictionary file \"XXX.tit\". | |
533 To get complete usage, invoke \"emacs -batch -f batch-titdic-convert -h\"." | |
534 (defvar command-line-args-left) ; Avoid compiler warning. | |
535 (if (not noninteractive) | |
536 (error "`batch-titdic-convert' should be used only with -batch")) | |
537 (if (string= (car command-line-args-left) "-h") | |
538 (progn | |
539 (message "To convert XXX.tit and YYY.tit into xxx.el and yyy.el:") | |
540 (message " %% emacs -batch -l titdic-cnv -f batch-titdic-convert XXX.tit YYY.tit") | |
541 (message "To convert XXX.tit into DIR/xxx.el:") | |
542 (message " %% emacs -batch -l titdic-cnv -f batch-titdic-convert -dir DIR XXX.tit")) | |
543 (let (targetdir filename files file) | |
544 (if (string= (car command-line-args-left) "-dir") | |
545 (progn | |
546 (setq command-line-args-left (cdr command-line-args-left)) | |
547 (setq targetdir (car command-line-args-left)) | |
548 (setq command-line-args-left (cdr command-line-args-left)))) | |
549 (while command-line-args-left | |
550 (setq filename (expand-file-name (car command-line-args-left))) | |
551 (if (file-directory-p filename) | |
552 (progn | |
553 (message "Converting all tit files in the directory %s" filename) | |
554 (setq files (directory-files filename t "\\.tit$"))) | |
555 (setq files (list filename))) | |
556 (while files | |
557 (setq file (expand-file-name (car files))) | |
18831
e6f6c2712a5f
(batch-titdic-convert): Add optional arg FORCE.
Kenichi Handa <handa@m17n.org>
parents:
18796
diff
changeset
|
558 (when (or force |
e6f6c2712a5f
(batch-titdic-convert): Add optional arg FORCE.
Kenichi Handa <handa@m17n.org>
parents:
18796
diff
changeset
|
559 (file-newer-than-file-p |
e6f6c2712a5f
(batch-titdic-convert): Add optional arg FORCE.
Kenichi Handa <handa@m17n.org>
parents:
18796
diff
changeset
|
560 file (tit-make-quail-package-file-name file targetdir))) |
e6f6c2712a5f
(batch-titdic-convert): Add optional arg FORCE.
Kenichi Handa <handa@m17n.org>
parents:
18796
diff
changeset
|
561 (message "Converting %s to quail-package..." file) |
e6f6c2712a5f
(batch-titdic-convert): Add optional arg FORCE.
Kenichi Handa <handa@m17n.org>
parents:
18796
diff
changeset
|
562 (titdic-convert file targetdir)) |
17052 | 563 (setq files (cdr files))) |
564 (setq command-line-args-left (cdr command-line-args-left))) | |
21503
d08387c742bb
(titdic-convert): Message improved.
Kenichi Handa <handa@m17n.org>
parents:
21081
diff
changeset
|
565 (message "Byte-compile the created files by:") |
17052 | 566 (message " %% emacs -batch -f batch-byte-compile XXX.el"))) |
567 (kill-emacs 0)) | |
568 | |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
569 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
570 ;;; Converter of miscellaneous dictionaries other than TIT format. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
571 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
572 ;; Alist of input method names and the corresponding information. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
573 ;; Each element has this form: |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
574 ;; (INPUT-METHOD-NAME ;; Name of the input method. |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
575 ;; INPUT-METHOD-TITLE ;; Title string of the input method |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
576 ;; DICFILE ;; Name of the source dictionary file. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
577 ;; CODING ;; Coding system of the dictionary file. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
578 ;; QUAILFILE ;; Name of the Quail package file. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
579 ;; CONVERTER ;; Function to generate the Quail package. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
580 ;; COPYRIGHT-NOTICE ;; Copyright notice of the source dictionary. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
581 ;; ) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
582 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
583 (defvar quail-misc-package-ext-info |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
584 '(("chinese-b5-tsangchi" "$(06A(BB" |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
585 "cangjie-table.b5" big5 "tsang-b5.el" |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
586 tsang-b5-converter |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
587 "\ |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
588 ;; # Copyright 2001 Christian Wittern <wittern@iis.sinica.edu.tw> |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
589 ;; # |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
590 ;; # Permission to copy and distribute both modified and |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
591 ;; # unmodified versions is granted without royalty provided |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
592 ;; # this notice is preserved.") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
593 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
594 ("chinese-b5-quick" "$(0X|(BB" |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
595 "cangjie-table.b5" big5 "quick-b5.el" |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
596 quick-b5-converter |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
597 "\ |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
598 ;; # Copyright 2001 Christian Wittern <wittern@iis.sinica.edu.tw> |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
599 ;; # |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
600 ;; # Permission to copy and distribute both modified and |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
601 ;; # unmodified versions is granted without royalty provided |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
602 ;; # this notice is preserved.") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
603 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
604 ("chinese-cns-tsangchi" "$(GT?(BC" |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
605 "cangjie-table.cns" iso-2022-cn-ext "tsang-cns.el" |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
606 tsang-cns-converter |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
607 "\ |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
608 ;; # Copyright 2001 Christian Wittern <wittern@iis.sinica.edu.tw> |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
609 ;; # |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
610 ;; # Permission to copy and distribute both modified and |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
611 ;; # unmodified versions is granted without royalty provided |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
612 ;; # this notice is preserved.") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
613 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
614 ("chinese-cns-quick" "$(Gv|(BC" |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
615 "cangjie-table.cns" iso-2022-cn-ext "quick-cns.el" |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
616 quick-cns-converter |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
617 "\ |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
618 ;; # Copyright 2001 Christian Wittern <wittern@iis.sinica.edu.tw> |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
619 ;; # |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
620 ;; # Permission to copy and distribute both modified and |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
621 ;; # unmodified versions is granted without royalty provided |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
622 ;; # this notice is preserved.") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
623 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
624 ("chinese-py" "$AF4(BG" |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
625 "pinyin.map" cn-gb-2312 "PY.el" |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
626 py-converter |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
627 "\ |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
628 ;; \"pinyin.map\" is included in a free package called CCE. It is |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
629 ;; available at: |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
630 ;; http://ftp.debian.org/debian/dists/potato/main |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
631 ;; /source/utils/cce_0.36.orig.tar.gz |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
632 ;; This package contains the following copyright notice. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
633 ;; |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
634 ;; |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
635 ;; Copyright (C) 1999, Rui He, herui@cs.duke.edu |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
636 ;; |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
637 ;; |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
638 ;; CCE(Console Chinese Environment) 0.32 |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
639 ;; |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
640 ;; CCE is free software; you can redistribute it and/or modify it under the |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
641 ;; terms of the GNU General Public License as published by the Free Software |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
642 ;; Foundation; either version 1, or (at your option) any later version. |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
643 ;; |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
644 ;; CCE is distributed in the hope that it will be useful, but WITHOUT ANY |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
645 ;; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
646 ;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
647 ;; details. |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
648 ;; |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
649 ;; You should have received a copy of the GNU General Public License along with |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
650 ;; CCE; see the file COPYING. If not, write to the Free Software Foundation, |
64092 | 651 ;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.") |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
652 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
653 ("chinese-ziranma" "$AWTH;(B" |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
654 "ziranma.cin" cn-gb-2312 "ZIRANMA.el" |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
655 ziranma-converter |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
656 "\ |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
657 ;; \"ziranma.cin\" is included in a free package called CCE. It is |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
658 ;; available at: |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
659 ;; http://ftp.debian.org/debian/dists/potato/main |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
660 ;; /source/utils/cce_0.36.orig.tar.gz |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
661 ;; This package contains the following copyright notice. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
662 ;; |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
663 ;; |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
664 ;; Copyright (C) 1999, Rui He, herui@cs.duke.edu |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
665 ;; |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
666 ;; |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
667 ;; CCE(Console Chinese Environment) 0.32 |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
668 ;; |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
669 ;; CCE is free software; you can redistribute it and/or modify it under the |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
670 ;; terms of the GNU General Public License as published by the Free Software |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
671 ;; Foundation; either version 1, or (at your option) any later version. |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
672 ;; |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
673 ;; CCE is distributed in the hope that it will be useful, but WITHOUT ANY |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
674 ;; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
675 ;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
676 ;; details. |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
677 ;; |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
678 ;; You should have received a copy of the GNU General Public License along with |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
679 ;; CCE; see the file COPYING. If not, write to the Free Software Foundation, |
64092 | 680 ;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.") |
37875
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
681 |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
682 ("chinese-ctlau" "$AAuTA(B" |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
683 "CTLau.html" cn-gb-2312 "CTLau.el" |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
684 ctlau-gb-converter |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
685 "\ |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
686 ;; \"CTLau.html\" is available at: |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
687 ;; |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
688 ;; http://umunhum.stanford.edu/~lee/chicomp/CTLau.html |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
689 ;; |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
690 ;; It contains the following copyright notice: |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
691 ;; |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
692 ;; # Copyright (C) 1988-2001 Fung Fung Lee (lee@umunhum.stanford.edu) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
693 ;; # |
37875
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
694 ;; # This program is free software; you can redistribute it and/or |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
695 ;; # modify it under the terms of the GNU General Public License |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
696 ;; # as published by the Free Software Foundation; either version 2 |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
697 ;; # of the License, or any later version. |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
698 ;; # |
37875
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
699 ;; # This program is distributed in the hope that it will be useful, |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
700 ;; # but WITHOUT ANY WARRANTY; without even the implied warranty of |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
701 ;; # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
702 ;; # GNU General Public License for more details. |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
703 ;; # |
37875
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
704 ;; # You should have received a copy of the GNU General Public License |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
705 ;; # along with this program; if not, write to the Free Software Foundation, |
64091 | 706 ;; # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.") |
37875
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
707 |
37884
b454faf9a60b
Change input method name chinese-ctlau-b5 back to chinese-ctlaub.
Andrew Choi <akochoi@shaw.ca>
parents:
37883
diff
changeset
|
708 ("chinese-ctlaub" "$(0N,Gn(B" |
37882
ad3d84632050
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37875
diff
changeset
|
709 "CTLau-b5.html" big5 "CTLau-b5.el" |
37875
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
710 ctlau-b5-converter |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
711 "\ |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
712 ;; \"CTLau-b5.html\" is available at: |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
713 ;; |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
714 ;; http://umunhum.stanford.edu/~lee/chicomp/CTLau-b5.html |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
715 ;; |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
716 ;; It contains the following copyright notice: |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
717 ;; |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
718 ;; # Copyright (C) 1988-2001 Fung Fung Lee (lee@umunhum.stanford.edu) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
719 ;; # |
37875
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
720 ;; # This program is free software; you can redistribute it and/or |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
721 ;; # modify it under the terms of the GNU General Public License |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
722 ;; # as published by the Free Software Foundation; either version 2 |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
723 ;; # of the License, or any later version. |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
724 ;; # |
37875
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
725 ;; # This program is distributed in the hope that it will be useful, |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
726 ;; # but WITHOUT ANY WARRANTY; without even the implied warranty of |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
727 ;; # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
728 ;; # GNU General Public License for more details. |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
729 ;; # |
37875
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
730 ;; # You should have received a copy of the GNU General Public License |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
731 ;; # along with this program; if not, write to the Free Software Foundation, |
64091 | 732 ;; # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.") |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
733 )) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
734 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
735 ;; Generate a code of a Quail package in the current buffer from Tsang |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
736 ;; dictionary in the buffer DICBUF. The input method name of the |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
737 ;; Quail package is NAME, and the title string is TITLE. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
738 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
739 ;; TSANG-P is non-nil, genereate $(06AQo(B input method. Otherwise |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
740 ;; generate $(0X|/y(B (simple version of $(06AQo(B). If BIG5-P is non-nil, the |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
741 ;; input method is for inputting Big5 characters. Otherwise the input |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
742 ;; method is for inputting CNS characters. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
743 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
744 (defun tsang-quick-converter (dicbuf name title tsang-p big5-p) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
745 (let ((fulltitle (if tsang-p (if big5-p "$(06AQo(B" "$(GT?on(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
746 (if big5-p "$(0X|/y(B" "$(Gv|Mx(B"))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
747 dic) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
748 (goto-char (point-max)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
749 (if big5-p |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
750 (insert (format "\"$(0&d'GTT&,!J(B%s$(0!K(BBIG5 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
751 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
752 $(0KHM$(B%s$(0TT&,WoOu(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
753 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
754 [Q $(0'D(B] [W $(0(q(B] [E $(0'V(B] [R $(0&H(B] [T $(0'>(B] [Y $(0&4(B] [U $(0&U(B] [I $(0'B(B] [O $(0&*(B] [P $(0'A(B] |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
755 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
756 [A $(0'K(B] [S $(0&T(B] [D $(0'N(B] [F $(0'W(B] [G $(0&I(B] [H $(0*M(B] [J $(0&3(B] [L $(0&d(B] |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
757 |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
758 [Z ] [X $(0[E(B] [C $(01[(B] [V $(0&M(B] [B $(0'M(B] [N $(0&_(B] [M $(0&"(B] |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
759 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
760 \\\\<quail-translation-docstring>\"\n" |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
761 fulltitle fulltitle)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
762 (insert (format "\"$(GDcEFrSD+!J(B%s$(G!K(BCNS |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
763 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
764 $(GiGk#(B%s$(GrSD+uomu(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
765 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
766 [Q $(GEC(B] [W $(GFp(B] [E $(GEU(B] [R $(GDG(B] [T $(GE=(B] [Y $(GD3(B] [U $(GDT(B] [I $(GEA(B] [O $(GD)(B] [P $(GE@(B] |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
767 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
768 [A $(GEJ(B] [S $(GDS(B] [D $(GEM(B] [F $(GEV(B] [G $(GDH(B] [H $(GHL(B] [J $(GD2(B] [L $(GDc(B] |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
769 |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
770 [Z ] [X $(GyE(B] [C $(GOZ(B] [V $(GDL(B] [B $(GEL(B] [N $(GD^(B] [M $(GD!(B] |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
771 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
772 \\\\<quail-translation-docstring>\"\n" |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
773 fulltitle fulltitle))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
774 (insert " '((\".\" . quail-next-translation-block) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
775 (\",\" . quail-prev-translation-block)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
776 nil nil)\n\n") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
777 (insert "(quail-define-rules\n") |
105813
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102001
diff
changeset
|
778 (with-current-buffer dicbuf |
52415
80d4785de4a0
(tsang-quick-converter): Fix broken line-ends from CVS before doing conversion.
Jason Rumney <jasonr@gnu.org>
parents:
52408
diff
changeset
|
779 ;; Handle double CR line ends, which result when checking out of |
80d4785de4a0
(tsang-quick-converter): Fix broken line-ends from CVS before doing conversion.
Jason Rumney <jasonr@gnu.org>
parents:
52408
diff
changeset
|
780 ;; CVS on MS-Windows. |
80d4785de4a0
(tsang-quick-converter): Fix broken line-ends from CVS before doing conversion.
Jason Rumney <jasonr@gnu.org>
parents:
52408
diff
changeset
|
781 (goto-char (point-min)) |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
782 (search-forward "A440") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
783 (beginning-of-line) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
784 (let ((table (make-hash-table :test 'equal)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
785 val) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
786 (while (not (eobp)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
787 (forward-char 5) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
788 (let ((trans (char-to-string (following-char))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
789 key slot) |
102001
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
790 (re-search-forward "\\([A-Z]+\\)\r*$" nil t) |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
791 (setq key (downcase |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
792 (if (or tsang-p |
102001
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
793 (<= (- (match-end 1) (match-beginning 1)) 1)) |
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
794 (match-string 1) |
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
795 (string (char-after (match-beginning 1)) |
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
796 (char-after (1- (match-end 1))))))) |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
797 (setq val (gethash key table)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
798 (if val (setq trans (concat val trans))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
799 (puthash key trans table) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
800 (forward-line 1))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
801 (maphash #'(lambda (key val) (setq dic (cons (cons key val) dic))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
802 table))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
803 (setq dic (sort dic (function (lambda (x y) (string< (car x ) (car y)))))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
804 (dolist (elt dic) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
805 (insert (format "(%S\t%S)\n" (car elt) (cdr elt)))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
806 (let ((punctuations '((";" "$(0!'!2!"!#!.!/(B" "$(G!'!2!"!#!.!/(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
807 (":" "$(0!(!+!3!%!$!&!0!1(B" "$(G!(!+!3!%!$!&!0!1(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
808 ("'" "$(0!e!d(B" "$(G!e!d(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
809 ("\"" "$(0!g!f!h!i!q(B" "$(G!g!f!h!i!q(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
810 ("\\" "$(0"`"b#M(B" "$(G"`"b#M(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
811 ("|" "$(0!6!8!:"^(B" "$(G!6!8!:"^(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
812 ("/" "$(0"_"a#L(B" "$(G"_"a#L(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
813 ("?" "$(0!)!4(B" "$(G!)!4(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
814 ("<" "$(0!R"6"A!T"H(B" "$(G!R"6"A!T"H(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
815 (">" "$(0!S"7"B!U(B" "$(G!S"7"B!U(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
816 ("[" "$(0!F!J!b!H!L!V!Z!X!\(B" "$(G!F!J!b!H!L!V!Z!X!\(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
817 ("]" "$(0!G!K!c!I!M!W![!Y!](B" "$(G!G!K!c!I!M!W![!Y!](B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
818 ("{" "$(0!B!`!D(B " "$(G!B!`!D(B ") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
819 ("}" "$(0!C!a!E(B" "$(G!C!a!E(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
820 ("`" "$(0!j!k(B" "$(G!j!k(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
821 ("~" "$(0"D"+",!<!=(B" "$(G"D"+",!<!=(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
822 ("!" "$(0!*!5(B" "$(G!*!5(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
823 ("@" "$(0"i"n(B" "$(G"i"n(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
824 ("#" "$(0!l"-(B" "$(G!l"-(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
825 ("$" "$(0"c"l(B" "$(G"c"l(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
826 ("%" "$(0"h"m(B" "$(G"h"m(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
827 ("&" "$(0!m".(B" "$(G!m".(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
828 ("*" "$(0!n"/!o!w!x(B" "$(G!n"/!o!w!x(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
829 ("(" "$(0!>!^!@(B" "$(G!>!^!@(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
830 (")" "$(0!?!_!A(B" "$(G!?!_!A(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
831 ("-" "$(0!7!9"#"$"1"@(B" "$(G!7!9"#"$"1"@(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
832 ("_" "$(0"%"&(B" "$(G"%"&(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
833 ("=" "$(0"8"C(B" "$(G"8"C(B") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
834 ("+" "$(0"0"?(B" "$(G"0"?(B")))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
835 (dolist (elt punctuations) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
836 (insert (format "(%S %S)\n" (concat "z" (car elt)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
837 (if big5-p (nth 1 elt) (nth 2 elt)))))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
838 (insert ")\n"))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
839 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
840 (defun tsang-b5-converter (dicbuf name title) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
841 (tsang-quick-converter dicbuf name title t t)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
842 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
843 (defun quick-b5-converter (dicbuf name title) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
844 (tsang-quick-converter dicbuf name title nil t)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
845 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
846 (defun tsang-cns-converter (dicbuf name title) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
847 (tsang-quick-converter dicbuf name title t nil)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
848 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
849 (defun quick-cns-converter (dicbuf name title) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
850 (tsang-quick-converter dicbuf name title nil nil)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
851 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
852 ;; Generate a code of a Quail package in the current buffer from |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
853 ;; Pinyin dictionary in the buffer DICBUF. The input method name of |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
854 ;; the Quail package is NAME, and the title string is TITLE. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
855 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
856 (defun py-converter (dicbuf name title) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
857 (goto-char (point-max)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
858 (insert (format "%S\n" "$A::WVJdHk!KF4Rt!K(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
859 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
860 $AF4Rt7=08(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
861 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
862 $AP!P4S"NDWVD84z1m!8F4Rt!97{:E#,(B \"u(yu) $ATrSC(B u: $A1mJ>!C(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
863 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
864 Pinyin base input method for Chinese charset GB2312 (`chinese-gb2312'). |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
865 |
48760
0006966fe2dc
(titdic-convert): Process the header part in multibyte mode.
Kenichi Handa <handa@m17n.org>
parents:
48666
diff
changeset
|
866 Pinyin is the standard roman transliteration method for Chinese. |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
867 Pinyin uses a sequence of Latin alphabetic characters for each Chinese |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
868 character. The sequence is made by the combination of the initials |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
869 \(the beginning sounds) and finals (the ending sounds). |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
870 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
871 initials: b p m f d t n l z c s zh ch sh r j q x g k h |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
872 finals: a o e i er ai ei oa ou an en ang eng ong i ia iao ie iu ian in |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
873 iang ing iong u ua uo uai ui uan un uan ueng yu yue yuan yun |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
874 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
875 (Note: In the correct Pinyin writing, the sequence \"yu\" in the last |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
876 four finals should be written by the character u-umlaut `$A(9(B'.) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
877 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
878 With this input method, you enter a Chinese character by first |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
879 entering its pinyin spelling. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
880 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
881 \\<quail-translation-docstring> |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
882 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
883 For instance, to input $ADc(B, you type \"n i C-n 3\". The first \"n i\" |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
884 is a Pinyin, \"C-n\" selects the next group of candidates (each group |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
885 contains at most 10 characters), \"3\" select the third character in |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
886 that group. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
887 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
888 This input method supports only Han characters. The related input |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
889 method `chinese-py-punct' is the combination of this method and |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
890 `chinese-punct'; it supports both Han characters and punctuation |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
891 characters. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
892 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
893 For double-width GB2312 characters corresponding to ASCII, use the |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
894 input method `chinese-qj'. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
895 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
896 The correct Pinyin system specifies tones by diacritical marks, but |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
897 this input method doesn't use them, which results in easy (you don't |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
898 have to know the exact tones), but verbose (many characters are assigned |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
899 to the same key sequence) input. You may also want to try the input |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
900 method `chinese-tonepy' with which you must specify tones by digits |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
901 \(1..5).")) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
902 (insert " '((\"\C-?\" . quail-delete-last-char) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
903 (\".\" . quail-next-translation) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
904 (\">\" . quail-next-translation) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
905 (\",\" . quail-prev-translation) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
906 (\"<\" . quail-prev-translation)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
907 nil nil nil nil)\n\n") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
908 (insert "(quail-define-rules\n") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
909 (let ((pos (point))) |
102001
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
910 (insert-buffer-substring-no-properties dicbuf) |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
911 (goto-char pos) |
75504
7a1804e97bdf
(py-converter): Fix previous change.
Kenichi Handa <handa@m17n.org>
parents:
75496
diff
changeset
|
912 (re-search-forward "^[a-z]") |
75496 | 913 (beginning-of-line) |
914 (delete-region pos (point)) | |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
915 (while (not (eobp)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
916 (insert "(\"") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
917 (skip-chars-forward "a-z") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
918 (insert "\" \"") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
919 (delete-char 1) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
920 (end-of-line) |
102001
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
921 (while (= (preceding-char) ?\r) |
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
922 (delete-char -1)) |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
923 (insert "\")") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
924 (forward-line 1))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
925 (insert ")\n")) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
926 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
927 ;; Generate a code of a Quail package in the current buffer from |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
928 ;; Ziranma dictionary in the buffer DICBUF. The input method name of |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
929 ;; the Quail package is NAME, and the title string is TITLE. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
930 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
931 (defun ziranma-converter (dicbuf name title) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
932 (let (dic) |
105813
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102001
diff
changeset
|
933 (with-current-buffer dicbuf |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
934 (goto-char (point-min)) |
102001
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
935 (search-forward "\n%keyname end") |
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
936 (forward-line 1) |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
937 (let ((table (make-hash-table :test 'equal)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
938 elt pos key trans val) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
939 (while (not (eobp)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
940 (setq pos (point)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
941 (skip-chars-forward "^ \t") |
102001
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
942 (setq key (buffer-substring-no-properties pos (point))) |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
943 (skip-chars-forward " \t") |
102001
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
944 (setq pos (point)) |
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
945 (skip-chars-forward "^\r\n") |
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
946 (setq trans (vector (buffer-substring-no-properties pos (point)))) |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
947 (setq val (gethash key table)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
948 (if val (setq trans (vconcat val trans))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
949 (puthash key trans table) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
950 (forward-line 1)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
951 (maphash #'(lambda (key trans) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
952 (let ((len (length trans)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
953 i) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
954 (if (and (= len 1) (= (length (aref trans 0)) 1)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
955 (setq trans (aref trans 0)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
956 (setq i 0) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
957 (while (and (< i len) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
958 (= (length (aref trans i)) 1)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
959 (setq i (1+ i))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
960 (if (= i len) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
961 (setq trans (mapconcat 'identity trans ""))))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
962 (setq dic (cons (cons key trans) dic))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
963 table))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
964 (setq dic (sort dic (function (lambda (x y) (string< (car x) (car y)))))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
965 (goto-char (point-max)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
966 (insert (format "%S\n" "$A::WVJdHk!K!>WTH;!?!K(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
967 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
968 $A<|EL6TUU1m(B: |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
969 $A)3)%)%)W)%)%)W)%)%)W)%)%)W)%)%)W)%)%)W)%)%)W)%)%)W)%)%)W)%)%)7(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
970 $A)'#Q(B $A)'#W(B $A)'#E(B $A)'#R(B $A)'#T(B $A)'#Y(B $A)'#U(Bsh$A)'#I(Bch$A)'#O(B $A)'#P(B $A)'(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
971 $A)'(B iu$A)'(B ua$A)'(B e$A)'(B uan$A)'(B ue$A)'(B uai$A)'(B u$A)'(B i$A)'(B o$A)'(B un$A)'(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
972 $A)'(B $A)'(B ia$A)'(B $A)'(B van$A)'(B ve$A)'(B ing$A)'(B $A)'(B $A)'(B uo$A)'(B vn$A)'(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
973 $A);)W)%)_)W)%)_)W)%)_)W)%)_)W)%)_)W)%)_)W)%)_)W)%)_)W)%)_)W)%)?(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
974 $A)'#A(B $A)'#S(B $A)'#D(B $A)'#F(B $A)'#G(B $A)'#H(B $A)'#J(B $A)'#K(B $A)'#L(B $A)'(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
975 $A)'(B a$A)'(Biong$A)'(Buang$A)'(B en$A)'(B eng$A)'(B ang$A)'(B an$A)'(B ao$A)'(B ai$A)'(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
976 $A)'(B $A)'(B ong$A)'(Biang$A)'(B $A)'(B ng$A)'(B $A)'(B $A)'(B $A)'(B $A)'(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
977 $A);)W)%)_)W)%)_)W)%)_)W)%)_)W)%)_)W)%)_)W)%)_)W)%)_)W)%)_)W)%)%)7(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
978 $A)'#Z(B $A)'#X(B $A)'#C(B $A)'#V(Bzh$A)'#B(B $A)'#N(B $A)'#M(B $A)'#,(B $A)'#.(B $A)'(B $A#/(B $A)'(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
979 $A)'(B ei$A)'(B ie$A)'(B iao$A)'(B ui$A)'(B ou$A)'(B in$A)'(B ian$A)'G0R3)':sR3)'7{:E)'(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
980 $A)'(B $A)'(B $A)'(B $A)'(B v$A)'(B $A)'(B $A)'(B $A)'(B $A)'(B $A)'(B $A)'(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
981 $A);)%)%)_)%)%)_)%)%)_)%)%)_)%)%)_)%)%)_)%)%)_)%)%)_)%)%)_)%)%)?(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
982 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
983 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
984 Pinyin base input method for Chinese GB2312 characters (`chinese-gb2312'). |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
985 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
986 Pinyin is the standard roman transliteration method for Chinese. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
987 For the details of Pinyin system, see the documentation of the input |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
988 method `chinese-py'. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
989 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
990 Unlike the standard spelling of Pinyin, in this input method all |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
991 initials and finals are assigned to single keys (see the above table). |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
992 For instance, the initial \"ch\" is assigned to the key `i', the final |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
993 \"iu\" is assigned to the key `q', and tones 1, 2, 3, 4, and $AGaIy(B are |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
994 assigned to the keys `q', `w', `e', `r', `t' respectively. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
995 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
996 \\<quail-translation-docstring> |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
997 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
998 To input one-letter words, you type 4 keys, the first two for the |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
999 Pinyin of the letter, next one for tone, and the last one is always a |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1000 quote ('). For instance, \"vsq'\" input $AVP(B. Exceptions are these |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1001 letters. You can input them just by typing a single key. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1002 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1003 Character: $A04(B $A2;(B $A4N(B $A5D(B $A6~(B $A7"(B $A8v(B $A:M(B $A3v(B $A<0(B $A?I(B $AAK(B $AC;(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1004 Key: a b c d e f g h i j k l m |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1005 Character: $ADc(B $AE7(B $AF,(B $AF_(B $AHK(B $AH}(B $AK{(B $AJG(B $AWE(B $ANR(B $AP!(B $AR;(B $ATZ(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1006 Key: n o p q r s t u v w x y z |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1007 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1008 To input two-letter words, you have two ways. One way is to type 4 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1009 keys, two for the first Pinyin, two for the second Pinyin. For |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1010 instance, \"vsgo\" inputs $AVP9z(B. Another way is to type 3 keys: 2 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1011 initials of two letters, and quote ('). For instance, \"vg'\" also |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1012 inputs $AVP9z(B. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1013 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1014 To input three-letter words, you type 4 keys: initials of three |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1015 letters, and the last is quote ('). For instance, \"bjy'2\" inputs $A11(B |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1016 $A>)Q<(B (the last `2' is to select one of the candidates). |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1017 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1018 To input words of more than three letters, you type 4 keys, initials |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1019 of the first three letters and the last letter. For instance, |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1020 \"bjdt\" inputs $A11>)5gJSL((B. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1021 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1022 To input symbols and punctuations, type `/' followed by one of `a' to |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1023 `z', then select one of the candidates.")) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1024 (insert " '((\"\C-?\" . quail-delete-last-char) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1025 (\".\" . quail-next-translation) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1026 (\"[\" . quail-next-translation) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1027 (\",\" . quail-prev-translation) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1028 (\"]\" . quail-prev-translation)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1029 nil nil nil nil)\n\n") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1030 (insert "(quail-define-rules\n") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1031 (dolist (elt dic) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1032 (insert (format "(%S %S)\n" (car elt) (cdr elt)))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1033 (insert ")\n"))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1034 |
37875
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1035 ;; Generate the code for a Quail package in the current buffer from a |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1036 ;; CTLau or CTLau-b5 dictionary in the buffer DICBUF. The input |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1037 ;; method name of the Quail package is NAME, and the title string is |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1038 ;; TITLE. DESCRIPTION is the string shown by describe-input-method. |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1039 |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1040 (defun ctlau-converter (dicbuf name title description) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1041 (goto-char (point-max)) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1042 (insert (format "%S\n" description)) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1043 (insert " '((\"\C-?\" . quail-delete-last-char) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1044 (\".\" . quail-next-translation) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1045 (\">\" . quail-next-translation) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1046 (\",\" . quail-prev-translation) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1047 (\"<\" . quail-prev-translation)) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1048 nil nil nil nil)\n\n") |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1049 (insert "(quail-define-rules\n") |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1050 (let (dicbuf-start dicbuf-end key-start key (pos (point))) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1051 ;; Find the dictionary, which starts below a horizontal rule and |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1052 ;; ends at the second to last line in the HTML file. |
105813
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102001
diff
changeset
|
1053 (with-current-buffer dicbuf |
37875
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1054 (goto-char (point-min)) |
102001
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
1055 (re-search-forward "^#<hr>") |
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
1056 (forward-line 1) |
37875
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1057 (setq dicbuf-start (point)) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1058 (goto-char (point-max)) |
102001
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
1059 (re-search-backward "^<hr>") |
37875
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1060 (setq dicbuf-end (point))) |
102001
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
1061 (insert-buffer-substring-no-properties dicbuf dicbuf-start dicbuf-end) |
37875
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1062 ;; CTLau-b5.html contains characters (0xa1 0xbc) which show up as |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1063 ;; hollow boxes when the original characters in CTLau.html from |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1064 ;; which the file is converted have no Big5 equivalent. Go |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1065 ;; through and delete them. |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1066 (goto-char pos) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1067 (while (search-forward "$(0!{(B" nil t) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1068 (delete-char -1)) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1069 ;; Uppercase keys in dictionary need to be downcased. Backslashes |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1070 ;; at the beginning of keys need to be turned into double |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1071 ;; backslashes. |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1072 (goto-char pos) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1073 (while (not (eobp)) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1074 (insert "(\"") |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1075 (if (char-equal (following-char) ?\\) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1076 (insert "\\")) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1077 (setq key-start (point)) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1078 (skip-chars-forward "\\\\A-Z") |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1079 (downcase-region key-start (point)) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1080 (insert "\" \"") |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1081 (delete-char 1) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1082 (end-of-line) |
102001
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
1083 (while (= (preceding-char) ?\r) |
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
1084 (delete-char -1)) |
37875
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1085 (insert "\")") |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1086 (forward-line 1))) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1087 (insert ")\n")) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1088 |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1089 (defun ctlau-gb-converter (dicbuf name title) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1090 (ctlau-converter dicbuf name title |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1091 "$A::WVJdHk!KAuN}OiJ=TARt!K(B |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1092 |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1093 $AAuN}OiJ=TASoW"Rt7=08(B |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1094 Sidney Lau's Cantonese transcription scheme as described in his book |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1095 \"Elementary Cantonese\", The Government Printer, Hong Kong, 1972. |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1096 This file was prepared by Fung Fung Lee ($A@n7c7e(B). |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1097 Originally converted from CTCPS3.tit |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1098 Last modified: June 2, 1993. |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1099 |
37888
2e08c7d128e6
2001-05-25 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37884
diff
changeset
|
1100 Some infrequent GB characters are accessed by typing \\, followed by |
37875
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1101 the Cantonese romanization of the respective radical ($A2?JW(B).")) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1102 |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1103 (defun ctlau-b5-converter (dicbuf name title) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1104 (ctlau-converter dicbuf name title |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1105 "$(0KH)tTT&,!(N,Tg>A*#Gn5x!((B |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1106 |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1107 $(0N,Tg>A*#GnM$0D5x'J7{(B |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1108 Sidney Lau's Cantonese transcription scheme as described in his book |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1109 \"Elementary Cantonese\", The Government Printer, Hong Kong, 1972. |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1110 This file was prepared by Fung Fung Lee ($(0,XFS76(B). |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1111 Originally converted from CTCPS3.tit |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1112 Last modified: June 2, 1993. |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1113 |
37888
2e08c7d128e6
2001-05-25 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37884
diff
changeset
|
1114 Some infrequent characters are accessed by typing \\, followed by |
37875
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1115 the Cantonese romanization of the respective radical ($(0?f5}(B).")) |
91cf555a6d8d
2001-05-24 Andrew Choi <akochoi@i-cable.com>
Andrew Choi <akochoi@shaw.ca>
parents:
37262
diff
changeset
|
1116 |
87119
9c2d6ea3390d
Remove directory part from filenames in function declarations.
Glenn Morris <rgm@gnu.org>
parents:
86289
diff
changeset
|
1117 (declare-function dos-8+3-filename "dos-fns.el" (filename)) |
86289
8a7ed478f7bc
* international/titdic-cnv.el (dos-8+3-filename):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78310
diff
changeset
|
1118 |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1119 (defun miscdic-convert (filename &optional dirname) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48760
diff
changeset
|
1120 "Convert a dictionary file FILENAME into a Quail package. |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1121 Optional argument DIRNAME if specified is the directory name under which |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1122 the generated Quail package is saved." |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1123 (interactive "FInput method dictionary file: ") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1124 (or (file-readable-p filename) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1125 (error "%s does not exist" filename)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1126 (let ((tail quail-misc-package-ext-info) |
90030
f624e8fd4723
(tit-process-header): Fix embedded
Kenichi Handa <handa@m17n.org>
parents:
89943
diff
changeset
|
1127 coding-system-for-write |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1128 slot |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1129 name title dicfile coding quailfile converter copyright |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1130 dicbuf) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1131 (while tail |
55280
181520e900b2
(miscdic-convert): Don't generate a
Kenichi Handa <handa@m17n.org>
parents:
52415
diff
changeset
|
1132 (setq slot (car tail) |
181520e900b2
(miscdic-convert): Don't generate a
Kenichi Handa <handa@m17n.org>
parents:
52415
diff
changeset
|
1133 dicfile (nth 2 slot) |
181520e900b2
(miscdic-convert): Don't generate a
Kenichi Handa <handa@m17n.org>
parents:
52415
diff
changeset
|
1134 quailfile (nth 4 slot)) |
181520e900b2
(miscdic-convert): Don't generate a
Kenichi Handa <handa@m17n.org>
parents:
52415
diff
changeset
|
1135 (when (and (or (string-match dicfile filename) |
181520e900b2
(miscdic-convert): Don't generate a
Kenichi Handa <handa@m17n.org>
parents:
52415
diff
changeset
|
1136 ;; MS-DOS filesystem truncates file names to 8+3 |
181520e900b2
(miscdic-convert): Don't generate a
Kenichi Handa <handa@m17n.org>
parents:
52415
diff
changeset
|
1137 ;; limits, so "cangjie-table.cns" becomes |
181520e900b2
(miscdic-convert): Don't generate a
Kenichi Handa <handa@m17n.org>
parents:
52415
diff
changeset
|
1138 ;; "cangjie-.cns", and the above string-match |
181520e900b2
(miscdic-convert): Don't generate a
Kenichi Handa <handa@m17n.org>
parents:
52415
diff
changeset
|
1139 ;; fails. Give DOS users a chance... |
181520e900b2
(miscdic-convert): Don't generate a
Kenichi Handa <handa@m17n.org>
parents:
52415
diff
changeset
|
1140 (and (fboundp 'msdos-long-file-names) |
181520e900b2
(miscdic-convert): Don't generate a
Kenichi Handa <handa@m17n.org>
parents:
52415
diff
changeset
|
1141 (not (msdos-long-file-names)) |
181520e900b2
(miscdic-convert): Don't generate a
Kenichi Handa <handa@m17n.org>
parents:
52415
diff
changeset
|
1142 (string-match (dos-8+3-filename dicfile) filename))) |
181520e900b2
(miscdic-convert): Don't generate a
Kenichi Handa <handa@m17n.org>
parents:
52415
diff
changeset
|
1143 (if (file-newer-than-file-p |
181520e900b2
(miscdic-convert): Don't generate a
Kenichi Handa <handa@m17n.org>
parents:
52415
diff
changeset
|
1144 filename (expand-file-name quailfile dirname)) |
181520e900b2
(miscdic-convert): Don't generate a
Kenichi Handa <handa@m17n.org>
parents:
52415
diff
changeset
|
1145 t |
181520e900b2
(miscdic-convert): Don't generate a
Kenichi Handa <handa@m17n.org>
parents:
52415
diff
changeset
|
1146 (message "%s is up to date" quailfile) |
181520e900b2
(miscdic-convert): Don't generate a
Kenichi Handa <handa@m17n.org>
parents:
52415
diff
changeset
|
1147 nil)) |
181520e900b2
(miscdic-convert): Don't generate a
Kenichi Handa <handa@m17n.org>
parents:
52415
diff
changeset
|
1148 (setq name (car slot) |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1149 title (nth 1 slot) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1150 coding (nth 3 slot) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1151 converter (nth 5 slot) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1152 copyright (nth 6 slot)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1153 (message "Converting %s to %s..." dicfile quailfile) |
90753 | 1154 ;; Explicitly set eol format to `unix'. |
1155 (setq coding-system-for-write | |
1156 (coding-system-change-eol-conversion coding 'unix)) | |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1157 (with-temp-file (expand-file-name quailfile dirname) |
90743 | 1158 (insert (format ";; Quail package `%s' -*- coding:%s; " name coding)) |
1159 (insert "byte-compile-disable-print-circle:t; -*-\n") | |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1160 (insert ";; Generated by the command `miscdic-convert'\n") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1161 (insert ";; Date: " (current-time-string) "\n") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1162 (insert ";; Source dictionary file: " dicfile "\n") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1163 (insert ";; Copyright notice of the source file\n") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1164 (insert ";;------------------------------------------------------\n") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1165 (insert copyright "\n") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1166 (insert ";;------------------------------------------------------\n") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1167 (insert "\n") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1168 (insert ";;; Code:\n\n") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1169 (insert "(require 'quail)\n") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1170 (insert "(quail-define-package \"" name "\" \"" |
90030
f624e8fd4723
(tit-process-header): Fix embedded
Kenichi Handa <handa@m17n.org>
parents:
89943
diff
changeset
|
1171 (if (eq coding 'big5) "Chinese-BIG5" |
f624e8fd4723
(tit-process-header): Fix embedded
Kenichi Handa <handa@m17n.org>
parents:
89943
diff
changeset
|
1172 (if (eq coding 'iso-2022-cn-ext) "Chinese-CNS" |
f624e8fd4723
(tit-process-header): Fix embedded
Kenichi Handa <handa@m17n.org>
parents:
89943
diff
changeset
|
1173 "Chinese-GB")) |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1174 "\" \"" title "\" t\n") |
102001
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
1175 (let* ((coding-system-for-read |
475e90a4fafc
(tit-process-header): Use
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
1176 (coding-system-change-eol-conversion coding 'unix)) |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1177 (dicbuf (find-file-noselect filename))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1178 (funcall converter dicbuf name title) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1179 (kill-buffer dicbuf))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1180 (message "Converting %s to %s...done" dicfile quailfile)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1181 (setq tail (cdr tail))))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1182 |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1183 (defun batch-miscdic-convert () |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1184 "Run `miscdic-convert' on the files remaing on the command line. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1185 Use this from the command line, with `-batch'; |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1186 it won't work in an interactive Emacs. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1187 If there's an argument \"-dir\", the next argument specifies a directory |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1188 to store generated Quail packages." |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1189 (defvar command-line-args-left) ; Avoid compiler warning. |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1190 (if (not noninteractive) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1191 (error "`batch-miscdic-convert' should be used only with -batch")) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1192 (let ((dir default-directory) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1193 filename) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1194 (while command-line-args-left |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1195 (if (string= (car command-line-args-left) "-dir") |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1196 (progn |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1197 (setq command-line-args-left (cdr command-line-args-left)) |
48666
12b6e8b2db2f
(quail-misc-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
46670
diff
changeset
|
1198 (setq dir (car command-line-args-left)) |
12b6e8b2db2f
(quail-misc-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
46670
diff
changeset
|
1199 (setq command-line-args-left (cdr command-line-args-left)))) |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1200 (setq filename (car command-line-args-left) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1201 command-line-args-left (cdr command-line-args-left)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1202 (if (file-directory-p filename) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1203 (dolist (file (directory-files filename t nil t)) |
90030
f624e8fd4723
(tit-process-header): Fix embedded
Kenichi Handa <handa@m17n.org>
parents:
89943
diff
changeset
|
1204 (or (file-directory-p file) |
f624e8fd4723
(tit-process-header): Fix embedded
Kenichi Handa <handa@m17n.org>
parents:
89943
diff
changeset
|
1205 (miscdic-convert file dir))) |
37116
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1206 (miscdic-convert filename dir)))) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1207 (kill-emacs 0)) |
dafc644df705
(quail-cxterm-package-ext-info):
Kenichi Handa <handa@m17n.org>
parents:
36995
diff
changeset
|
1208 |
36684
61687d474d90
Add coding: tag in Local Variables: section.
Kenichi Handa <handa@m17n.org>
parents:
32277
diff
changeset
|
1209 ;; Local Variables: |
61687d474d90
Add coding: tag in Local Variables: section.
Kenichi Handa <handa@m17n.org>
parents:
32277
diff
changeset
|
1210 ;; coding: iso-2022-7bit |
61687d474d90
Add coding: tag in Local Variables: section.
Kenichi Handa <handa@m17n.org>
parents:
32277
diff
changeset
|
1211 ;; End: |
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37888
diff
changeset
|
1212 |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
91327
diff
changeset
|
1213 ;; arch-tag: 8ad478b2-a985-4da2-b47f-d8ee5d7c24a3 |
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37888
diff
changeset
|
1214 ;;; titdic-cnv.el ends here |