1 ;;; egg-com.el --- Communication Routines in Egg Input Method Architecture
3 ;; Copyright (C) 1999, 2000 Free Software Foundation, Inc
5 ;; Author: Hisashi Miyashita <himi@bird.scphys.kyoto-u.ac.jp>
6 ;; NIIBE Yutaka <gniibe@chroot.org>
7 ;; KATAYAMA Yoshio <kate@pfu.co.jp> ; Korean, Chinese support.
9 ;; Maintainer: TOMURA Satoru <tomura@etl.go.jp>
11 ;; Keywords: mule, multilingual, input method
13 ;; This file is part of EGG.
15 ;; EGG is free software; you can redistribute it and/or modify
16 ;; it under the terms of the GNU General Public License as published by
17 ;; the Free Software Foundation; either version 2, or (at your option)
20 ;; EGG is distributed in the hope that it will be useful,
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;; GNU General Public License for more details.
25 ;; You should have received a copy of the GNU General Public License
26 ;; along with GNU Emacs; see the file COPYING. If not, write to the
27 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
28 ;; Boston, MA 02111-1307, USA.
37 (defvar egg-fixed-euc '(fixed-euc-jp))
38 (make-variable-buffer-local 'egg-fixed-euc)
39 (put 'egg-fixed-euc 'permanent-local t)
41 (defvar egg-mb-euc 'euc-japan)
42 (make-variable-buffer-local 'egg-mb-euc)
43 (put 'egg-mb-euc 'permanent-local t)
48 (define-ccl-program ccl-decode-fixed-euc-jp
50 ((r2 = ,(charset-id 'japanese-jisx0208))
51 (r3 = ,(charset-id 'japanese-jisx0212))
52 (r4 = ,(charset-id 'katakana-jisx0201))
59 (write-read-repeat r0))
61 (write-read-repeat r0))
65 (write-read-repeat r0))
68 (write-read-repeat r0)))))))))
70 (define-ccl-program ccl-encode-fixed-euc-jp
74 (if (r0 == ,(charset-id 'latin-jisx0201)) ; Unify
79 (write-read-repeat r0)))
80 (r6 = (r0 == ,(charset-id 'japanese-jisx0208)))
81 (r6 |= (r0 == ,(charset-id 'japanese-jisx0208-1978)))
86 (write-read-repeat r0)))
87 (if (r0 == ,(charset-id 'katakana-jisx0201)) ;G2
90 (write-read-repeat r0)))
91 (if (r0 == ,(charset-id 'japanese-jisx0212)) ;G3
96 (write-read-repeat r0)))
101 (make-coding-system 'fixed-euc-jp 4 ?W "Coding System for fixed EUC Japanese"
102 (cons ccl-decode-fixed-euc-jp ccl-encode-fixed-euc-jp))
107 (define-ccl-program ccl-decode-fixed-euc-kr
109 ((r2 = ,(charset-id 'korean-ksc5601))
117 (write-read-repeat r0)))))
119 (define-ccl-program ccl-encode-fixed-euc-kr
125 (write-read-repeat r0)))
126 (if (r0 == ,(charset-id 'korean-ksc5601))
130 (write-read-repeat r0)))
135 (make-coding-system 'fixed-euc-kr 4 ?W "Coding System for fixed EUC Korean"
136 (cons ccl-decode-fixed-euc-kr ccl-encode-fixed-euc-kr))
139 (defconst egg-pinyin-shengmu
140 '(("" . 0) ("B" . 1) ("C" . 2) ("Ch" . 3) ("D" . 4)
141 ("F" . 5) ("G" . 6) ("H" . 7) ("J" . 8) ("K" . 9)
142 ("L" . 10) ("M" . 11) ("N" . 12) ("P" . 13) ("Q" . 14)
143 ("R" . 15) ("S" . 16) ("Sh" . 17) ("T" . 18) ("W" . 19)
144 ("X" . 20) ("Y" . 21) ("Z" . 22) ("Zh" . 23)))
146 (defconst egg-pinyin-yunmu
147 '(("
\e(0@
\e(B" 0 0) ("
\e(0@
\e(B" 0 1) ("
\e(0@
\e(B" 0 3) ("
\e(0@
\e(B" 0 5) ("
\e(0@
\e(B" 0 7)
148 ("a
\e(0@
\e(B" 1 0) ("
\e(0!@
\e(B" 1 1) ("
\e(0"@
\e(B" 1 3) ("
\e(0#@
\e(B" 1 5) ("
\e(0$@
\e(B" 1 7)
149 ("ai
\e(0@
\e(B" 2 0) ("
\e(0!
\e(Bi
\e(0@
\e(B" 2 1) ("
\e(0"
\e(Bi
\e(0@
\e(B" 2 3) ("
\e(0#
\e(Bi
\e(0@
\e(B" 2 5) ("
\e(0$
\e(Bi
\e(0@
\e(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 0 0 1
207 0 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 0 1 0 0 0 0 0 0 1 1 1 0 0 1 0 0 1 1 1 0 0 1
208 0 1 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1
209 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 0 0 1 0 1 0 1 0 0 0 1
210 0 1 0 1 1 1 1 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 1 1 1 1 0 0 1 0 1 0 1 0 0 0 1
211 0 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 1 1 1 0 0 1
212 0 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 0 0 1
215 (defconst egg-zhuyin-shengmu
216 '(("" . 0) ("
\e(0E
\e(B" . 1) ("
\e(0X
\e(B" . 2) ("
\e(0T
\e(B" . 3) ("
\e(0I
\e(B" . 4)
217 ("
\e(0H
\e(B" . 5) ("
\e(0M
\e(B" . 6) ("
\e(0O
\e(B" . 7) ("
\e(0P
\e(B" . 8) ("
\e(0N
\e(B" . 9)
218 ("
\e(0L
\e(B" . 10) ("
\e(0G
\e(B" . 11) ("
\e(0K
\e(B" . 12) ("
\e(0F
\e(B" . 13) ("
\e(0Q
\e(B" . 14)
219 ("
\e(0V
\e(B" . 15) ("
\e(0Y
\e(B" . 16) ("
\e(0U
\e(B" . 17) ("
\e(0J
\e(B" . 18) ("
\e(0h
\e(B" . 19)
220 ("
\e(0R
\e(B" . 20) ("
\e(0g
\e(B" . 21) ("
\e(0W
\e(B" . 22) ("
\e(0S
\e(B" . 23)))
222 (defconst egg-zhuyin-yunmu
223 '(("
\e(0@
\e(B" 0 0) ("
\e(0A
\e(B" 0 1) ("
\e(0B
\e(B" 0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B" 10 0) ("
\e(0fA
\e(B" 10 1) ("
\e(0fB
\e(B" 10 3) ("
\e(0fC
\e(B" 10 5) ("
\e(0fD
\e(B" 10 7) ; er
234 ("
\e(0g@
\e(B" 11 0) ("
\e(0gA
\e(B" 11 1) ("
\e(0gB
\e(B" 11 3) ("
\e(0gC
\e(B" 11 5) ("
\e(0gD
\e(B" 11 7) ; i
235 ("
\e(0gZ@
\e(B" 12 0) ("
\e(0gZA
\e(B" 12 1) ("
\e(0gZB
\e(B" 12 3) ("
\e(0gZC
\e(B" 12 5) ("
\e(0gZD
\e(B" 12 7) ; ia
236 ("
\e(0gb@
\e(B" 13 0) ("
\e(0gbA
\e(B" 13 1) ("
\e(0gbB
\e(B" 13 3) ("
\e(0gbC
\e(B" 13 5) ("
\e(0gbD
\e(B" 13 7) ; ian
237 ("
\e(0gd@
\e(B" 14 0) ("
\e(0gdA
\e(B" 14 1) ("
\e(0gdB
\e(B" 14 3) ("
\e(0gdC
\e(B" 14 5) ("
\e(0gdD
\e(B" 14 7) ; iang
238 ("
\e(0g`@
\e(B" 15 0) ("
\e(0g`A
\e(B" 15 1) ("
\e(0g`B
\e(B" 15 3) ("
\e(0g`C
\e(B" 15 5) ("
\e(0g`D
\e(B" 15 7) ; iao
239 ("
\e(0g]@
\e(B" 16 0) ("
\e(0g]A
\e(B" 16 1) ("
\e(0g]B
\e(B" 16 3) ("
\e(0g]C
\e(B" 16 5) ("
\e(0g]D
\e(B" 16 7) ; ie
240 ("
\e(0gc@
\e(B" 17 0) ("
\e(0gcA
\e(B" 17 1) ("
\e(0gcB
\e(B" 17 3) ("
\e(0gcC
\e(B" 17 5) ("
\e(0gcD
\e(B" 17 7) ; in
241 ("
\e(0ge@
\e(B" 18 0) ("
\e(0geA
\e(B" 18 1) ("
\e(0geB
\e(B" 18 3) ("
\e(0geC
\e(B" 18 5) ("
\e(0geD
\e(B" 18 7) ; ing
242 ("
\e(0ie@
\e(B" 19 0) ("
\e(0ieA
\e(B" 19 1) ("
\e(0ieB
\e(B" 19 3) ("
\e(0ieC
\e(B" 19 5) ("
\e(0ieD
\e(B" 19 7) ; iong
243 ("
\e(0ga@
\e(B" 20 0) ("
\e(0gaA
\e(B" 20 1) ("
\e(0gaB
\e(B" 20 3) ("
\e(0gaC
\e(B" 20 5) ("
\e(0gaD
\e(B" 20 7) ; iu
244 ("
\e(0G@
\e(B" 21 0) ("
\e(0GA
\e(B" 21 1) ("
\e(0GB
\e(B" 21 3) ("
\e(0GC
\e(B" 21 5) ("
\e(0GD
\e(B" 21 7) ; m
245 ("
\e(0K@
\e(B" 22 0) ("
\e(0KA
\e(B" 22 1) ("
\e(0KB
\e(B" 22 3) ("
\e(0KC
\e(B" 22 5) ("
\e(0KD
\e(B" 22 7) ; n
246 ("@
\e(0@
\e(B" 23 0) ("@
\e(0A
\e(B" 23 1) ("@
\e(0B
\e(B" 23 3) ("@
\e(0C
\e(B" 23 5) ("@
\e(0D
\e(B" 23 7) ; ng
247 ("
\e(0[@
\e(B" 24 0) ("
\e(0[A
\e(B" 24 1) ("
\e(0[B
\e(B" 24 3) ("
\e(0[C
\e(B" 24 5) ("
\e(0[D
\e(B" 24 7) ; o
248 ("
\e(0he@
\e(B" 25 0) ("
\e(0heA
\e(B" 25 1) ("
\e(0heB
\e(B" 25 3) ("
\e(0heC
\e(B" 25 5) ("
\e(0heD
\e(B" 25 7) ; ong
249 ("
\e(0a@
\e(B" 26 0) ("
\e(0aA
\e(B" 26 1) ("
\e(0aB
\e(B" 26 3) ("
\e(0aC
\e(B" 26 5) ("
\e(0aD
\e(B" 26 7) ; ou
250 ("
\e(0h@
\e(B" 27 0) ("
\e(0hA
\e(B" 27 1) ("
\e(0hB
\e(B" 27 3) ("
\e(0hC
\e(B" 27 5) ("
\e(0hD
\e(B" 27 7) ; u
251 ("
\e(0hZ@
\e(B" 28 0) ("
\e(0hZA
\e(B" 28 1) ("
\e(0hZB
\e(B" 28 3) ("
\e(0hZC
\e(B" 28 5) ("
\e(0hZD
\e(B" 28 7) ; ua
252 ("
\e(0h^@
\e(B" 29 0) ("
\e(0h^A
\e(B" 29 1) ("
\e(0h^B
\e(B" 29 3) ("
\e(0h^C
\e(B" 29 5) ("
\e(0h^D
\e(B" 29 7) ; uai
253 ("
\e(0hb@
\e(B" 30 0) ("
\e(0hbA
\e(B" 30 1) ("
\e(0hbB
\e(B" 30 3) ("
\e(0hbC
\e(B" 30 5) ("
\e(0hbD
\e(B" 30 7) ; uan
254 ("
\e(0hd@
\e(B" 31 0) ("
\e(0hdA
\e(B" 31 1) ("
\e(0hdB
\e(B" 31 3) ("
\e(0hdC
\e(B" 31 5) ("
\e(0hdD
\e(B" 31 7) ; uang
255 ("
\e(0i]@
\e(B" 37 0) ("
\e(0i]A
\e(B" 37 1) ("
\e(0i]B
\e(B" 37 3) ("
\e(0i]C
\e(B" 37 5) ("
\e(0i]D
\e(B" 37 7) ; ue
256 ("
\e(0h_@
\e(B" 33 0) ("
\e(0h_A
\e(B" 33 1) ("
\e(0h_B
\e(B" 33 3) ("
\e(0h_C
\e(B" 33 5) ("
\e(0h_D
\e(B" 33 7) ; ui
257 ("
\e(0hc@
\e(B" 34 0) ("
\e(0hcA
\e(B" 34 1) ("
\e(0hcB
\e(B" 34 3) ("
\e(0hcC
\e(B" 34 5) ("
\e(0hcD
\e(B" 34 7) ; un
258 ("
\e(0h[@
\e(B" 35 0) ("
\e(0h[A
\e(B" 35 1) ("
\e(0h[B
\e(B" 35 3) ("
\e(0h[C
\e(B" 35 5) ("
\e(0h[D
\e(B" 35 7) ; uo
259 ("
\e(0i@
\e(B" 36 0) ("
\e(0iA
\e(B" 36 1) ("
\e(0iB
\e(B" 36 3) ("
\e(0iC
\e(B" 36 5) ("
\e(0iD
\e(B" 36 7) ;
\e(09
\e(B
260 ("
\e(0i]@
\e(B" 37 0) ("
\e(0i]A
\e(B" 37 1) ("
\e(0i]B
\e(B" 37 3) ("
\e(0i]C
\e(B" 37 5) ("
\e(0i]D
\e(B" 37 7) ;
\e(09
\e(Be
261 ("0
\e(0@
\e(B" 38 0) ("1
\e(0A
\e(B" 38 1) ("2
\e(0B
\e(B" 38 3) ("3
\e(0C
\e(B" 38 5) ("4
\e(0D
\e(B" 38 7) ; undefined
262 ("
\e(0ib@
\e(B" 39 0) ("
\e(0ibA
\e(B" 39 1) ("
\e(0ibB
\e(B" 39 3) ("
\e(0ibC
\e(B" 39 5) ("
\e(0ibD
\e(B" 39 7) ;
\e(09
\e(Ban
263 ("
\e(0ic@
\e(B" 40 0) ("
\e(0icA
\e(B" 40 1) ("
\e(0icB
\e(B" 40 3) ("
\e(0icC
\e(B" 40 5) ("
\e(0icD
\e(B" 40 7) ;
\e(09
\e(Bn
266 (defconst egg-zhuyin-table
269 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
270 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x9586 ?\x0000 ?\x9592 ?\x9599
271 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x0000 ?\x0000
272 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x959b ?\x95a0 ?\x0000 ?\x959e
275 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000
276 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
277 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x0000
278 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
281 ?\x828b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
282 ?\x0000 ?\x0280 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
283 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
284 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
287 ?\x838b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000
288 ?\x0000 ?\x0380 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
289 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
290 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
293 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
294 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x0000
295 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
296 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
299 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000
300 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
301 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
302 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
305 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
306 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
307 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
308 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
311 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
312 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
313 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
314 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
317 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
318 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
319 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x08a4 ?\x0000 ?\x0000
320 ?\x08a7 ?\x0000 ?\x08a5 ?\x0000 ?\x08a8 ?\x0000 ?\x889b ?\x88a0 ?\x8000 ?\x889e
323 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
324 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
325 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
326 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
329 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000
330 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
331 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
332 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
335 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
336 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
337 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
338 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
341 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
342 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
343 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
344 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
347 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000
348 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
349 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
350 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
353 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
354 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
355 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0ea4 ?\x0000 ?\x0000
356 ?\x0ea7 ?\x0000 ?\x0ea5 ?\x0000 ?\x0ea8 ?\x0000 ?\x8e9b ?\x8ea0 ?\x8000 ?\x8e9e
359 ?\x8f8b ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000
360 ?\x0000 ?\x0f80 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
361 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
362 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
365 ?\x908b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000
366 ?\x0000 ?\x1080 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
367 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
368 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
371 ?\x918b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
372 ?\x0000 ?\x1180 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
373 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
374 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
377 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000
378 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x0000
379 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
380 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
383 ?\x939b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000
384 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
385 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x0000 ?\x1380 ?\x0000 ?\x0000
386 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
389 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
390 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
391 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x14a4 ?\x0000 ?\x0000
392 ?\x14a7 ?\x0000 ?\x14a5 ?\x0000 ?\x14a8 ?\x0000 ?\x949b ?\x94a0 ?\x8000 ?\x949e
395 ?\x958b ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0090 ?\x0000 ?\x9591 ?\x9592
396 ?\x0000 ?\x1580 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x1588 ?\x1589 ?\x0000
397 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0093 ?\x8000 ?\x00a4 ?\x0000 ?\x0000
398 ?\x00a7 ?\x0000 ?\x00a5 ?\x0000 ?\x00a8 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
401 ?\x968b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
402 ?\x0000 ?\x1680 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
403 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
404 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
407 ?\x978b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
408 ?\x0000 ?\x1780 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
409 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
410 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
414 (defconst egg-chinese-syllable-max-len
415 (max (length "Zhu
\e(0!
\e(Bng
\e(0@
\e(B") (length "
\e(0ShdA
\e(B")))
417 (defun egg-chinese-syllable (str pos)
418 (setq str (substring str pos (min (length str)
419 (+ pos egg-chinese-syllable-max-len))))
420 (or (car (egg-pinyin-syllable str))
421 (car (egg-zhuyin-syllable str))))
423 (defsubst egg-make-fixed-euc-china-code (s y)
425 (+ (* 2 (nth 1 y)) (logand (nth 2 y) 1) 32)
426 (+ (* 4 (if (= s 0) 20 s)) (lsh (nth 2 y) -1) 156)))
428 (defun egg-pinyin-syllable (str)
429 (if (eq (string-match "^[A-Za-z
\e(0!
\e(B-
\e(0?
\e(B]+
\e(0@
\e(B" str) 0)
431 (setq end (match-end 0))
433 ((setq s (cdr (assoc (substring str 0 2) egg-pinyin-shengmu)))
434 (setq y (substring str 2 end)))
435 ((setq s (cdr (assoc (substring str 0 1) egg-pinyin-shengmu)))
436 (setq y (substring str 1 end)))
438 (setq s 0 y (substring str 0 end))))
439 (if (and (setq y (assoc y egg-pinyin-yunmu))
440 (= (aref egg-pinyin-table (+ (* 39 s) (nth 1 y))) 1))
441 (cons end (egg-make-fixed-euc-china-code s y))))))
443 (defun egg-zhuyin-syllable (str)
444 (if (eq (string-match "^[
\e(0E
\e(B-
\e(0i
\e(B@0-4]+[
\e(0@ABCD
\e(B]" str) 0)
445 (let (end s y c z (zhuyin-len (length "
\e(0E
\e(B")))
446 (setq end (match-end 0)
447 c (substring str 0 zhuyin-len)
448 s (cdr (assoc c egg-zhuyin-shengmu))
449 y (assoc (substring str zhuyin-len end) egg-zhuyin-yunmu))
450 (if (or (null (and s y))
451 (and (or (eq s 11) (eq s 12)) (eq (nth 1 y) 0))) ; [
\e(0GK
\e(B][
\e(0@ABCD
\e(B]
453 y (assoc (substring str 0 end) egg-zhuyin-yunmu)))
455 (setq z (aref egg-zhuyin-table (+ (* 41 s) (nth 1 y))))
456 (/= (logand z ?\x8000) 0))
457 (if (/= (logand z ?\x80) 0)
458 (cons end (egg-make-fixed-euc-china-code
459 (logand (lsh z -8) ?\x7f)
460 (list nil (logand z ?\x7f) (nth 2 y))))
461 (cons end (egg-make-fixed-euc-china-code s y)))))))
463 (defun encode-fixed-euc-china-region (beg end type)
464 "Encode the text in the region to EUC-CN/TW."
468 (narrow-to-region beg end)
469 (goto-char (point-min))
470 (while (< (point) (point-max))
471 (setq s (buffer-substring
473 (min (point-max) (+ (point) egg-chinese-syllable-max-len))))
475 ((setq syl (egg-pinyin-syllable s))
476 (delete-region (point) (+ (point) (car syl)))
477 (insert (car (cdr syl)) (cdr (cdr syl))))
478 ((setq syl (egg-zhuyin-syllable s))
479 (delete-region (point) (+ (point) (car syl)))
480 (insert (car (cdr syl)) (cdr (cdr syl))))
482 (setq c (split-char (following-char))
485 ((or (and (eq cset 'chinese-gb2312) (eq type 'cn))
486 (and (eq cset 'chinese-cns11643-1) (eq type 'tw)))
488 (insert (+ (nth 1 c) 128) (+ (nth 2 c) 128)))
489 ((and (eq cset 'chinese-cns11643-2) (eq type 'tw))
491 (insert (+ (nth 1 c) 128) (nth 2 c)))
492 ((eq cset 'chinese-sisheng)
494 (insert 0 (+ (nth 1 c) 128)))
497 (insert 0 (nth 1 c)))
500 (- (point-max) (point-min))))))
502 (defun pre-write-encode-fixed-euc-china (from to type)
503 (let ((buf (current-buffer))
504 (work (get-buffer-create " *pre-write-encoding-work*")))
507 (if (null (stringp from))
510 (setq from (buffer-substring from to))))
511 (insert (string-as-multibyte from))
512 (encode-fixed-euc-china-region 1 (point-max) type)
515 (defun pre-write-encode-euc-cn (from to)
516 (pre-write-encode-fixed-euc-china from to 'cn))
518 (defun pre-write-encode-euc-tw (from to)
519 (pre-write-encode-fixed-euc-china from to 'tw))
521 (defun decode-fixed-euc-china-region (beg end type zhuyin)
522 "Decode EUC-CN/TW encoded text in the region.
523 Return the length of resulting text."
525 (let ((str (string-as-unibyte (buffer-substring beg end)))
528 (delete-region beg end)
529 (setq l (1- (length str)))
531 (setq c0 (aref str i)
537 (insert leading-code-private-11
538 (charset-id 'chinese-sisheng)
544 (insert (charset-id 'chinese-gb2312) c0 (logior c1 ?\x80)))
546 (insert (charset-id 'chinese-cns11643-1) c0 c1))
548 (insert (charset-id 'chinese-cns11643-2) c0 (+ c1 ?\x80)))))
550 (setq c1 (logand c1 ?\x7f))
551 (setq s (- (lsh c1 -2) 7);;(+ (lsh (- c1 32) -2) 1)
552 y (- (lsh c0 -1) 16);;(lsh (- c0 32) -1)
553 ss (+ (logand c0 1) (logand c1 3)))
555 (eq (aref egg-pinyin-table (+ (* 39 20) y)) 0))
558 (setq s (car (nth s egg-pinyin-shengmu))
559 y (car (nth (+ (* 5 y) ss) egg-pinyin-yunmu)))
560 (setq c0 (aref egg-zhuyin-table (+ (* 41 s) y)))
561 (if (eq (logand c0 ?\x8080) ?\x80)
563 y (logand c0 ?\x7f)))
564 (setq s (car (nth s egg-zhuyin-shengmu))
565 y (car (nth (+ (* 5 y) ss) egg-zhuyin-yunmu))))
566 (if enable-multibyte-characters
568 (insert (string-as-unibyte s) (string-as-unibyte y))))))
570 (if (looking-at "\0\0") (forward-char 2))))
572 (defun post-read-decode-fixed-euc-china (len type zhuyin)
574 (buffer-modified-p (buffer-modified-p)))
576 (decode-fixed-euc-china-region pos (+ pos len) type zhuyin)
577 (set-buffer-modified-p buffer-modified-p))))
579 (defun post-read-decode-euc-py-cn (len)
580 (post-read-decode-fixed-euc-china len 'cn nil))
582 (defun post-read-decode-euc-zy-cn (len)
583 (post-read-decode-fixed-euc-china len 'cn t))
585 (defun post-read-decode-euc-py-tw (len)
586 (post-read-decode-fixed-euc-china len 'tw nil))
588 (defun post-read-decode-euc-zy-tw (len)
589 (post-read-decode-fixed-euc-china len 'tw t))
591 (make-coding-system 'fixed-euc-py-cn 0 ?W
592 "Coding System for fixed EUC Chinese-gb2312")
593 (coding-system-put 'fixed-euc-py-cn
594 'pre-write-conversion 'pre-write-encode-euc-cn)
595 (coding-system-put 'fixed-euc-py-cn
596 'post-read-conversion 'post-read-decode-euc-py-cn)
598 (make-coding-system 'fixed-euc-zy-cn 0 ?W
599 "Coding System for fixed EUC Chinese-gb2312")
600 (coding-system-put 'fixed-euc-zy-cn
601 'pre-write-conversion 'pre-write-encode-euc-cn)
602 (coding-system-put 'fixed-euc-zy-cn
603 'post-read-conversion 'post-read-decode-euc-zy-cn)
605 (make-coding-system 'fixed-euc-py-tw 0 ?W
606 "Coding System for fixed EUC Chinese-cns11643")
607 (coding-system-put 'fixed-euc-py-tw
608 'pre-write-conversion 'pre-write-encode-euc-tw)
609 (coding-system-put 'fixed-euc-py-tw
610 'post-read-conversion 'post-read-decode-euc-py-tw)
612 (make-coding-system 'fixed-euc-zy-tw 0 ?W
613 "Coding System for fixed EUC Chinese-cns11643")
614 (coding-system-put 'fixed-euc-zy-tw
615 'pre-write-conversion 'pre-write-encode-euc-tw)
616 (coding-system-put 'fixed-euc-zy-tw
617 'post-read-conversion 'post-read-decode-euc-zy-tw)
622 (define-ccl-program ccl-decode-egg-binary
627 (read r1)) ; toss out
628 (write-read-repeat r0)))))
630 (define-ccl-program ccl-encode-egg-binary
637 (write-read-repeat r0))))))
639 (make-coding-system 'egg-binary 4 ?W "Coding System for binary data"
640 (cons ccl-decode-egg-binary ccl-encode-egg-binary))
643 (defun comm-format-u32c (uint32c)
644 (insert-char (logand (lsh (car uint32c) -8) 255) 1)
645 (insert-char (logand (car uint32c) 255) 1)
646 (insert-char (logand (lsh (nth 1 uint32c) -8) 255) 1)
647 (insert-char (logand (nth 1 uint32c) 255) 1))
649 (defun comm-format-u32 (uint32)
650 (insert-char (logand (lsh uint32 -24) 255) 1)
651 (insert-char (logand (lsh uint32 -16) 255) 1)
652 (insert-char (logand (lsh uint32 -8) 255) 1)
653 (insert-char (logand uint32 255) 1))
655 (defun comm-format-i32 (int32)
656 (insert-char (logand (ash int32 -24) 255) 1)
657 (insert-char (logand (ash int32 -16) 255) 1)
658 (insert-char (logand (ash int32 -8) 255) 1)
659 (insert-char (logand int32 255) 1))
661 (defun comm-format-u16 (uint16)
662 (insert-char (logand (lsh uint16 -8) 255) 1)
663 (insert-char (logand uint16 255) 1))
665 (defun comm-format-u8 (uint8)
666 (insert-char (logand uint8 255) 1))
668 (defun comm-format-truncate-after-null (s)
669 (if (string-match "\0" s)
670 (substring s 0 (match-beginning 0))
673 (defun comm-format-u16-string (s)
674 (insert (encode-coding-string (comm-format-truncate-after-null s)
678 (defun comm-format-mb-string (s)
679 (insert (encode-coding-string (comm-format-truncate-after-null s)
683 (defun comm-format-u8-string (s)
684 (insert (comm-format-truncate-after-null s))
687 (defun comm-format-binary-data (s)
688 (insert (encode-coding-string s 'egg-binary))
689 (insert-char ?\377 2))
691 (defun comm-format-fixlen-string (s len)
692 (setq s (comm-format-truncate-after-null s))
693 (insert (if (< (length s) len) s (substring s 0 (1- len))))
694 (insert-char 0 (max (- len (length s)) 1)))
696 (defun comm-format-vector (s len)
698 (insert (if (<= (length s) len) s (substring s 0 len)))
699 (insert-char 0 (- len (length s))))
701 (defmacro comm-format (format &rest args)
702 "Format a string out of a control-list and arguments into the buffer.
703 The formated datas are network byte oder (i.e. big endian)..
704 U: 32-bit integer. The argument is 2 element 16-bit unsigned integer list.
705 u: 32-bit integer. The argument is treat as unsigned integer.
706 (Note: Elisp's integer may be less than 32 bits)
710 S: 16-bit wide-character EUC string (0x0000 terminated).
711 E: Multibyte EUC string (0x00 terminated).
712 s: 8-bit string (0x00 terminated).
713 B: Binary data (0xff terminated).
714 v: 8-bit vector (no terminator). This takes 2 args (data length).
715 V: Fixed length string (0x00 terminated). This takes 2 args (data length)."
718 (result (list 'progn))
725 (cond ((eq f 'U) (list 'comm-format-u32c arg))
726 ((eq f 'u) (list 'comm-format-u32 arg))
727 ((eq f 'i) (list 'comm-format-i32 arg))
728 ((eq f 'w) (list 'comm-format-u16 arg))
729 ((eq f 'b) (list 'comm-format-u8 arg))
730 ((eq f 'S) (list 'comm-format-u16-string arg))
731 ((eq f 'E) (list 'comm-format-mb-string arg))
732 ((eq f 's) (list 'comm-format-u8-string arg))
733 ((eq f 'B) (list 'comm-format-binary-data arg))
734 ((eq f 'V) (setq p (cdr p))
735 (list 'comm-format-fixlen-string arg (car p)))
736 ((eq f 'v) (setq p (cdr p))
737 (list 'comm-format-vector arg (car p))))))
738 (setq form (cdr form)
741 (error "comm-format %s: arguments mismatch" format))
744 (defvar comm-accept-timeout nil)
746 ;; Assume PROC is bound to the process of current buffer
747 ;; Do not move the point, leave it where it was.
748 (defmacro comm-accept-process-output ()
750 (if (null (accept-process-output proc comm-accept-timeout))
751 (egg-error "backend timeout"))
754 (defmacro comm-require-process-output (n)
755 `(if (< (point-max) (+ (point) ,n))
756 (comm-wait-for-space proc ,n)))
758 (defun comm-wait-for-space (proc n)
761 (while (< (point-max) r)
762 (if (null (accept-process-output proc comm-accept-timeout))
763 (egg-error "backend timeout"))
766 (defmacro comm-following+forward-char ()
771 (defun comm-unpack-u32c ()
773 (comm-require-process-output 4)
774 (list (+ (lsh (comm-following+forward-char) 8)
775 (comm-following+forward-char))
776 (+ (lsh (comm-following+forward-char) 8)
777 (comm-following+forward-char)))))
779 (defun comm-unpack-u32 ()
781 (comm-require-process-output 4)
782 (+ (lsh (comm-following+forward-char) 24)
783 (lsh (comm-following+forward-char) 16)
784 (lsh (comm-following+forward-char) 8)
785 (comm-following+forward-char))))
787 (defun comm-unpack-u16 ()
789 (comm-require-process-output 2)
790 (+ (lsh (comm-following+forward-char) 8)
791 (comm-following+forward-char))))
793 (defun comm-unpack-u8 ()
795 (comm-require-process-output 1)
796 (comm-following+forward-char)))
798 (defun comm-unpack-u16-string ()
799 (let ((start (point)))
800 (while (not (search-forward "\0\0" nil t))
801 (comm-accept-process-output))
802 (decode-coding-string (buffer-substring start (- (point) 2))
805 (defun comm-unpack-mb-string ()
806 (let ((start (point)))
807 (while (not (search-forward "\0" nil t))
808 (comm-accept-process-output))
809 (decode-coding-string (buffer-substring start (1- (point)))
812 (defun comm-unpack-u8-string ()
813 (let ((start (point)))
814 (while (not (search-forward "\0" nil 1))
815 (comm-accept-process-output))
816 (buffer-substring start (1- (point)))))
818 (defun comm-unpack-binary-data ()
819 (let ((start (point)))
820 (while (not (search-forward "\377\377" nil 1))
821 (comm-accept-process-output))
823 (decode-coding-string (buffer-substring start (- (point) 2))
826 (defun comm-unpack-fixlen-string (len)
828 (comm-require-process-output len)
829 (goto-char (+ (point) len))
830 (setq s (buffer-substring (- (point) len) (point)))
831 (if (string-match "\0" s)
832 (setq s (substring s 0 (match-beginning 0))))
835 (defun comm-unpack-vector (len)
837 (comm-require-process-output len)
838 (goto-char (+ (point) len))
839 (buffer-substring (- (point) len) (point))))
841 (defmacro comm-unpack (format &rest args)
842 "Unpack a string out of a control-string and set arguments.
843 See `comm-format' for FORMAT."
846 (result (list 'progn))
853 (cond ((eq f 'U) `(setq ,arg (comm-unpack-u32c)))
854 ((eq f 'u) `(setq ,arg (comm-unpack-u32)))
855 ((eq f 'i) `(setq ,arg (comm-unpack-u32)))
856 ((eq f 'w) `(setq ,arg (comm-unpack-u16)))
857 ((eq f 'b) `(setq ,arg (comm-unpack-u8)))
858 ((eq f 'S) `(setq ,arg (comm-unpack-u16-string)))
859 ((eq f 'E) `(setq ,arg (comm-unpack-mb-string)))
860 ((eq f 's) `(setq ,arg (comm-unpack-u8-string)))
861 ((eq f 'B) `(setq ,arg (comm-unpack-binary-data)))
862 ((eq f 'V) (setq p (cdr p))
863 `(setq ,arg (comm-unpack-fixlen-string ,(car p))))
864 ((eq f 'v) (setq p (cdr p))
865 `(setq ,arg (comm-unpack-vector ,(car p)))))))
866 (setq form (cdr form)
869 (error "comm-unpack %s: arguments mismatch" format))
872 (defmacro comm-call-with-proc (proc vlist send-expr &rest receive-exprs)
874 (and (eq (car-safe (car vlist)) 'zhuyin)
875 '((egg-fixed-euc (nth (if zhuyin 1 0) egg-fixed-euc))))))
877 (buffer (process-buffer proc))
879 (if (and (eq (process-status proc) 'open)
880 (buffer-live-p buffer))
886 (goto-char (point-max))
887 (process-send-region proc (point-min) (point-max))
889 (egg-error "process %s was killed" proc)))))
891 (defmacro comm-call-with-proc-1 (proc vlist send-expr &rest receive-exprs)
895 (goto-char (point-max))
896 (process-send-region proc (point-min) (point-max))
900 ;;; egg-com.el ends here.