annotate lisp/egg/egg-wnn.el @ 140:585fb297b004 r20-2b4

Import from CVS: tag r20-2b4
author cvs
date Mon, 13 Aug 2007 09:32:43 +0200
parents 8619ce7e4c50
children 25f70ba0133c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
1 ;;; egg-wnn.el --- a inputting method communicating with [jck]server
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
3 ;; Author: Satoru Tomura (tomura@etl.go.jp), and
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
4 ;; Toshiaki Shingu (shingu@cpr.canon.co.jp)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
5 ;; Keywords: inputting method
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
7 ;; This file is part of Egg on Mule (Multilingual Environment)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
8
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
9 ;; Egg is free software; you can redistribute it and/or modify
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
12 ;; any later version.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
13
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
14 ;; Egg is distributed in the hope that it will be useful,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
17 ;; GNU General Public License for more details.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
18
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
21 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
22
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
23 ;;; Commentary:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
24
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
25 ;;; Modified for Wnn V4 and Wnn6 by Satoru Tomura(tomura@etl.go.jp)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
26 ;;; Modified for Wnn6 by OMRON
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
27 ;;; Written by Toshiaki Shingu (shingu@cpr.canon.co.jp)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
28 ;;; Modified for Wnn V4 library on wnn4v3-egg.el
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
29
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
30 ;;; $B$?$^$4!V$?$+$J!W%P!<%8%g%s(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
31 ;;; $B!V$?$+$J!W$H$ODR$1J*$N$?$+$J$G$O$"$j$^$;$s!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
32 ;;; $B!V$?$^$4$h!?$+$7$3$/!?$J!<!<$l!W$NN,$r$H$C$FL?L>$7$^$7$?!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
33 ;;; Wnn V4 $B$N(B jl $B%i%$%V%i%j$r;H$$$^$9!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
34 ;;; $B%i%$%V%i%j$H$N%$%s%?!<%U%'!<%9$O(B wnnfns.c $B$GDj5A$5$l$F$$$^$9!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
35
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
36 ;;; $B=$@5%a%b(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
37
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
38 ;;; 97/2/4 Modified for use with XEmacs by J.Hein <jhod@po.iijnet.or.jp>
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
39 ;;; (mostly changes regarding extents and markers)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
40 ;;; 94/2/3 kWnn support by H.Kuribayashi
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
41 ;;; 93/11/24 henkan-select-kouho: bug fixed
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
42 ;;; 93/7/22 hinsi-from-menu updated
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
43 ;;; 93/5/12 remove-regexp-in-string
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
44 ;;; fixed by Shuji NARAZAKI <narazaki@csce.kyushu-u.ac.jp>
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
45 ;;; 93/4/22 set-wnn-host-name, set-cwnn-host-name
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
46 ;;; 93/4/5 EGG:open-wnn, close-wnn modified by tsuiki.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
47 ;;; 93/4/2 wnn-param-set
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
48 ;;; 93/4/2 modified along with wnn4fns.c
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
49 ;;; 93/3/3 edit-dict-item: bug fixed
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
50 ;;; 93/1/8 henkan-help-command modified.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
51 ;;; 92/12/1 buffer local 'wnn-server-type' and 'cwnn-zhuyin'
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
52 ;;; so as to support individual its mode with multiple buffers.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
53 ;;; 92/11/26 set-cserver-host-name fixed.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
54 ;;; 92/11/26 its:{previous,next}-mode by <yasutome@ics.osaka-u.ac.jp>
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
55 ;;; 92/11/25 set-wnn-host-name was changed to set-{j,c}server-host-name.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
56 ;;; 92/11/25 redefined its:select-mode and its:select-mode-from-menu
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
57 ;;; defined in egg.el to run hook with its mode selection.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
58 ;;; 92/11/20 bug fixed related to henkan mode attribute.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
59 ;;; 92/11/12 get-wnn-host-name and set-wnn-host-name were changed.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
60 ;;; 92/11/10 (set-dict-comment) bug fixed
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
61 ;;; 92/10/27 (henkan-region-internal) display message if error occurs.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
62 ;;; 92/9/28 completely modified for chinese trandlation.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
63 ;;; 92/9/28 diced-{use,hindo-set} bug fixed <tetsuya@rabbit.is.s.u-tokyo.ac.jp>
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
64 ;;; 92/9/22 touroku-henkan-mode by <tsuiki@sfc.keio.ac.jp>
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
65 ;;; 92/9/18 rewrite wnn-dict-add to support password files.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
66 ;;; 92/9/8 henkan-region-internal was modified.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
67 ;;; 92/9/8 henkan-mode-map " " 'henkan-next-kouho-dai -> 'henkan-next-kouho
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
68 ;;; 92/9/7 henkan-mode-map "\C-h" 'help-command -> 'henkan-help-command (Shuji Narazaki)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
69 ;;; 92/9/3 wnn-server-get-msg without wnn-error-code.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
70 ;;; 92/9/3 get-wnn-lang-name was modified.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
71 ;;; 92/8/19 get-wnn-lang-name $B$NJQ99(B (by T.Matsuzawa)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
72 ;;; 92/8/5 Bug in henkan-kakutei-first-char fixed. (by Y.Kasai)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
73 ;;; 92/7/17 set-egg-henkan-format $B$NJQ99(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
74 ;;; 92/7/17 egg:error $B$N0z?t$r(B format &rest args $B$KJQ99(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
75 ;;; 92/7/17 henkan/gyaku-henkan-word $B$N=$@5(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
76 ;;; 92/7/17 henkan/gyaku-henkan-paragraph/sentence/word $B$G!"(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
77 ;;; $BI=<($,Mp$l$k$N$r=$@5!J(Bsave-excursion $B$r$O$:$9!K(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
78 ;;; 92.7.14 Unnecessary '*' in comments of variables deleted. (by T.Ito)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
79 ;;; 92/7/10 henkan-kakutei-first-char $B$rDI2C!"(BC-@ $B$K3d$jEv$F!#(B(by K.Handa)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
80 ;;; 92/7/8 overwrite-mode $B$N%5%]!<%H(B(by K. Handa)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
81 ;;; 92/6/30 startup file $B<~$j$NJQ99(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
82 ;;; 92/6/30 $BJQ49%b!<%I$N%"%H%j%S%e!<%H$K(B bold $B$rDI2C(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
83 ;;; (by ITO Toshiyuki <toshi@his.cpl.melco.co.jp>)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
84 ;;; 92/6/22 $B6uJ8;zNs$rJQ49$9$k$HMn$A$k%P%0$r=$@5(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
85 ;;; 92/5/20 set-egg-henkan-mode-format $B$N(B bug fix
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
86 ;;; 92/5/20 egg:set-bunsetu-attribute $B$,BgJ8@a$G@5$7$/F0$/$h$&$KJQ99(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
87 ;;; 92/5/19 version 0
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
88 ;;; ----------------------------------------------------------------
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
89
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
90 ;;; Code:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
91
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
92 (require 'egg)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
93 (make-variable-buffer-local 'wnn-server-type)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
94 (make-variable-buffer-local 'cwnn-zhuyin)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
95
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
96 (defvar egg:*sho-bunsetu-face* nil "*$B>.J8@aI=<($KMQ$$$k(B face $B$^$?$O(B nil")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
97 (make-variable-buffer-local
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
98 (defvar egg:*sho-bunsetu-extent* nil "$B>.J8@a$NI=<($K;H$&(B extent"))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
99
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
100 (defvar egg:*sho-bunsetu-kugiri* "-" "*$B>.J8@a$N6h@Z$j$r<($9J8;zNs(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
101
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
102 (defvar egg:*dai-bunsetu-face* nil "*$BBgJ8@aI=<($KMQ$$$k(B face $B$^$?$O(B nil")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
103 (make-variable-buffer-local
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
104 (defvar egg:*dai-bunsetu-extent* nil "$BBgJ8@a$NI=<($K;H$&(B extent"))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
105
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
106 (defvar egg:*dai-bunsetu-kugiri* " " "*$BBgJ8@a$N6h@Z$j$r<($9J8;zNs(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
107
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
108 (defvar egg:*henkan-face* nil "*$BJQ49NN0h$rI=<($9$k(B face $B$^$?$O(B nil")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
109 (make-variable-buffer-local
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
110 (defvar egg:*henkan-extent* nil "$BJQ49NN0h$NI=<($K;H$&(B extent"))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
111
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
112 (defvar egg:*henkan-open* "|" "*$BJQ49$N;OE@$r<($9J8;zNs(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
113 (defvar egg:*henkan-close* "|" "*$BJQ49$N=*E@$r<($9J8;zNs(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
114
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
115 (defvar egg:henkan-mode-in-use nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
116
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
117 ;;; ----------------------------------------------------------------
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
118 ;;; $B0J2<$N(B its mode $B4X78$N4X?t$O!"(Begg.el $B$GDj5A$5$l$F$$$k$,!"(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
119 ;;; $B$?$+$J$G$O(B its mode $B$N@ZBX$($KF14|$7$F!"(Bjserver/cserver,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
120 ;;; pinyin/zhuyin $B$N@ZBX$($b9T$J$$$?$$$N$G!":FDj5A$7$F$$$k!#(B
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
121 ;;; $B=>$C$F!"(Begg.el, egg-wnn.el $B$N=g$K%m!<%I$7$J$1$l$P$J$i$J$$!#(B
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
122
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
123
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
124 (defun its:select-mode (name)
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
125 "Switch ITS mode to NAME or prompt for it if called interactivly.
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
126 After changing, its:select-mode-hook is called."
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
127 (interactive (list (completing-read "ITS mode: " its:*mode-alist*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
128 (if (its:get-mode-map name)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
129 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
130 (setq its:*current-map* (its:get-mode-map name))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
131 (egg:mode-line-display)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
132 (run-hooks 'its:select-mode-hook))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
133 (beep))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
134 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
135
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
136 (defun its:select-mode-from-menu ()
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
137 "Select ITS mode from menu.
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
138 After changing, its:select-mode-hook is called."
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
139 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
140 (setcar (nthcdr 2 its:*select-mode-menu*) its:*mode-alist*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
141 (setq its:*current-map* (menu:select-from-menu its:*select-mode-menu*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
142 (egg:mode-line-display)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
143 (run-hooks 'its:select-mode-hook))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
144
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
145 (defvar its:select-mode-hook
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
146 (function
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
147 (lambda ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
148 (cond ((eq its:*current-map* (its:get-mode-map "roma-kana"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
149 (setq wnn-server-type 'jserver))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
150 ((eq its:*current-map* (its:get-mode-map "PinYin"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
151 (setq wnn-server-type 'cserver)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
152 (setq cwnn-zhuyin nil))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
153 ((eq its:*current-map* (its:get-mode-map "zhuyin"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
154 (setq wnn-server-type 'cserver)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
155 (setq cwnn-zhuyin t))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
156 ((eq its:*current-map* (its:get-mode-map "hangul"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
157 (setq wnn-server-type 'kserver))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
158 ))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
159
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
160 (defun its:next-mode ()
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
161 "Switch to next mode in list its:*standard-modes*
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
162 After changing, its:select-mode-hook is called."
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
163 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
164 (let ((pos (its:find its:*current-map* its:*standard-modes*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
165 (setq its:*current-map*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
166 (nth (% (1+ pos) (length its:*standard-modes*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
167 its:*standard-modes*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
168 (egg:mode-line-display)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
169 (run-hooks 'its:select-mode-hook)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
170
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
171 (defun its:previous-mode ()
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
172 "Switch to previous mode in list its:*standard-modes*
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
173 After changing, its:select-mode-hook is called."
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
174 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
175 (let ((pos (its:find its:*current-map* its:*standard-modes*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
176 (setq its:*current-map*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
177 (nth (1- (if (= pos 0) (length its:*standard-modes*) pos))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
178 its:*standard-modes*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
179 (egg:mode-line-display)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
180 (run-hooks 'its:select-mode-hook)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
181
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
182 (defun read-current-its-string (prompt &optional initial-input henkan)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
183 (save-excursion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
184 (let ((old-its-map its:*current-map*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
185 (minibuff (window-buffer (minibuffer-window))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
186 (set-buffer minibuff)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
187 (setq egg:*input-mode* t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
188 egg:*mode-on* t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
189 its:*current-map* old-its-map)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
190 (mode-line-egg-mode-update
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
191 (nth 1 (its:get-mode-indicator its:*current-map*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
192 (read-from-minibuffer prompt initial-input
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
193 (if henkan nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
194 egg:*minibuffer-local-hiragana-map*)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
195
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
196 ;;;----------------------------------------------------------------------
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
197 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
198 ;;; Kana Kanji Henkan
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
199 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
200 ;;;----------------------------------------------------------------------
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
201
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
202 (defvar wnn-host-name nil "Jserver host name currently connected")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
203 (defvar cwnn-host-name nil "Cserver host name currently connected")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
204 (defvar kwnn-host-name nil "Kserver host name currently connected")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
205 (defvar jserver-list nil "*List of jserver host name")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
206 (defvar cserver-list nil "*List of cserver host name")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
207 (defvar kserver-list nil "*List of kserver host name")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
208
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
209 (defvar egg:*sai-henkan-start* nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
210 (defvar egg:*sai-henkan-end* nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
211 (defvar egg:*old-bunsetu-suu* nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
212
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
213 (defun egg-wnn:kill-emacs-function ()
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
214 (let ((wnn-server-type))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
215 (setq wnn-server-type 'jserver)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
216 (close-wnn)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
217 (setq wnn-server-type 'cserver)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
218 (close-wnn)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
219 (setq wnn-server-type 'kserver)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
220 (close-wnn)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
221
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
222 (add-hook 'kill-emacs-hook 'egg-wnn:kill-emacs-function)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
223
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
224 (defun egg:error (form &rest mesg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
225 (apply 'notify (or form "%s") mesg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
226 (apply 'error (or form "%s") mesg))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
227
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
228 (defun wnn-toggle-english-messages ()
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
229 "Toggle whether wnn reports info in english or the native language of the server."
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
230 (interactive)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
231 (setq wnn-english-messages (not wnn-english-messages)))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
232
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
233 (defvar wnn-english-messages nil "*If non-nil, display messages from the [jck]server in English")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
234
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
235 (make-symbol "english-mess")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
236
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
237 (defun egg:msg-get (message)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
238 (or
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
239 (nth 1 (assoc message (nth 1 (assoc (if wnn-english-messages 'english-mess wnn-server-type)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
240 *egg-message-alist*))))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
241 (format "No message. Check *egg-message-alist* %s %s"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
242 wnn-server-type message)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
243
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
244 (defvar *egg-message-alist*
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
245 '((english-mess
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
246 ((open-wnn "Connected with Wnn on host %s")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
247 (no-rcfile "No egg-startup-file on %s")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
248 (file-saved "Wnn dictionary and frequency data recorded.")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
249 (henkan-mode-indicator "$B4A(B")
140
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
250 (begin-henkan "Fence starting character: ")
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
251 (end-henkan "Fence ending character: ")
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
252 (kugiri-dai "Large bunsetsu separator: ")
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
253 (kugiri-sho "Small bunsetsu separator: ")
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
254 (face-henkan "Face for conversion: ")
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
255 (face-dai "Face for large bunsetsu: ")
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
256 (face-sho "Face for small bunsetsu: ")
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
257 (jikouho "Entries:")
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
258 (off-msg "%s %s(%s:%s) turned off.")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
259 (henkan-help "Kanji conversion mode:
140
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
260 Bunsetsu motion commands
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
261 \\[henkan-first-bunsetu]\tFirst bunsetsu\t\\[henkan-last-bunsetu]\tLast bunsetsu
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
262 \\[henkan-backward-bunsetu]\tPrevious bunsetsu\t\\[henkan-forward-bunsetu]\tNext bunsetsu
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
263 Bunsetsu conversion commands
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
264 \\[henkan-next-kouho-dai]\tNext larger match\t\\[henkan-next-kouho-sho]\tNext smaller match
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
265 \\[henkan-previous-kouho]\tPrevious match\t\\[henkan-next-kouho]\tNext match
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
266 \\[henkan-bunsetu-nobasi-dai]\tExtend bunsetsu largest\t\\[henkan-bunsetu-chijime-dai]\tShrink bunsetsu smallest
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
267 \\[henkan-bunsetu-nobasi-sho]\tExtend bunsetsu\t\\[henkan-bunsetu-chijime-sho]\tShrink bunsetsu
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
268 \\[henkan-select-kouho-dai]\tMenu select largest match\t\\[henkan-select-kouho-sho]\tMenu select smallest match
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
269 Conversion commands
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
270 \\[henkan-kakutei]\tComplete conversion commit\t\\[henkan-kakutei-before-point]\tCommit before point
585fb297b004 Import from CVS: tag r20-2b4
cvs
parents: 114
diff changeset
271 \\[henkan-quit]\tAbort conversion
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
272 ")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
273 (hinsimei "Hinshi (product/noun) name:")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
274 (jishotouroku-yomi "Dictionary entry for$B!X(B%s$B!Y(B reading:")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
275 (touroku-jishomei "Name of dictionary:" )
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
276 (registerd "Dictonary entry$B!X(B%s$B!Y(B(%s: %s) registered in %s.")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
277 (yomi "Reading$B!'(B")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
278 (no-yomi "No dictionary entry for $B!X(B%s$B!Y(B.")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
279 (jisho "Dictionary:")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
280 (hindo "Frequency:")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
281 (kanji "Kanji:")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
282 (register-notify "Dictonary entry$B!X(B%s$B!Y(B(%s: %s) registered in %s.")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
283 (cannot-remove "Cannot delete entry from system dictionary.")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
284 (enter-hindo "Enter frequency:")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
285 (remove-notify "Dictonary entry$B!X(B%s$B!Y(B(%s) removed from %s.")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
286 (removed "Dictonary entry$B!X(B%s$B!Y(B(%s) removed from %s.")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
287 (jishomei "Dictionary name:" )
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
288 (comment "Comment:")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
289 (jisho-comment "Dictionary:%s: comment:%s")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
290 (param ("$B#N(B ( $BBg(B ) $BJ8@a2r@O$N#N(B"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
291 "$BBgJ8@aCf$N>.J8@a$N:GBg?t(B"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
292 "$B448l$NIQEY$N%Q%i%a!<%?(B"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
293 "$B>.J8@aD9$N%Q%i%a!<%?(B"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
294 "$B448lD9$N%Q%i%a!<%?(B"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
295 "$B:#;H$C$?$h%S%C%H$N%Q%i%a!<%?(B"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
296 "$B<-=q$N%Q%i%a!<%?(B"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
297 "$B>.J8@a$NI>2ACM$N%Q%i%a!<%?(B"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
298 "$BBgJ8@aD9$N%Q%i%a!<%?(B"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
299 "$B>.J8@a?t$N%Q%i%a!<%?(B"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
300 "$B5?;wIJ;l(B $B?t;z$NIQEY(B"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
301 "$B5?;wIJ;l(B $B%+%J$NIQEY(B"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
302 "$B5?;wIJ;l(B $B1Q?t$NIQEY(B"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
303 "$B5?;wIJ;l(B $B5-9f$NIQEY(B"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
304 "$B5?;wIJ;l(B $BJD3g8L$NIQEY(B"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
305 "$B5?;wIJ;l(B $BIUB08l$NIQEY(B"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
306 "$B5?;wIJ;l(B $B3+3g8L$NIQEY(B"))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
307 ))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
308 (jserver
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
309 ((open-wnn "$B%[%9%H(B %s $B$N(B Wnn $B$r5/F0$7$^$7$?(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
310 (no-rcfile "%s $B>e$K(B egg-startup-file $B$,$"$j$^$;$s!#(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
311 (file-saved "Wnn$B$NIQEY>pJs!&<-=q>pJs$rB`Hr$7$^$7$?!#(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
312 (henkan-mode-indicator "$B4A(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
313 (begin-henkan "$BJQ493+;OJ8;zNs(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
314 (end-henkan "$BJQ49=*N;J8;zNs(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
315 (kugiri-dai "$BBgJ8@a6h@Z$jJ8;zNs(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
316 (kugiri-sho "$B>.J8@a6h@Z$jJ8;zNs(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
317 (face-henkan "$BJQ496h4VI=<(B0@-(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
318 (face-dai "$BBgJ8@a6h4VI=<(B0@-(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
319 (face-sho "$B>.J8@a6h4VI=<(B0@-(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
320 (jikouho "$B<!8uJd(B:")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
321 (off-msg "%s %s(%s:%s)$B$r(B off $B$7$^$7$?!#(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
322 (henkan-help "$B4A;zJQ49%b!<%I(B:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
323 $BJ8@a0\F0(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
324 \\[henkan-first-bunsetu]\t$B@hF,J8@a(B\t\\[henkan-last-bunsetu]\t$B8eHxJ8@a(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
325 \\[henkan-backward-bunsetu]\t$BD>A0J8@a(B\t\\[henkan-forward-bunsetu]\t$BD>8eJ8@a(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
326 $BJQ49JQ99(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
327 $BBgJ8@a<!8uJd(B \\[henkan-next-kouho-dai]\t$B>.J8@a<!8uJd(B \\[henkan-next-kouho-sho]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
328 $BA08uJd(B \\[henkan-previous-kouho] \t$B<!8uJd(B \\[henkan-next-kouho]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
329 $BBgJ8@a?-$7(B \\[henkan-bunsetu-nobasi-dai] \t$BBgJ8@a=L$a(B \\[henkan-bunsetu-chijime-dai]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
330 $B>.J8@a?-$7(B \\[henkan-bunsetu-nobasi-sho] \t$B>.J8@a=L$a(B \\[henkan-bunsetu-chijime-sho]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
331 $BBgJ8@aJQ498uJdA*Br(B \\[henkan-select-kouho-dai] \t$B>.J8@aJQ498uJdA*Br(B \\[henkan-select-kouho-sho]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
332 $BJQ493NDj(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
333 $BA4J8@a3NDj(B \\[henkan-kakutei] \t$BD>A0J8@a$^$G3NDj(B \\[henkan-kakutei-before-point]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
334 $BJQ49Cf;_(B \\[henkan-quit]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
335 ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
336 (hinsimei "$BIJ;lL>(B:")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
337 (jishotouroku-yomi "$B<-=qEPO?!X(B%s$B!Y(B $BFI$_(B :")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
338 (touroku-jishomei "$BEPO?<-=qL>(B:" )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
339 (registerd "$B<-=q9`L\!X(B%s$B!Y(B(%s: %s)$B$r(B%s$B$KEPO?$7$^$7$?!#(B" )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
340 (yomi "$B$h$_!'(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
341 ; (no-yomi "$B!X(B%s$B!Y$N<-=q9`L\$O$"$j$^$;$s!#(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
342 (no-yomi "$B<-=q9`L\!X(B%s$B!Y$O$"$j$^$;$s!#(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
343 (jisho "$B<-=q!'(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
344 (hindo " $BIQEY!'(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
345 (kanji "$B4A;z!'(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
346 (register-notify "$B<-=q9`L\!X(B%s$B!Y(B(%s: %s)$B$r(B%s$B$KEPO?$7$^$9!#(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
347 (cannot-remove "$B%7%9%F%`<-=q9`L\$O:o=|$G$-$^$;$s!#(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
348 (enter-hindo "$BIQEY$rF~$l$F2<$5$$(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
349 (remove-notify "$B<-=q9`L\(B%s(%s)$B$r(B%s$B$+$i:o=|$7$^$9!#(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
350 (removed "$B<-=q9`L\(B%s(%s)$B$r(B%s$B$+$i:o=|$7$^$7$?!#(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
351 (jishomei "$B<-=qL>(B:" )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
352 (comment "$B%3%a%s%H(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
353 (jisho-comment "$B<-=q(B:%s: $B%3%a%s%H(B:%s")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
354 (param ("$B#N(B ( $BBg(B ) $BJ8@a2r@O$N#N(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
355 "$BBgJ8@aCf$N>.J8@a$N:GBg?t(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
356 "$B448l$NIQEY$N%Q%i%a!<%?(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
357 "$B>.J8@aD9$N%Q%i%a!<%?(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
358 "$B448lD9$N%Q%i%a!<%?(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
359 "$B:#;H$C$?$h%S%C%H$N%Q%i%a!<%?(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
360 "$B<-=q$N%Q%i%a!<%?(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
361 "$B>.J8@a$NI>2ACM$N%Q%i%a!<%?(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
362 "$BBgJ8@aD9$N%Q%i%a!<%?(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
363 "$B>.J8@a?t$N%Q%i%a!<%?(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
364 "$B5?;wIJ;l(B $B?t;z$NIQEY(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
365 "$B5?;wIJ;l(B $B%+%J$NIQEY(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
366 "$B5?;wIJ;l(B $B1Q?t$NIQEY(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
367 "$B5?;wIJ;l(B $B5-9f$NIQEY(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
368 "$B5?;wIJ;l(B $BJD3g8L$NIQEY(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
369 "$B5?;wIJ;l(B $BIUB08l$NIQEY(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
370 "$B5?;wIJ;l(B $B3+3g8L$NIQEY(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
371 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
372 (cserver
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
373 ((open-wnn "Host %s $AIO5D(B cWnn $ARQ>-Fp6/AK(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
374 (no-rcfile "$ATZ(B%s $AIOC;SP(B egg-startup-file")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
375 (file-saved "Wnn$A5DF56HND<~:M4G5dPEO"RQ>-MK3vAK(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
376 (henkan-mode-indicator "$A::(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
377 (begin-henkan "$A1d;;?*J<WV7{AP(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
378 (end-henkan "$A1d;;=aJxWV7{AP(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
379 (kugiri-dai "$A4JWi7V8nWV7{AP(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
380 (kugiri-sho "$A5%4J7V8nWV7{AP(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
381 (face-henkan "$A1d;;Gx<d1mJ>JtPT(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
382 (face-dai "$A4JWiGx<d1mJ>JtPT(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
383 (face-sho "$A5%4JGx<d1mJ>JtPT(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
384 (jikouho "$A4N:nQ!(B:")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
385 (off-msg "%s %s(%s:%s)$ARQ1;(B off $A5tAK(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
386 (henkan-help "$A::WV1d;;D#J=(B:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
387 $A4JWiRF6/(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
388 \\[henkan-first-bunsetu]\t$AOHM74JWi(B\t\\[henkan-last-bunsetu]\t$A=aN24JWi(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
389 \\[henkan-backward-bunsetu]\t$AG0R;8v4JWi(B\t\\[henkan-forward-bunsetu]\t$AOBR;8v4JWi(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
390 $A1d;;1d8|(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
391 $A4JWi4N:nQ!(B \\[henkan-next-kouho-dai]\t$A5%4J4N:nQ!(B \\[henkan-next-kouho-sho]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
392 $AG0:nQ!(B \\[henkan-previous-kouho] \t$A4N:nQ!(B \\[henkan-next-kouho]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
393 $A4JWi@)U9(B \\[henkan-bunsetu-nobasi-dai] \t$A4JWiJUKu(B \\[henkan-bunsetu-chijime-dai]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
394 $A5%4J@)U9(B \\[henkan-bunsetu-nobasi-sho] \t$A5%4JJUKu(B \\[henkan-bunsetu-chijime-sho]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
395 $A4JWi1d;;:r295DQ!Tq(B \\[henkan-select-kouho-dai] \t$A5%4J1d;;:r295DQ!Tq(B \\[henkan-select-kouho-sho]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
396 $A1d;;:r295DQ!Tq(B \\[henkan-select-kouho-dai]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
397 $A1d;;H76((B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
398 $AH+NDH76((B \\[henkan-kakutei] \t$AIOR;4JWiN*V95DH76((B \\[henkan-kakutei-before-point]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
399 $AM#V91d;;(B \\[henkan-quit]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
400 ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
401 (hinsimei "$A4JPTC{(B:")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
402 (jishotouroku-yomi "$A4G5d5GB<!:(B%s$A!;F47((B :")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
403 (touroku-jishomei "$A5GB<4G5dC{(B:" )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
404 (registerd "$A4G5dOnD?!:(B%s$A!;(B(%s: %s)$ARQ1;5GB<5=(B %s $AVPAK(B" )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
405 (yomi "$AF47($B!'(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
406 ; (no-yomi "$A!:(B%s$A!;5D4G5dOnD?2;4fTZ(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
407 (no-yomi "$A4G5dOnD?!:(B%s$A!;2;4fTZ(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
408 (jisho "$A4G5d(B:")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
409 (hindo " $AF56H$B!'(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
410 (kanji "$A::WV$B!'(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
411 (register-notify "$A4G5dOnD?!:(B%s$A!;(B(%s: %s)$A=+R*1;5GB<5=(B %s $AVP(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
412 (cannot-remove "$AO5M34G5dOn2;D\O{3}(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
413 (enter-hindo "$AGkJdHkF56H(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
414 (remove-notify "$A4G5dOnD?(B%s(%s)$A=+R*4S(B %s $AVPO{3}(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
415 (removed "$A4G5dOnD?(B%s(%s)$ARQ>-4S(B%s$AVPO{3}AK(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
416 (jishomei "$A4G5dC{(B:" )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
417 (comment "$AW"JM(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
418 (jisho-comment "$A4G5d(B:%s: $AW"JM(B:%s")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
419 (param ("$A=bNv4JWi8vJ}(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
420 "$A4JWiVP4J5DWn4s8vJ}(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
421 "$AF56HH(V5(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
422 "$A4J3$6HH(V5(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
423 "$AKDIyU}H76HH(V5(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
424 "$A8U2ESC9}H(V5(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
425 "$AWV5dSEOH<6H(V5(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
426 "$A4JF@<[>yV5H(V5(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
427 "$A4JWi3$H(V5(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
428 "$A4JWiVP4JJ}H(V5(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
429 "$AJ}WV5DF56H(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
430 "$AS"NDWVD85DF56H(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
431 "$A<G:E5DF56H(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
432 "$A?*@(;!5DF56H(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
433 "$A1U@(;!5DF56H(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
434 "$AWn4s:r298vJ}(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
435 "$A18SC(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
436 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
437 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
438 (kserver
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
439 ((open-wnn "$(CH#=:F.(B %s $(C@G(B kWnn $(C8&(B $(CQ&TQG_@>4O4Y(B.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
440 (no-rcfile "%s $(C?!(B egg-startup-file $(C@L(B $(C>x@>4O4Y(B.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
441 (file-saved "kWnn $(C@G(B $(C^:SxoW\C!$^vnpoW\C8&(B $(C?E0e@>4O4Y(B.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
442 (henkan-mode-indicator "$(CyS(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
443 (begin-henkan "$(C\(|5(B $(CKRc7(B $(CY~m.fj(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
444 (end-henkan "$(C\(|5(B $(Cp{Vu(B $(CY~m.fj(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
445 (kugiri-dai "$(CS^Y~o=(B $(CO!\,(B $(CY~m.fj(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
446 (kugiri-sho "$(Ca3Y~o=(B $(CO!\,(B $(CY~m.fj(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
447 (face-henkan "$(C\(|5(B $(CO!J`(B $(CxvcF(B $(CaU`u(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
448 (face-dai "$(CS^Y~o=(B $(CO!J`(B $(CxvcF(B $(CaU`u(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
449 (face-sho "$(Ca3Y~o=(B $(CO!J`(B $(CxvcF(B $(CaU`u(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
450 (jikouho "$(C4Y@=(B $(C}&\M(B:")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
451 (off-msg "%s %s(%s:%s)$(C@;(B off $(CG_@>4O4Y(B.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
452 (henkan-help "$(CySm.(B $(C\(|5(B $(C8p5e(B:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
453 $(CY~o=(B $(Cl9TQ(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
454 \\[henkan-first-bunsetu]\t$(C`;Ti(B $(CY~o=(B\t\\[henkan-last-bunsetu]\t$(C}-Z-(B $(CY~o=(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
455 \\[henkan-backward-bunsetu]\t$(CrAnq(B $(CY~o=(B\t\\[henkan-forward-bunsetu]\t$(CrA}-(B $(CY~o=(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
456 $(C\(|5(B $(C\(LZ(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
457 $(CS^Y~o=(B $(C4Y@=(B $(C}&\M(B \\[henkan-next-kouho-dai]\t$(Ca3Y~o=(B $(C4Y@=(B $(C}&\M(B \\[henkan-next-kouho-sho]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
458 $(Cnq(B $(C}&\M(B \\[henkan-previous-kouho] \t$(C4Y@=(B $(C}&\M(B \\[henkan-next-kouho]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
459 $(CS^Y~o=(B $(C|*S^(B \\[henkan-bunsetu-nobasi-dai] \t$(CS^Y~o=(B $(Cuja3(B \\[henkan-bunsetu-chijime-dai]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
460 $(Ca3Y~o=(B $(C|*S^(B \\[henkan-bunsetu-nobasi-sho] \t$(Ca3Y~o=(B $(Cuja3(B \\[henkan-bunsetu-chijime-sho]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
461 $(CS^Y~o=(B $(C\(|5(B $(C4Y@=(B $(C}&\M(B \\[henkan-select-kouho-dai] \t$(Ca3Y~o=(B $(C\(|5(B $(C4Y@=(B $(C}&\M(B \\[henkan-select-kouho-sho]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
462 $(C\(|5(B $(C|,oR(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
463 $(CnoY~o=(B $(C|,oR(B \\[henkan-kakutei] \t$(CrAnq(B $(CY~o=1nAv(B $(C|,oR(B \\[henkan-kakutei-before-point]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
464 $(C\(|5(B $(Cqir-(B \\[henkan-quit]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
465 ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
466 (hinsimei "$(Cy!^rY#(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
467 (jishotouroku-yomi "$(C^vnp(B $(CTtVb!:(B%s$(C!;(B $(CGQ1[(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
468 (touroku-jishomei "$(CTtVb(B $(C^vnpY#(B: " )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
469 (registerd "$(C^vnp(B $(Cz#YM!:(B%s$(C!;(B(%s: %s)$(C@;(B %s$(C?!(B $(CTtVbG_@>4O4Y(B." )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
470 (yomi "$(CGQ1[(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
471 ; (no-yomi "$(C!:(B%s$(C!;@G(B $(C^vnp(B $(Cz#YM@L(B $(C>x@>4O4Y(B.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
472 (no-yomi "$(C^vnp(B $(Cz#YM(B $(C!:(B%s$(C!;@L(B $(C>x@>4O4Y(B.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
473 (jisho "$(C^vnp(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
474 (hindo " $(C^:Sx(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
475 (kanji "$(CySm.(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
476 (register-notify "$(C^vnp(B $(Cz#YM(B $(C!:(B%s$(C!;(B(%s: %s)$(C@;(B %s$(C?!(B $(CTtVbGO0Z@>4O4Y(B.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
477 (cannot-remove "$(C=C=:E[(B $(C^vnpz#YM@:(B $(Ca<K[GR(B $(C<v(B $(C>x@>4O4Y(B.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
478 (enter-hindo "$(C^:Sx8&(B $(Cl}UtGO=J=C?@(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
479 (remove-notify "$(C^vnpz#YM(B %s(%s)$(C@;(B %s$(C:NEM(B $(Ca<K[GO0Z@>4O4Y(B.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
480 (removed "$(C^vnp(B $(Cz#YM(B %s(%s)$(C@;(B %s$(C:NEM(B $(Ca<K[G_@>4O4Y(B.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
481 (jishomei "$(C^vnpY#(B: " )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
482 (comment "$(CqI`7(B: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
483 (jisho-comment "$(C^vnp(B:%s: $(CqI`7(B:%s")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
484 (param ("N ($(CS^(B)$(CY~o=(B $(Cz0`0@G(B N"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
485 "$(CS^Y~o=(B $(C>H@G(B $(Ca3Y~o=(B $(C<v@G(B $(CuLS^b&(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
486 "$(CJOe^@G(B $(C^:Sx(B $(CFP7/9LEM(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
487 "$(Ca3Y~o=(B $(C1f@L(B $(CFP7/9LEM(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
488 "$(CJOe^@G(B $(C1f@L(B $(CFP7/9LEM(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
489 "$(Cq~PQ(B $(C^EiDG_@>4O4Y(B $(C:qF.(B $(CFP7/9LEM(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
490 "$(C^vnp@G(B $(CFP7/9LEM(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
491 "$(Ca3Y~o=@G(B $(CxDJ$v7(B $(CFP7/9LEM(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
492 "$(CS^Y~o=(B $(C1f@L(B $(CFP7/9LEM(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
493 "$(Ca3Y~o=(B $(Cb&(B $(CFP7/9LEM(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
494 "$(CJ#_L(B $(Cy!^r(B: $(Cb&m.@G(B $(C^:Sx(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
495 "$(CJ#_L(B $(Cy!^r(B: $(CGQ1[@G(B $(C^:Sx(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
496 "$(CJ#_L(B $(Cy!^r(B: $(CgHb&m.@G(B $(C^:Sx(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
497 "$(CJ#_L(B $(Cy!^r(B: $(CQ@{\@G(B $(C^:Sx(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
498 "$(CJ#_L(B $(Cy!^r(B: $(CxMN@{A@G(B $(C^:Sx(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
499 "$(CJ#_L(B $(Cy!^r(B: $(C]>aUe^@G(B $(C^:Sx(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
500 "$(CJ#_L(B $(Cy!^r(B: $(CKRN@{A@G(B $(C^:Sx(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
501 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
502 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
503
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
504
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
505 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
506 ;;; Entry functions for egg-startup-file
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
507 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
508
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
509 ;(defvar wnn-lang-name nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
510 ;(defvar default-wnn-lang-name "ja_JP") ; 92.8.19 by T.Matsuzawa
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
511
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
512 (defvar skip-wnn-setenv-if-env-exist nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
513 "skip wnn environment setting when the same name environment exists")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
514
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
515 (defmacro push-end (val loc)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
516 (list 'push-end-internal val (list 'quote loc)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
517
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
518 (defun push-end-internal (val loc)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
519 (set loc
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
520 (if (eval loc)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
521 (nconc (eval loc) (cons val nil))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
522 (cons val nil))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
523
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
524 (defun is-wnn6-server ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
525 (= (wnn-server-version) 61697))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
526
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
527 (defun add-wnn-dict (dfile hfile priority dmode hmode &optional dpaswd hpaswd)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
528 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
529 (if (null (wnn-server-dict-add
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
530 (substitute-in-file-name dfile)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
531 (substitute-in-file-name hfile)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
532 priority dmode hmode dpaswd hpaswd))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
533 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
534
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
535 (defun set-wnn-fuzokugo (ffile)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
536 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
537 (if (null (wnn-server-fuzokugo-set (substitute-in-file-name ffile)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
538 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
539
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
540 ;; ###jhod Currently very broken. Needs to be rewritten for the new
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
541 ;; wnn-server-set-param
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
542 (defun set-wnn-param (&rest param)
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
543 "Set parameters for the current wnn session.
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
544 Uses property list PARAM, or prompts if called interactivly.
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
545
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
546 Currently very broken."
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
547 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
548 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
549 (let ((current-param (wnn-server-get-param))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
550 (new-param)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
551 (message (egg:msg-get 'param)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
552 (while current-param
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
553 (setq new-param
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
554 (cons
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
555 (if (or (null param) (null (car param)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
556 (string-to-int
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
557 (read-from-minibuffer (concat (car message) ": ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
558 (int-to-string (car current-param))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
559 (car param))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
560 new-param))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
561 (setq current-param (cdr current-param)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
562 message (cdr message)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
563 param (if param (cdr param) nil)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
564 (apply 'wnn-server-set-param (nreverse new-param))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
565
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
566 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
567 ;; for Wnn6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
568 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
569 (defun add-wnn-fisys-dict (dfile hfile hmode &optional hpaswd)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
570 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
571 (if (null (wnn-server-fisys-dict-add
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
572 (substitute-in-file-name dfile)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
573 (substitute-in-file-name hfile)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
574 hmode hpaswd))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
575 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
576
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
577 (defun add-wnn-fiusr-dict (dfile hfile dmode hmode &optional dpaswd hpaswd)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
578 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
579 (if (null (wnn-server-fiusr-dict-add
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
580 (substitute-in-file-name dfile)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
581 (substitute-in-file-name hfile)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
582 dmode hmode dpaswd hpaswd))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
583 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
584
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
585 (defun add-wnn-notrans-dict (dfile priority dmode &optional dpaswd)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
586 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
587 (if (null (wnn-server-notrans-dict-add
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
588 (substitute-in-file-name dfile)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
589 priority dmode dpaswd))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
590 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
591
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
592 (defun add-wnn-bmodify-dict (dfile priority dmode &optional dpaswd)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
593 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
594 (if (null (wnn-server-bmodify-dict-add
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
595 (substitute-in-file-name dfile)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
596 priority dmode dpaswd))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
597 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
598
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
599 (defun set-last-is-first-mode (mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
600 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
601 (if (null (wnn-server-set-last-is-first
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
602 mode))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
603 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
604
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
605 (defun set-complex-conv-mode (mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
606 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
607 (if (null (wnn-server-set-complex-conv-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
608 mode))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
609 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
610
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
611 (defun set-okuri-learn-mode (mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
612 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
613 (if (null (wnn-server-set-okuri-learn-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
614 mode))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
615 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
616
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
617 (defun set-okuri-flag (mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
618 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
619 (if (null (wnn-server-set-okuri-flag
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
620 mode))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
621 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
622
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
623 (defun set-prefix-learn-mode (mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
624 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
625 (if (null (wnn-server-set-prefix-learn-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
626 mode))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
627 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
628
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
629 (defun set-prefix-flag (mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
630 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
631 (if (null (wnn-server-set-prefix-flag
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
632 mode))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
633 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
634
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
635 (defun set-suffix-learn-mode (mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
636 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
637 (if (null (wnn-server-set-suffix-learn-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
638 mode))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
639 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
640
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
641 (defun set-common-learn-mode (mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
642 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
643 (if (null (wnn-server-set-common-learn-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
644 mode))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
645 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
646
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
647 (defun set-freq-func-mode (mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
648 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
649 (if (null (wnn-server-set-freq-func-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
650 mode))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
651 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
652
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
653 (defun set-numeric-mode (mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
654 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
655 (if (null (wnn-server-set-numeric-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
656 mode))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
657 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
658
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
659 (defun set-alphabet-mode (mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
660 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
661 (if (null (wnn-server-set-alphabet-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
662 mode))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
663 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
664
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
665 (defun set-symbol-mode (mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
666 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
667 (if (null (wnn-server-set-symbol-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
668 mode))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
669 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
670
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
671 (defun set-yuragi-mode (mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
672 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
673 (if (null (wnn-server-set-yuragi-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
674 mode))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
675 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
676
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
677 (defun wnn6-reset-prev-info ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
678 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
679 (if (null (wnn-reset-previous-info))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
680 (egg:error (wnn-server-get-msg))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
681
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
682 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
683 ;;; WNN interface
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
684 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
685
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
686 (defun make-host-list (name list)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
687 (cons name (delete name list)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
688
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
689 (defun set-wnn-host-name (name)
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
690 "Set egg/wnn to connect to jserver on host NAME, or prompt for it."
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
691 (interactive "sHost name: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
692 (let ((wnn-server-type 'jserver)) (close-wnn))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
693 (setq jserver-list
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
694 (make-host-list
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
695 name (or jserver-list (list (or wnn-host-name (getenv "JSERVER")))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
696
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
697 (fset 'set-jserver-host-name (symbol-function 'set-wnn-host-name))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
698
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
699 (defun set-cwnn-host-name (name)
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
700 "Set egg/wnn to connect to cserver on host NAME, or prompt for it."
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
701 (interactive "sHost name: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
702 (let ((wnn-server-type 'cserver)) (close-wnn))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
703 (setq cserver-list
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
704 (make-host-list
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
705 name (or cserver-list (list (or cwnn-host-name (getenv "CSERVER")))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
706
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
707 (fset 'set-cserver-host-name (symbol-function 'set-cwnn-host-name))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
708
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
709 (defun set-kwnn-host-name (name)
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
710 "Set egg/wnn to connect to kserver on host NAME, or prompt for it."
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
711 (interactive "sHost name: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
712 (let ((wnn-server-type 'kserver)) (close-wnn))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
713 (setq kserver-list
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
714 (make-host-list
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
715 name (or kserver-list (list (or kwnn-host-name (getenv "KSERVER")))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
716
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
717 (fset 'set-kserver-host-name (symbol-function 'set-kwnn-host-name))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
718
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
719 (defun open-wnn-if-disconnected ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
720 (if (null (wnn-server-isconnect))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
721 (let ((hostlist
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
722 (cond ((eq wnn-server-type 'jserver)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
723 (or jserver-list
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
724 (list (or wnn-host-name (getenv "JSERVER")))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
725 ((eq wnn-server-type 'cserver)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
726 (or cserver-list
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
727 (list (or cwnn-host-name (getenv "CSERVER")))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
728 ((eq wnn-server-type 'kserver)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
729 (or kserver-list
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
730 (list (or kwnn-host-name (getenv "KSERVER")))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
731 (loginname (user-login-name)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
732 (catch 'succ
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
733 (while hostlist
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
734 (let ((hostname (car hostlist)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
735 (if (wnn-server-open hostname loginname)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
736 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
737 (cond ((eq wnn-server-type 'jserver)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
738 (setq wnn-host-name hostname))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
739 ((eq wnn-server-type 'cserver)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
740 (setq cwnn-host-name hostname))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
741 ((eq wnn-server-type 'kserver)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
742 (setq kwnn-host-name hostname)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
743 (throw 'succ hostname))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
744 (setq hostlist (cdr hostlist)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
745 (egg:error (wnn-server-get-msg))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
746
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
747 (defvar egg-default-startup-file "eggrc"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
748 "*Egg startup file name (system default)")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
749
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
750 (defvar egg-startup-file ".eggrc"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
751 "*Egg startup file name.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
752
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
753 ;;; 92/6/30, by K.Handa
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
754 (defvar egg-startup-file-search-path '("~" ".")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
755 "*List of directories to search for egg-startup-file
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
756 whose name defaults to .eggrc.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
757
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
758 (defun egg:search-file (filename searchpath)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
759 (if (file-name-directory filename)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
760 (let ((file (substitute-in-file-name (expand-file-name filename))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
761 (if (file-exists-p file) file nil))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
762 (catch 'answer
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
763 (while searchpath
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
764 (let ((path (car searchpath)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
765 (if (stringp path)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
766 (let ((file (substitute-in-file-name
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
767 (expand-file-name filename path))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
768 (if (file-exists-p file) (throw 'answer file)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
769 (setq searchpath (cdr searchpath)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
770 nil)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
771
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
772 (defun EGG:open-wnn ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
773 (let ((host (open-wnn-if-disconnected)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
774 (notify (egg:msg-get 'open-wnn)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
775 (or host "local"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
776 (let* ((path (append egg-startup-file-search-path load-path))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
777 (eggrc (or (egg:search-file egg-startup-file path)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
778 (egg:search-file egg-default-startup-file load-path))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
779 (if (or (null skip-wnn-setenv-if-env-exist)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
780 (null (wnn-server-dict-list)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
781 (if eggrc (load-file eggrc)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
782 (let ((wnnenv-sticky nil)) (wnn-server-close))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
783 (egg:error (egg:msg-get 'no-rcfile) path)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
784 (run-hooks 'egg:open-wnn-hook))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
785
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
786 (defun disconnect-wnn ()
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
787 "Dump connection to Wnn servers, discarding dictionary and frequency changes."
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
788 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
789 (if (wnn-server-isconnect) (wnn-server-close)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
790
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
791 (defun close-wnn ()
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
792 "Cleanly shutdown connection to Wnn servers, saving data and calling egg:close-wnn-hook"
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
793 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
794 (if (wnn-server-isconnect)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
795 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
796 (wnn-server-set-rev nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
797 (if (wnn-server-dict-save)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
798 (message (egg:msg-get 'file-saved))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
799 (message (wnn-server-get-msg)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
800 (sit-for 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
801 (wnn-server-set-rev t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
802 (if (wnn-server-dict-save)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
803 (message (egg:msg-get 'file-saved))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
804 (message (wnn-server-get-msg)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
805 (sit-for 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
806 (wnn-server-close)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
807 (run-hooks 'egg:close-wnn-hook))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
808
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
809 (defun set-wnn-reverse (arg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
810 ; (open-wnn-if-disconnected)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
811 (wnn-server-set-rev arg))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
812
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
813 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
814 ;;; Kanji henkan
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
815 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
816
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
817 (defvar egg:*kanji-kanabuff* nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
818 (defvar egg:*dai* t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
819 (defvar *bunsetu-number* nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
820 (defvar *zenkouho-suu* nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
821 (defvar *zenkouho-offset* nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
822
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
823 (defun bunsetu-length-sho (number)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
824 (cdr (wnn-server-bunsetu-yomi number)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
825
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
826 (defun bunsetu-length (number)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
827 (let ((max (wnn-server-dai-end number))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
828 (i (1+ number))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
829 (l (bunsetu-length-sho number)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
830 (while (< i max)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
831 (setq l (+ l (bunsetu-length-sho i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
832 (setq i (1+ i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
833 l))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
834
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
835 (defun bunsetu-position (number)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
836 (let ((pos egg:*region-start*) (i 0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
837 (while (< i number)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
838 (setq pos (+ pos (length (bunsetu-kanji i))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
839 (if (wnn-server-dai-top (1+ i))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
840 (length egg:*dai-bunsetu-kugiri*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
841 (length egg:*sho-bunsetu-kugiri*))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
842 (setq i (1+ i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
843 pos))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
844
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
845 (defun bunsetu-kanji (number) (car (wnn-server-bunsetu-kanji number)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
846
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
847 (defun bunsetu-yomi (number) (car (wnn-server-bunsetu-yomi number)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
848
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
849 (defun bunsetu-kouho-suu (bunsetu-number init)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
850 (if (or init (/= (wnn-server-zenkouho-bun) bunsetu-number))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
851 (setq *zenkouho-offset* (wnn-server-zenkouho bunsetu-number egg:*dai*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
852 (setq *zenkouho-suu* (wnn-server-zenkouho-suu)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
853
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
854 (defun bunsetu-kouho-list (bunsetu-number init)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
855 (if (or init (/= (wnn-server-zenkouho-bun) bunsetu-number))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
856 (setq *zenkouho-offset* (wnn-server-zenkouho bunsetu-number egg:*dai*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
857 (let ((i (1- (setq *zenkouho-suu* (wnn-server-zenkouho-suu))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
858 (val nil))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
859 (while (<= 0 i)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
860 (setq val (cons (wnn-server-get-zenkouho i) val))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
861 (setq i (1- i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
862 val))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
863
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
864 (defun bunsetu-kouho-number (bunsetu-number init)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
865 (if (or init (/= (wnn-server-zenkouho-bun) bunsetu-number))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
866 (setq *zenkouho-offset* (wnn-server-zenkouho bunsetu-number egg:*dai*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
867 *zenkouho-offset*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
868
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
869 ;;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
870 ;;;; User entry : henkan-region, henkan-paragraph, henkan-sentence
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
871 ;;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
872
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
873 (defun egg:henkan-face-on ()
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
874 ;; Make an extent if henkan extent does not exist.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
875 ;; Move henkan extent to henkan region.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
876 (if egg:*henkan-face*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
877 (progn
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
878 (if (extentp egg:*henkan-extent*)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
879 nil
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
880 ;; ###jhod this was a 'point-type' overlay
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
881 (setq egg:*henkan-extent* (make-extent 1 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
882 (set-extent-property egg:*henkan-extent* 'face egg:*henkan-face*))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
883 (set-extent-endpoints egg:*henkan-extent* egg:*region-start* egg:*region-end*))))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
884
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
885 (defun egg:henkan-face-off ()
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
886 ;; detach henkan extent from the current buffer.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
887 (and egg:*henkan-face*
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
888 (extentp egg:*henkan-extent*)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
889 (delete-extent egg:*henkan-extent*) ))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
890
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
891
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
892 (defun henkan-region (start end)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
893 "Convert a text in the region between START and END from kana to kanji."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
894 (interactive "r")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
895 (if (interactive-p) (set-mark (point))) ;;; to be fixed
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
896 (henkan-region-internal start end))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
897
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
898 (defun gyaku-henkan-region (start end)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
899 "Convert a text in the region between START and END from kanji to kana."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
900 (interactive "r")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
901 (if (interactive-p) (set-mark (point))) ;;; to be fixed
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
902 (henkan-region-internal start end t))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
903
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
904 ;(defvar henkan-mode-indicator "$B4A(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
905
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
906 (defun henkan-region-internal (start end &optional rev)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
907 ;; region $B$r$+$J4A;zJQ49$9$k(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
908 (if egg:henkan-mode-in-use nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
909 (let ((finished nil))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
910 (unwind-protect
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
911 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
912 (setq egg:henkan-mode-in-use t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
913 (if (null (wnn-server-isconnect)) (EGG:open-wnn))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
914 (setq egg:*kanji-kanabuff* (buffer-substring start end))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
915 ;;; for Wnn6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
916 (if (and (is-wnn6-server)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
917 (not (and
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
918 egg:*henkan-fence-mode*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
919 *in-cont-flag*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
920 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
921 (wnn6-reset-prev-info)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
922
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
923 (setq *bunsetu-number* 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
924 (setq egg:*dai* t) ; 92.9.8 by T.shingu
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
925 (wnn-server-set-rev rev)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
926 (let ((result (wnn-server-henkan-begin egg:*kanji-kanabuff*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
927 (if (null result)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
928 (egg:error (wnn-server-get-msg))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
929 (if (> result 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
930 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
931 (mode-line-egg-mode-update (egg:msg-get 'henkan-mode-indicator))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
932 (goto-char start)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
933 (or (markerp egg:*region-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
934 (setq egg:*region-start* (make-marker)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
935 (or (markerp egg:*region-end*)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
936 (setq egg:*region-end* (set-marker-insertion-type (make-marker) t)))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
937 (if (null (marker-position egg:*region-start*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
938 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
939 ;;;(setq egg:*global-map-backup* (current-global-map))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
940 (setq egg:*local-map-backup* (current-local-map))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
941 (and (boundp 'disable-undo) (setq disable-undo t))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
942 (delete-region start end)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
943 (goto-char start)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
944 (insert egg:*henkan-open*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
945 (set-marker egg:*region-start* (point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
946 (insert egg:*henkan-close*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
947 (set-marker egg:*region-end* egg:*region-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
948 (goto-char egg:*region-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
949 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
950 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
951 (egg:fence-face-off)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
952 (delete-region (- egg:*region-start* (length egg:*fence-open*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
953 egg:*region-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
954 (delete-region egg:*region-end*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
955 (+ egg:*region-end* (length egg:*fence-close*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
956 (goto-char egg:*region-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
957 (insert egg:*henkan-open*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
958 (set-marker egg:*region-start* (point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
959 (goto-char egg:*region-end*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
960 (let ((point (point)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
961 (insert egg:*henkan-close*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
962 (set-marker egg:*region-end* point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
963 (goto-char start)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
964 (delete-region start end)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
965 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
966 (henkan-insert-kouho 0 result)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
967 (egg:henkan-face-on)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
968 (egg:bunsetu-face-on)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
969 (henkan-goto-bunsetu 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
970 ;;;(use-global-map henkan-mode-map)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
971 ;;;(use-local-map nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
972 (use-local-map henkan-mode-map)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
973 (run-hooks 'egg:henkan-start-hook)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
974 (setq finished t))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
975 (or finished (setq disable-undo nil) (setq egg:henkan-mode-in-use nil)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
976 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
977
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
978 (defun henkan-paragraph ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
979 "Convert the current paragraph from kana to kanji."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
980 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
981 (forward-paragraph)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
982 (let ((end (point)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
983 (backward-paragraph)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
984 (henkan-region-internal (point) end)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
985
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
986 (defun gyaku-henkan-paragraph ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
987 "Convert the current paragraph from kanji to kana."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
988 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
989 (forward-paragraph)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
990 (let ((end (point)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
991 (backward-paragraph)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
992 (henkan-region-internal (point) end t)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
993
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
994 (defun henkan-sentence ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
995 "Convert the current sentence from kana to kanji."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
996 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
997 (forward-sentence)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
998 (let ((end (point)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
999 (backward-sentence)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1000 (henkan-region-internal (point) end)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1001
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1002 (defun gyaku-henkan-sentence ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1003 "Convert the current sentence from kanji to kana."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1004 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1005 (forward-sentence)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1006 (let ((end (point)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1007 (backward-sentence)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1008 (henkan-region-internal (point) end t)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1009
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1010 (defun henkan-word ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1011 "Convert the current word from kana to kanji."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1012 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1013 (re-search-backward "\\<" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1014 (let ((start (point)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1015 (re-search-forward "\\>" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1016 (henkan-region-internal start (point))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1017
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1018 (defun gyaku-henkan-word ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1019 "Convert the current word from kanji to kana."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1020 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1021 (re-search-backward "\\<" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1022 (let ((start (point)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1023 (re-search-forward "\\>" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1024 (henkan-region-internal start (point) t)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1025
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1026 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1027 ;;; Kana Kanji Henkan Henshuu mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1028 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1029
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1030 (defun set-egg-henkan-mode-format (open close kugiri-dai kugiri-sho
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1031 &optional henkan-face dai-bunsetu-face sho-bunsetu-face)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1032 "$BJQ49(B mode $B$NI=<(J}K!$r@_Dj$9$k!#(BOPEN $B$OJQ49$N;OE@$r<($9J8;zNs$^$?$O(B nil$B!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1033 CLOSE$B$OJQ49$N=*E@$r<($9J8;zNs$^$?$O(B nil$B!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1034 KUGIRI-DAI$B$OBgJ8@a$N6h@Z$j$rI=<($9$kJ8;zNs$^$?$O(B nil$B!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1035 KUGIRI-SHO$B$O>.J8@a$N6h@Z$j$rI=<($9$kJ8;zNs$^$?$O(B nil$B!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1036 optional HENKAN-FACE $B$OJQ496h4V$rI=<($9$k(B face $B$^$?$O(B nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1037 optional DAI-BUNSETU-FACE $B$OBgJ8@a6h4V$rI=<($9$k(B face $B$^$?$O(B nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1038 optional SHO-BUNSETU-FACE $B$O>.J8@a6h4V$rI=<($9$k(B face $B$^$?$O(B nil"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1039
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1040 (interactive (list (read-string (egg:msg-get 'begin-henkan))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1041 (read-string (egg:msg-get 'end-henkan))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1042 (read-string (egg:msg-get 'kugiri-dai))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1043 (read-string (egg:msg-get 'kugiri-sho))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1044 (cdr (assoc (completing-read (egg:msg-get 'face-henkan)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1045 egg:*face-alist*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1046 egg:*face-alist*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1047 (cdr (assoc (completing-read (egg:msg-get 'face-dai)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1048 egg:*face-alist*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1049 egg:*face-alist*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1050 (cdr (assoc (completing-read (egg:msg-get 'face-sho)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1051 egg:*face-alist*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1052 egg:*face-alist*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1053 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1054 (if (or (stringp open) (null open))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1055 (setq egg:*henkan-open* open)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1056 (egg:error "Wrong type of arguments(open): %s" open))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1057
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1058 (if (or (stringp close) (null close))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1059 (setq egg:*henkan-close* close)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1060 (egg:error "Wrong type of arguments(close): %s" close))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1061
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1062 (if (or (stringp kugiri-dai) (null kugiri-dai))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1063 (setq egg:*dai-bunsetu-kugiri* (or kugiri-dai ""))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1064 (egg:error "Wrong type of arguments(kugiri-dai): %s" kugiri-dai))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1065
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1066 (if (or (stringp kugiri-sho) (null kugiri-sho))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1067 (setq egg:*sho-bunsetu-kugiri* (or kugiri-sho ""))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1068 (egg:error "Wrong type of arguments(kugiri-sho): %s" kugiri-sho))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1069
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1070 (if (or (null henkan-face) (memq henkan-face (face-list)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1071 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1072 (setq egg:*henkan-face* henkan-face)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1073 (if (extentp egg:*henkan-extent*)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1074 (set-extent-property egg:*henkan-extent* 'face egg:*henkan-face*)))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1075 (egg:error "Wrong type of arguments(henkan-face): %s" henkan-face))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1076
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1077 (if (or (null dai-bunsetu-face) (memq dai-bunsetu-face (face-list)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1078 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1079 (setq egg:*dai-bunsetu-face* dai-bunsetu-face)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1080 (if (extentp egg:*dai-bunsetu-extent*)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1081 (set-extent-property egg:*dai-bunsetu-extent* 'face egg:*dai-bunsetu-face*)))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1082 (egg:error "Wrong type of arguments(dai-bunsetu-face): %s" dai-bunsetu-face))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1083
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1084 (if (or (null sho-bunsetu-face) (memq sho-bunsetu-face (face-list)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1085 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1086 (setq egg:*sho-bunsetu-face* sho-bunsetu-face)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1087 (if (extentp egg:*sho-bunsetu-extent*)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1088 (set-extent-property egg:*sho-bunsetu-extent* 'face egg:*sho-bunsetu-face*)))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1089 (egg:error "Wrong type of arguments(sho-bunsetu-face): %s" sho-bunsetu-face))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1090 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1091
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1092 (defun henkan-insert-kouho (start number)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1093 (let ((i start))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1094 (while (< i number)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1095 (insert (car (wnn-server-bunsetu-kanji i))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1096 (if (= (1+ i) number)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1097 ""
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1098 (if (wnn-server-dai-top (1+ i))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1099 egg:*dai-bunsetu-kugiri*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1100 egg:*sho-bunsetu-kugiri*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1101 (setq i (1+ i)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1102
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1103 (defun henkan-kakutei ()
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
1104 "Accept the current henkan region"
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1105 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1106 (egg:bunsetu-face-off)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1107 (egg:henkan-face-off)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1108 (delete-region (- egg:*region-start* (length egg:*henkan-open*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1109 egg:*region-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1110 (delete-region egg:*region-start* egg:*region-end*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1111 (delete-region egg:*region-end* (+ egg:*region-end* (length egg:*henkan-close*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1112 (goto-char egg:*region-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1113 (setq egg:*sai-henkan-start* (point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1114 (let ((i 0) (max (wnn-server-bunsetu-suu)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1115 (setq egg:*old-bunsetu-suu* max)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1116 (while (< i max)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1117 (insert (car (wnn-server-bunsetu-kanji i )))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1118 (if (not overwrite-mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1119 (undo-boundary))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1120 (setq i (1+ i))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1121 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1122 (setq egg:*sai-henkan-end* (point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1123 (wnn-server-hindo-update)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1124 (setq egg:henkan-mode-in-use nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1125 (egg:quit-egg-mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1126 (run-hooks 'egg:henkan-end-hook)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1127 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1128
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1129 ;; 92.7.10 by K.Handa
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1130 (defun henkan-kakutei-first-char ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1131 "$B3NDjJ8;zNs$N:G=i$N0lJ8;z$@$1A^F~$9$k!#(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1132 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1133 (egg:bunsetu-face-off)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1134 (egg:henkan-face-off)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1135 (delete-region (- egg:*region-start* (length egg:*henkan-open*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1136 egg:*region-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1137 (delete-region egg:*region-start* egg:*region-end*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1138 (delete-region egg:*region-end* (+ egg:*region-end*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1139 ;; 92.8.5 by Y.Kasai
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1140 (length egg:*henkan-close*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1141 (goto-char egg:*region-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1142 (insert (car (wnn-server-bunsetu-kanji 0)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1143 (if (not overwrite-mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1144 (undo-boundary))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1145 (goto-char egg:*region-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1146 (forward-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1147 (delete-region (point) egg:*region-end*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1148 (wnn-server-hindo-update)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1149 (setq egg:henkan-mode-in-use nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1150 (egg:quit-egg-mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1151 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1152 ;; end of patch
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1153
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1154 (defun henkan-kakutei-before-point ()
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
1155 "Accept the henkan region before point, and put the rest back into a fence."
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1156 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1157 (egg:bunsetu-face-off)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1158 (egg:henkan-face-off)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1159 (delete-region egg:*region-start* egg:*region-end*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1160 (goto-char egg:*region-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1161 (let ((i 0) (max *bunsetu-number*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1162 (while (< i max)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1163 (insert (car (wnn-server-bunsetu-kanji i )))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1164 (if (not overwrite-mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1165 (undo-boundary))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1166 (setq i (1+ i))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1167 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1168 (wnn-server-hindo-update *bunsetu-number*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1169 (delete-region (- egg:*region-start* (length egg:*henkan-open*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1170 egg:*region-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1171 (insert egg:*fence-open*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1172 (set-marker egg:*region-start* (point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1173 (delete-region egg:*region-end* (+ egg:*region-end* (length egg:*henkan-close*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1174 (goto-char egg:*region-end*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1175 (let ((point (point)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1176 (insert egg:*fence-close*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1177 (set-marker egg:*region-end* point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1178 (goto-char egg:*region-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1179 (egg:fence-face-on)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1180 (let ((point (point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1181 (i *bunsetu-number*) (max (wnn-server-bunsetu-suu)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1182 (while (< i max)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1183 (insert (car (wnn-server-bunsetu-yomi i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1184 (setq i (1+ i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1185 ;;;(insert "|")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1186 ;;;(insert egg:*fence-close*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1187 ;;;(set-marker egg:*region-end* (point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1188 (goto-char point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1189 (setq egg:*mode-on* t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1190 ;;;(use-global-map fence-mode-map)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1191 ;;;(use-local-map nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1192 (setq egg:henkan-mode-in-use nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1193 (use-local-map fence-mode-map)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1194 (egg:mode-line-display))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1195
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
1196 ;; ### Should probably put this on a key.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1197 (defun sai-henkan ()
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
1198 "Reconvert last henkan entry."
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1199 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1200 (if egg:henkan-mode-in-use nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1201 (let ((finished nil))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1202 (unwind-protect
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1203 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1204 (setq egg:henkan-mode-in-use t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1205 (mode-line-egg-mode-update (egg:msg-get 'henkan-mode-indicator))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1206 (goto-char egg:*sai-henkan-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1207 (setq egg:*local-map-backup* (current-local-map))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1208 (and (boundp 'disable-undo) (setq disable-undo t))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1209 (delete-region egg:*sai-henkan-start* egg:*sai-henkan-end*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1210 (goto-char egg:*sai-henkan-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1211 (insert egg:*henkan-open*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1212 (set-marker egg:*region-start* (point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1213 (insert egg:*henkan-close*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1214 (set-marker egg:*region-end* egg:*region-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1215 (goto-char egg:*region-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1216 (henkan-insert-kouho 0 egg:*old-bunsetu-suu*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1217 (egg:henkan-face-on)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1218 (egg:bunsetu-face-on)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1219 (henkan-goto-bunsetu 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1220 (use-local-map henkan-mode-map)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1221 (setq finished t))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1222 (or finished (setq disable-undo nil) (setq egg:henkan-mode-in-use nil)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1223 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1224
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1225 (defun egg:bunsetu-face-on ()
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1226 ;; make dai-bunsetu extent and sho-bunsetu extent if they do not exist.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1227 ;; put thier faces to extents and move them to each bunsetu.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1228 (let* ((bunsetu-begin *bunsetu-number*)
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
1229 (bunsetu-end))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
1230 ; (bunsetu-suu (wnn-server-bunsetu-suu)))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1231 ; dai bunsetu
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1232 (if egg:*dai-bunsetu-face*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1233 (progn
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1234 (if (extentp egg:*dai-bunsetu-extent*)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1235 nil
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1236 (setq egg:*dai-bunsetu-extent* (make-extent 1 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1237 (set-extent-property egg:*dai-bunsetu-extent* 'face egg:*dai-bunsetu-face*))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1238 (setq bunsetu-end (wnn-server-dai-end *bunsetu-number*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1239 (while (not (wnn-server-dai-top bunsetu-begin))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1240 (setq bunsetu-begin (1- bunsetu-begin)))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1241 (set-extent-endpoints egg:*dai-bunsetu-extent*
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1242 (bunsetu-position bunsetu-begin)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1243 (+ (bunsetu-position (1- bunsetu-end))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1244 (length (bunsetu-kanji (1- bunsetu-end)))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1245 ; sho bunsetu
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1246 (if egg:*sho-bunsetu-face*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1247 (progn
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1248 (if (extentp egg:*sho-bunsetu-extent*)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1249 nil
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1250 (setq egg:*sho-bunsetu-extent* (make-extent 1 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1251 (set-extent-property egg:*sho-bunsetu-extent* 'face egg:*sho-bunsetu-face*))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1252 (setq bunsetu-end (1+ *bunsetu-number*))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1253 (set-extent-endpoints egg:*sho-bunsetu-extent*
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1254 (let ((point (bunsetu-position *bunsetu-number*)))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1255 ;; ###jhod Removed the char-boundary stuff, as I *THINK* we can only move by whole chars...
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1256 ;; (if (eq egg:*sho-bunsetu-face* 'modeline)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1257 ;; (+ point (1+ (char-boundary-p point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1258 ;; point))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1259 (if (eq egg:*sho-bunsetu-face* 'modeline)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1260 (+ point 1)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1261 point))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1262
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1263 (+ (bunsetu-position (1- bunsetu-end))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1264 (length (bunsetu-kanji (1- bunsetu-end)))))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1265
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1266 (defun egg:bunsetu-face-off ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1267 (and egg:*dai-bunsetu-face*
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1268 (extentp egg:*dai-bunsetu-extent*)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1269 (delete-extent egg:*dai-bunsetu-extent*))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1270 (and egg:*sho-bunsetu-face*
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1271 (extentp egg:*sho-bunsetu-extent*)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1272 (delete-extent egg:*sho-bunsetu-extent*))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1273 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1274
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1275 (defun henkan-goto-bunsetu (number)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1276 (setq *bunsetu-number*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1277 (check-number-range number 0 (1- (wnn-server-bunsetu-suu))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1278 (goto-char (bunsetu-position *bunsetu-number*))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1279 ; (egg:move-bunsetu-extent)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1280 (egg:bunsetu-face-on)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1281 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1282
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1283 (defun henkan-forward-bunsetu ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1284 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1285 (henkan-goto-bunsetu (1+ *bunsetu-number*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1286 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1287
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1288 (defun henkan-backward-bunsetu ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1289 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1290 (henkan-goto-bunsetu (1- *bunsetu-number*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1291 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1292
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1293 (defun henkan-first-bunsetu ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1294 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1295 (henkan-goto-bunsetu 0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1296
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1297 (defun henkan-last-bunsetu ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1298 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1299 (henkan-goto-bunsetu (1- (wnn-server-bunsetu-suu)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1300 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1301
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1302 (defun check-number-range (i min max)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1303 (cond((< i min) max)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1304 ((< max i) min)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1305 (t i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1306
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1307 (defun henkan-hiragana ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1308 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1309 (henkan-goto-kouho (- (bunsetu-kouho-suu *bunsetu-number* nil) 1)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1310
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1311 (defun henkan-katakana ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1312 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1313 (henkan-goto-kouho (- (bunsetu-kouho-suu *bunsetu-number* nil) 2)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1314
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1315 (defun henkan-next-kouho ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1316 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1317 (henkan-goto-kouho (1+ (bunsetu-kouho-number *bunsetu-number* nil))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1318
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1319 (defun henkan-next-kouho-dai ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1320 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1321 (let ((init (not egg:*dai*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1322 (setq egg:*dai* t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1323 (henkan-goto-kouho (1+ (bunsetu-kouho-number *bunsetu-number* init)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1324
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1325 (defun henkan-next-kouho-sho ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1326 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1327 (let ((init egg:*dai*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1328 (setq egg:*dai* nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1329 (henkan-goto-kouho (1+ (bunsetu-kouho-number *bunsetu-number* init)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1330
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1331 (defun henkan-previous-kouho ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1332 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1333 (henkan-goto-kouho (1- (bunsetu-kouho-number *bunsetu-number* nil))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1334
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1335 (defun henkan-previous-kouho-dai ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1336 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1337 (let ((init (not egg:*dai*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1338 (setq egg:*dai* t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1339 (henkan-goto-kouho (1- (bunsetu-kouho-number *bunsetu-number* init)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1340
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1341 (defun henkan-previous-kouho-sho ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1342 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1343 (let ((init egg:*dai*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1344 (setq egg:*dai* nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1345 (henkan-goto-kouho (1- (bunsetu-kouho-number *bunsetu-number* init)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1346
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1347 (defun henkan-goto-kouho (kouho-number)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1348 ; (egg:bunsetu-face-off)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1349 (let ((point (point))
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
1350 ; (yomi (bunsetu-yomi *bunsetu-number*))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1351 (max)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1352 (min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1353 (setq kouho-number
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1354 (check-number-range kouho-number
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1355 0
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1356 (1- (length (bunsetu-kouho-list
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1357 *bunsetu-number* nil)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1358 (setq *zenkouho-offset* kouho-number)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1359 (wnn-server-henkan-kakutei kouho-number egg:*dai*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1360 (setq max (wnn-server-bunsetu-suu))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1361 (setq min (max 0 (1- *bunsetu-number*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1362 (delete-region
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1363 (bunsetu-position min) egg:*region-end*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1364 (goto-char (bunsetu-position min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1365 (henkan-insert-kouho min max)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1366 (goto-char point))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1367 ; (egg:move-bunsetu-extent)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1368 (egg:bunsetu-face-on)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1369 (egg:henkan-face-on)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1370 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1371
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1372 (defun henkan-bunsetu-chijime-dai ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1373 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1374 (setq egg:*dai* t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1375 (or (= (bunsetu-length *bunsetu-number*) 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1376 (bunsetu-length-henko (1- (bunsetu-length *bunsetu-number*)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1377
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1378 (defun henkan-bunsetu-chijime-sho ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1379 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1380 (setq egg:*dai* nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1381 (or (= (bunsetu-length-sho *bunsetu-number*) 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1382 (bunsetu-length-henko (1- (bunsetu-length-sho *bunsetu-number*)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1383
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1384 (defun henkan-bunsetu-nobasi-dai ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1385 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1386 (setq egg:*dai* t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1387 (let ((i *bunsetu-number*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1388 (max (wnn-server-bunsetu-suu))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1389 (len (bunsetu-length *bunsetu-number*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1390 (maxlen 0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1391 (while (< i max)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1392 (setq maxlen (+ maxlen (cdr (wnn-server-bunsetu-yomi i))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1393 (setq i (1+ i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1394 (if (not (= len maxlen))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1395 (bunsetu-length-henko (1+ len)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1396
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1397 (defun henkan-bunsetu-nobasi-sho ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1398 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1399 (setq egg:*dai* nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1400 (let ((i *bunsetu-number*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1401 (max (wnn-server-bunsetu-suu))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1402 (len (bunsetu-length-sho *bunsetu-number*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1403 (maxlen 0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1404 (while (< i max)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1405 (setq maxlen (+ maxlen (cdr (wnn-server-bunsetu-yomi i))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1406 (setq i (1+ i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1407 (if (not (= len maxlen))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1408 (bunsetu-length-henko (1+ len)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1409
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1410 ; (if (not (= (1+ *bunsetu-number*) (wnn-server-bunsetu-suu)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1411 ; (bunsetu-length-henko (1+ (bunsetu-length *bunsetu-number*)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1412
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1413
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1414 (defun henkan-saishou-bunsetu ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1415 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1416 (bunsetu-length-henko 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1417
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1418 (defun henkan-saichou-bunsetu ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1419 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1420 (let ((max (wnn-server-bunsetu-suu)) (i *bunsetu-number*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1421 (l 0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1422 (while (< i max)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1423 (setq l (+ l (bunsetu-length-sho i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1424 (setq i (1+ i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1425 (bunsetu-length-henko l)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1426
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1427 (defun bunsetu-length-henko (length)
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
1428 (let ((r (wnn-server-bunsetu-henkou *bunsetu-number* length egg:*dai*))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1429 (start (max 0 (1- *bunsetu-number*))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1430 (cond((null r)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1431 (egg:error (wnn-server-get-msg)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1432 ((> r 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1433 ; (egg:henkan-face-off)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1434 ; (egg:bunsetu-face-off)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1435 (delete-region
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1436 (bunsetu-position start) egg:*region-end*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1437 (goto-char (bunsetu-position start))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1438 (henkan-insert-kouho start r)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1439 (henkan-goto-bunsetu *bunsetu-number*)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1440
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1441 (defun henkan-quit ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1442 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1443 (egg:bunsetu-face-off)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1444 (egg:henkan-face-off)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1445 (delete-region (- egg:*region-start* (length egg:*henkan-open*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1446 egg:*region-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1447 (delete-region egg:*region-start* egg:*region-end*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1448 (delete-region egg:*region-end* (+ egg:*region-end* (length egg:*henkan-close*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1449 (goto-char egg:*region-start*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1450 (insert egg:*fence-open*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1451 (set-marker egg:*region-start* (point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1452 (insert egg:*kanji-kanabuff*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1453 (let ((point (point)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1454 (insert egg:*fence-close*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1455 (set-marker egg:*region-end* point)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1456 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1457 (goto-char egg:*region-end*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1458 (egg:fence-face-on)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1459 (wnn-server-henkan-quit)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1460 (setq egg:*mode-on* t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1461 ;;;(use-global-map fence-mode-map)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1462 ;;;(use-local-map nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1463 (setq egg:henkan-mode-in-use nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1464 (use-local-map fence-mode-map)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1465 (egg:mode-line-display)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1466 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1467
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1468 (defun henkan-select-kouho (init)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1469 (if (not (eq (selected-window) (minibuffer-window)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1470 (let ((kouho-list (bunsetu-kouho-list *bunsetu-number* init))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1471 menu)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1472 (setq menu
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1473 (list 'menu (egg:msg-get 'jikouho)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1474 (let ((l kouho-list) (r nil) (i 0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1475 (while l
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1476 (setq r (cons (cons (car l) i) r))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1477 (setq i (1+ i))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1478 (setq l (cdr l)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1479 (reverse r))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1480 (henkan-goto-kouho
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1481 (menu:select-from-menu menu
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1482 (bunsetu-kouho-number *bunsetu-number* nil))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1483 (beep)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1484
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1485 (defun henkan-select-kouho-dai ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1486 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1487 (let ((init (not egg:*dai*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1488 (setq egg:*dai* t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1489 (henkan-select-kouho init)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1490
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1491 (defun henkan-select-kouho-sho ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1492 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1493 (let ((init egg:*dai*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1494 (setq egg:*dai* nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1495 (henkan-select-kouho init)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1496
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1497 (defun henkan-word-off ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1498 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1499 (let ((info (wnn-server-inspect *bunsetu-number*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1500 (if (null info)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1501 (notify (wnn-server-get-msg))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1502 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1503 (let ((dic-list (wnn-server-dict-list)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1504 (if (null dic-list)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1505 (notify (wnn-server-get-msg))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1506 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1507 (let* ((kanji (nth 0 info))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1508 (yomi (nth 1 info))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1509 (serial (nth 3 info))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1510 (jisho-no (nth 2 info))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1511 (jisho-name (nth 2 (assoc jisho-no dic-list))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1512 (if (wnn-server-word-use jisho-no serial)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1513 (notify (egg:msg-get 'off-msg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1514 kanji yomi jisho-name serial)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1515 (egg:error (wnn-server-get-msg)))))))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1516
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1517 (defun henkan-kakutei-and-self-insert ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1518 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1519 (setq unread-command-events (list last-command-event))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1520 (henkan-kakutei))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1521
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1522 (defvar henkan-mode-map (make-keymap))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1523 (defvar henkan-mode-esc-map (make-keymap))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1524
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1525 (define-key henkan-mode-map [t] 'undefined)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1526 (define-key henkan-mode-esc-map [t] 'undefined)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1527
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1528 (let ((ch 0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1529 (while (<= ch 127)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1530 (define-key henkan-mode-map (char-to-string ch) 'undefined)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1531 (define-key henkan-mode-esc-map (char-to-string ch) 'undefined)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1532 (setq ch (1+ ch))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1533
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1534 (let ((ch 32))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1535 (while (< ch 127)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1536 (define-key henkan-mode-map (char-to-string ch) 'henkan-kakutei-and-self-insert)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1537 (setq ch (1+ ch))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1538
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1539 (define-key henkan-mode-map "\e" henkan-mode-esc-map)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1540 (define-key henkan-mode-map [escape] henkan-mode-esc-map)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1541 ;(define-key henkan-mode-map "\ei" 'henkan-inspect-bunsetu)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1542 (define-key henkan-mode-map "\ei" 'henkan-bunsetu-chijime-sho)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1543 (define-key henkan-mode-map "\eo" 'henkan-bunsetu-nobasi-sho)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1544 (define-key henkan-mode-map "\es" 'henkan-select-kouho-dai)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1545 (define-key henkan-mode-map "\eh" 'henkan-hiragana)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1546 (define-key henkan-mode-map "\ek" 'henkan-katakana)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1547 (define-key henkan-mode-map "\ez" 'henkan-select-kouho-sho)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1548 (define-key henkan-mode-map "\e<" 'henkan-saishou-bunsetu)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1549 (define-key henkan-mode-map "\e>" 'henkan-saichou-bunsetu)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1550 ;(define-key henkan-mode-map " " 'henkan-next-kouho-dai)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1551 ; 92.9.8 by T.Shingu
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1552 (define-key henkan-mode-map " " 'henkan-next-kouho)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1553 ; 92.7.10 by K.Handa
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1554 (define-key henkan-mode-map "\C-@" 'henkan-kakutei-first-char)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1555 (define-key henkan-mode-map [?\C-\ ] 'henkan-kakutei-first-char)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1556 (define-key henkan-mode-map "\C-a" 'henkan-first-bunsetu)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1557 (define-key henkan-mode-map "\C-b" 'henkan-backward-bunsetu)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1558 (define-key henkan-mode-map "\C-c" 'henkan-quit)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1559 (define-key henkan-mode-map "\C-e" 'henkan-last-bunsetu)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1560 (define-key henkan-mode-map "\C-f" 'henkan-forward-bunsetu)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1561 (define-key henkan-mode-map "\C-g" 'henkan-quit)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1562 (define-key henkan-mode-map "\C-h" 'henkan-help-command)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1563 (define-key henkan-mode-map "\C-i" 'henkan-bunsetu-chijime-dai)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1564 (define-key henkan-mode-map "\C-k" 'henkan-kakutei-before-point)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1565 (define-key henkan-mode-map "\C-l" 'henkan-kakutei)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1566 (define-key henkan-mode-map "\C-m" 'henkan-kakutei)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1567 (define-key henkan-mode-map [return] 'henkan-kakutei)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1568 (define-key henkan-mode-map "\C-n" 'henkan-next-kouho)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1569 (define-key henkan-mode-map "\C-o" 'henkan-bunsetu-nobasi-dai)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1570 (define-key henkan-mode-map "\C-p" 'henkan-previous-kouho)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1571 (define-key henkan-mode-map "\C-t" 'toroku-henkan-mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1572 (define-key henkan-mode-map "\C-u" 'undefined)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1573 (define-key henkan-mode-map "\C-v" 'henkan-inspect-bunsetu)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1574 (define-key henkan-mode-map "\C-w" 'henkan-next-kouho-dai)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1575 (define-key henkan-mode-map "\C-z" 'henkan-next-kouho-sho)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1576 (define-key henkan-mode-map "\177" 'henkan-quit)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1577 (define-key henkan-mode-map [delete] 'henkan-quit)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1578 (define-key henkan-mode-map [backspace] 'henkan-quit)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1579 (define-key henkan-mode-map [right] 'henkan-forward-bunsetu)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1580 (define-key henkan-mode-map [left] 'henkan-backward-bunsetu)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1581 (define-key henkan-mode-map [down] 'henkan-next-kouho)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1582 (define-key henkan-mode-map [up] 'henkan-previous-kouho)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1583
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1584 (defun henkan-help-command ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1585 "Display documentation for henkan-mode."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1586 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1587 (let ((buf "*Help*"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1588 (if (eq (get-buffer buf) (current-buffer))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1589 (henkan-quit)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1590 (with-output-to-temp-buffer buf
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1591 ;;(princ (substitute-command-keys henkan-mode-document-string))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1592 (princ (substitute-command-keys (egg:msg-get 'henkan-help)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1593 (print-help-return-message)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1594
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1595 ;;;----------------------------------------------------------------------
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1596 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1597 ;;; Dictionary management Facility
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1598 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1599 ;;;----------------------------------------------------------------------
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1600
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1601 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1602 ;;; $B<-=qEPO?(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1603 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1604
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1605 ;;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1606 ;;;; User entry: toroku-region
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1607 ;;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1608
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1609 (defun remove-regexp-in-string (regexp string)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1610 (cond((not(string-match regexp string))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1611 string)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1612 (t(let ((str nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1613 (ostart 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1614 (oend (match-beginning 0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1615 (nstart (match-end 0)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1616 (setq str (concat str (substring string ostart oend)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1617 (while (string-match regexp string nstart)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1618 (setq ostart nstart)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1619 (setq oend (match-beginning 0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1620 (setq nstart (match-end 0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1621 (setq str (concat str (substring string ostart oend))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1622 (concat str (substring string nstart))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1623
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1624 (defun hinsi-from-menu (dict-number name)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1625 (let ((result (wnn-server-hinsi-list dict-number name))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1626 ; (hinsi-pair)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1627 (menu))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1628 (if (null result)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1629 (egg:error (wnn-server-get-msg))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1630 (if (eq result 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1631 name
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1632 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1633 ; (setq hinsi-pair (mapcar '(lambda (x) (cons x x)) result))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1634 ; (if (null (string= name "/"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1635 ; (setq hinsi-pair (cons (cons "/" "/") hinsi-pair)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1636 ; (setq menu (list 'menu (egg:msg-get 'hinsimei) hinsi-pair))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1637 (setq menu (list 'menu (egg:msg-get 'hinsimei)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1638 (if (string= name "/")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1639 result
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1640 (cons "/" result))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1641 (hinsi-from-menu dict-number
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1642 (menu:select-from-menu menu)))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1643
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1644 (defun wnn-dict-name (dict-number dict-list)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1645 (let* ((dict-info (assoc dict-number dict-list))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1646 (dict-comment (nth 2 dict-info)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1647 (if (string= dict-comment "")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1648 (file-name-nondirectory (nth 1 dict-info))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1649 dict-comment)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1650
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1651 (defun egg:toroku-word (yomi kanji interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1652 (let*((dic-list (wnn-server-dict-list))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1653 (writable-dic-list (wnn-server-hinsi-dicts -1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1654 (dict-number
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1655 (menu:select-from-menu
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1656 (list 'menu (egg:msg-get 'touroku-jishomei)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1657 (mapcar '(lambda (x)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1658 (let ((y (car (assoc x dic-list))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1659 (cons (wnn-dict-name y dic-list) y)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1660 writable-dic-list))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1661 (hinsi-name (hinsi-from-menu dict-number "/"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1662 (hinsi-no (wnn-server-hinsi-number hinsi-name))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1663 (dict-name (wnn-dict-name dict-number dic-list)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1664 (if (or (not interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1665 (notify-yes-or-no-p (egg:msg-get 'register-notify)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1666 kanji yomi hinsi-name dict-name))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1667 (if (wnn-server-word-add dict-number kanji yomi "" hinsi-no)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1668 (notify (egg:msg-get 'registerd) kanji yomi hinsi-name dict-name)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1669 (egg:error (wnn-server-get-msg))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1670
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1671 (defun toroku-region (start end)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1672 (interactive "r")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1673 (if (null (wnn-server-isconnect)) (EGG:open-wnn))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1674 (wnn-server-set-rev nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1675 (let*((kanji
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1676 (remove-regexp-in-string "[\0-\37]" (buffer-substring start end)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1677 (yomi (read-current-its-string
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1678 (format (egg:msg-get 'jishotouroku-yomi) kanji))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1679 (egg:toroku-word yomi kanji nil)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1680
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1681 (defun delete-space (string)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1682 (let ((len (length string)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1683 (if (eq len 0) ""
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1684 (if (or (char-equal (aref string 0) ? ) (char-equal (aref string 0) ?-))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1685 (delete-space (substring string 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1686 (concat (substring string 0 1) (delete-space (substring string 1)))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1687
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1688
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1689 (defun toroku-henkan-mode ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1690 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1691 (let*((kanji
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1692 (read-current-its-string (egg:msg-get 'kanji)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1693 (delete-space
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1694 (buffer-substring (point) egg:*region-end* ))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1695 (yomi (read-current-its-string
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1696 (format (egg:msg-get 'jishotouroku-yomi) kanji)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1697 (let ((str "")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1698 (i *bunsetu-number*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1699 (max (wnn-server-bunsetu-suu)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1700 (while (< i max)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1701 (setq str (concat str (car (wnn-server-bunsetu-yomi i)) ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1702 (setq i (1+ i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1703 str))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1704 (egg:toroku-word yomi kanji nil)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1705
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1706 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1707 ;;; $B<-=qJT=87O(B DicEd
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1708 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1709
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1710 (defvar *diced-window-configuration* nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1711
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1712 (defvar *diced-dict-info* nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1713
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1714 (defvar *diced-yomi* nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1715
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1716 ;;;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1717 ;;;;; User entry : edit-dict-item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1718 ;;;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1719
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1720 (defun edit-dict-item (yomi)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1721 (interactive (list (read-current-its-string (egg:msg-get 'yomi))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1722 (if (null (wnn-server-isconnect)) (EGG:open-wnn))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1723 (wnn-server-set-rev nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1724 (let ((dict-info (wnn-server-word-search yomi))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1725 (current-wnn-server-type))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1726 (if (null dict-info)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1727 (message (egg:msg-get 'no-yomi) yomi)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1728 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1729 (setq current-wnn-server-type wnn-server-type)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1730 (setq *diced-yomi* yomi)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1731 (setq *diced-window-configuration* (current-window-configuration))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1732 (pop-to-buffer "*Nihongo Dictionary Information*")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1733 (setq wnn-server-type current-wnn-server-type)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1734 (setq major-mode 'diced-mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1735 (setq mode-name "Diced")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1736 (setq mode-line-buffer-identification
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1737 (concat "DictEd: " yomi
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1738 (make-string (max 0 (- 17 (string-width yomi))) ? )))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1739 (sit-for 0) ;; will redislay.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1740 ;;;(use-global-map diced-mode-map)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1741 (use-local-map diced-mode-map)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1742 (diced-display dict-info)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1743 ))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1744
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1745 (defun diced-redisplay ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1746 (wnn-server-set-rev nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1747 (let ((dict-info (wnn-server-word-search *diced-yomi*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1748 (if (null dict-info)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1749 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1750 (message (egg:msg-get 'no-yomi) *diced-yomi*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1751 (diced-quit))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1752 (diced-display dict-info))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1753
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1754 (defun diced-display (dict-info)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1755 ;;; (values (list (record kanji bunpo hindo dict-number serial-number)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1756 ;;; 0 1 2 3 4
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1757 (setq dict-info
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1758 (sort dict-info
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1759 (function (lambda (x y)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1760 (or (< (nth 1 x) (nth 1 y))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1761 (if (= (nth 1 x) (nth 1 y))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1762 (or (> (nth 2 x) (nth 2 y))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1763 (if (= (nth 2 x) (nth 2 y))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1764 (< (nth 3 x) (nth 3 y))))))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1765 (setq *diced-dict-info* dict-info)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1766 (setq buffer-read-only nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1767 (erase-buffer)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1768 (let ((l-kanji
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1769 (apply 'max
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1770 (mapcar (function (lambda (l) (string-width (nth 0 l))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1771 dict-info)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1772 (l-bunpo
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1773 (apply 'max
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1774 (mapcar (function(lambda (l)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1775 (string-width (wnn-server-hinsi-name (nth 1 l)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1776 dict-info)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1777 (dict-list (wnn-server-dict-list))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1778 (writable-dict-list (wnn-server-hinsi-dicts -1)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1779 (while dict-info
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1780 (let*((kanji (nth 0 (car dict-info)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1781 (bunpo (nth 1 (car dict-info)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1782 (hinshi (wnn-server-hinsi-name bunpo))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1783 (hindo (nth 2 (car dict-info)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1784 (dict-number (nth 3 (car dict-info)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1785 (dict-name (wnn-dict-name dict-number dict-list))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1786 (sys-dict-p (null (memq dict-number writable-dict-list)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1787 (serial-number (nth 4 (car dict-info))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1788 (insert (if sys-dict-p " *" " "))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1789 (insert kanji)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1790 (insert-char ?
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1791 (- (+ l-kanji 10) (string-width kanji)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1792 (insert hinshi)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1793 (insert-char ? (- (+ l-bunpo 2) (string-width hinshi)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1794 (insert (egg:msg-get 'jisho) (file-name-nondirectory dict-name)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1795 "/" (int-to-string serial-number)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1796 (egg:msg-get 'hindo) (int-to-string hindo) ?\n )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1797 (setq dict-info (cdr dict-info))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1798 (goto-char (point-min)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1799 (setq buffer-read-only t))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1800
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1801 (defun diced-add ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1802 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1803 (diced-execute t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1804 (let*((kanji (read-from-minibuffer (egg:msg-get 'kanji))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1805 (egg:toroku-word *diced-yomi* kanji t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1806 (diced-redisplay)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1807
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1808 (defun diced-delete ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1809 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1810 (beginning-of-line)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1811 (if (= (char-after (1+ (point))) ?* )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1812 (progn (message (egg:msg-get 'cannot-remove)) (beep))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1813 (if (= (following-char) ? )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1814 (let ((buffer-read-only nil))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1815 (delete-char 1) (insert "D") (backward-char 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1816 )))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1817
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1818
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1819 (defun diced-undelete ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1820 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1821 (beginning-of-line)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1822 (if (= (following-char) ?D)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1823 (let ((buffer-read-only nil))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1824 (delete-char 1) (insert " ") (backward-char 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1825 (beep)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1826
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1827 (defun diced-redisplay-hindo (dict-number serial-number)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1828 (let ((hindo))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1829 (setq buffer-read-only nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1830 (beginning-of-line)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1831 (re-search-forward "\\([0-9\-]+\\)\\(\n\\)")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1832 (delete-region (match-beginning 1) (match-end 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1833 (setq hindo (nth 3 (wnn-server-word-info dict-number serial-number)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1834 (goto-char (match-beginning 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1835 (insert (int-to-string hindo))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1836 (beginning-of-line)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1837 (setq buffer-read-only t)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1838
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1839 (defun diced-use ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1840 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1841 (let* ((dict-item (nth
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1842 (+ (count-lines (point-min) (point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1843 (if (= (current-column) 0) 1 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1844 -1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1845 *diced-dict-info*))
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
1846 ; (hindo (nth 2 dict-item))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1847 (dict-number (nth 3 dict-item))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1848 (serial-number (nth 4 dict-item))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1849 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1850 (if (null (wnn-server-word-use dict-number serial-number))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1851 (egg:error (wnn-server-get-msg)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1852 (diced-redisplay-hindo dict-number serial-number)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1853
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1854 (defun diced-hindo-set (&optional newhindo)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1855 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1856 (if (null newhindo)
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
1857 (setq newhindo (read-expression (egg:msg-get 'enter-hindo))))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1858 (let* ((dict-item (nth
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1859 (+ (count-lines (point-min) (point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1860 (if (= (current-column) 0) 1 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1861 -1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1862 *diced-dict-info*))
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
1863 ; (hindo (nth 2 dict-item))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1864 (dict-number (nth 3 dict-item))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1865 (serial-number (nth 4 dict-item))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1866 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1867 (if (null (wnn-server-word-hindo-set dict-number serial-number newhindo))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1868 (egg:error (wnn-server-get-msg)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1869 (diced-redisplay-hindo dict-number serial-number)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1870
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1871 (defun diced-quit ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1872 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1873 (setq buffer-read-only nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1874 (erase-buffer)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1875 (setq buffer-read-only t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1876 (bury-buffer (get-buffer "*Nihongo Dictionary Information*"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1877 (set-window-configuration *diced-window-configuration*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1878 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1879
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1880 (defun diced-execute (&optional display)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1881 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1882 (goto-char (point-min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1883 (let ((no 0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1884 (while (not (eobp))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1885 (if (= (following-char) ?D)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1886 (let* ((dict-item (nth no *diced-dict-info*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1887 (kanji (nth 0 dict-item))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1888 (bunpo (nth 1 dict-item))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1889 (hinshi (wnn-server-hinsi-name bunpo))
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
1890 ; (hindo (nth 2 dict-item))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1891 (dict-number (nth 3 dict-item))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1892 (dict-name (wnn-dict-name dict-number (wnn-server-dict-list)))
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
1893 ; (sys-dict-p (null (memq dict-number (wnn-server-hinsi-dicts -1))))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1894 (serial-number (nth 4 dict-item))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1895 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1896 (if (notify-yes-or-no-p (egg:msg-get 'remove-notify)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1897 kanji hinshi dict-name)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1898 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1899 (if (wnn-server-word-delete dict-number serial-number)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1900 (notify (egg:msg-get 'removed)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1901 kanji hinshi dict-name)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1902 (egg:error (wnn-server-get-msg)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1903 ))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1904 (setq no (1+ no))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1905 (forward-line 1)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1906 (forward-line -1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1907 (if (not display) (diced-redisplay)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1908
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1909 (defun diced-next-line ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1910 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1911 (beginning-of-line)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1912 (forward-line 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1913 (if (eobp) (progn (beep) (forward-line -1))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1914
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1915 (defun diced-end-of-buffer ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1916 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1917 (goto-char (point-max))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1918 (forward-line -1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1919
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1920 (defun diced-scroll-down ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1921 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1922 (scroll-down)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1923 (if (eobp) (forward-line -1)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1924
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1925 (defun diced-mode ()
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
1926 "Mode for \"editing\" Wnn dictionaries.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1927 In diced, you are \"editing\" a list of the entries in dictionaries.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1928 You can move using the usual cursor motion commands.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1929 Letters no longer insert themselves. Instead,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1930
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1931 Type a to Add new entry.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1932 Type d to flag an entry for Deletion.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1933 Type n to move cursor to Next entry.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1934 Type p to move cursor to Previous entry.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1935 Type q to Quit from DicEd.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1936 Type C-u to Toggle the word to use/unuse.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1937 Type u to Unflag an entry (remove its D flag).
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1938 Type x to eXecute the deletions requested.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1939 "
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1940 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1941
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1942 (defvar diced-mode-map (let ((map (make-sparse-keymap))) (suppress-keymap map) map))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1943
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1944 (define-key diced-mode-map "a" 'diced-add)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1945 (define-key diced-mode-map "d" 'diced-delete)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1946 (define-key diced-mode-map "n" 'diced-next-line)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1947 (define-key diced-mode-map "p" 'previous-line)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1948 (define-key diced-mode-map "q" 'diced-quit)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1949 ;(define-key diced-mode-map "t" 'diced-use)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1950 (define-key diced-mode-map "u" 'diced-undelete)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1951 (define-key diced-mode-map "x" 'diced-execute)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1952
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1953 (define-key diced-mode-map "\C-h" 'help-command)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1954 (define-key diced-mode-map "\C-n" 'diced-next-line)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1955 (define-key diced-mode-map "\C-p" 'previous-line)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1956 (define-key diced-mode-map "\C-u" 'diced-use)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1957 (define-key diced-mode-map "\C-v" 'scroll-up)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1958 (define-key diced-mode-map "\eh" 'diced-hindo-set)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1959 (define-key diced-mode-map "\e<" 'beginning-of-buffer)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1960 (define-key diced-mode-map "\e>" 'diced-end-of-buffer)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1961 (define-key diced-mode-map "\ev" 'diced-scroll-down)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1962
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1963 (define-key diced-mode-map [up] 'previous-line)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1964 (define-key diced-mode-map [down] 'diced-next-line)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1965
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1966
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1967 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1968 ;;; set comment on dictionary
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1969 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1970
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1971 (defun set-dict-comment ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1972 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1973 (if (null (wnn-server-isconnect)) (EGG:open-wnn))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1974 (wnn-server-set-rev nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1975 (let*((dic-list (wnn-server-dict-list))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1976 (writable-dic-list (wnn-server-hinsi-dicts -1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1977 (dict-number
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1978 (menu:select-from-menu
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1979 (list 'menu (egg:msg-get 'jishomei)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1980 (mapcar '(lambda (x)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1981 (let ((y (assoc x dic-list)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1982 (cons (nth 1 y) (nth 0 y))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1983 writable-dic-list))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1984 (comment (read-from-minibuffer (egg:msg-get 'comment)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1985 (wnn-dict-name dict-number dic-list))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1986 (if (wnn-server-dict-comment dict-number comment)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1987 (notify (egg:msg-get 'jisho-comment)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1988 (wnn-dict-name dict-number dic-list) comment)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1989 (egg:error (wnn-server-get-msg)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1990
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1991
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1992 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1993 ;;; Pure inspect facility
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1994 ;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1995
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1996 (defun henkan-inspect-bunsetu ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1997 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1998 (let ((info (wnn-server-inspect *bunsetu-number*)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1999 (if (null info)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2000 (notify (wnn-server-get-msg))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2001 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2002 (let ((dic-list (wnn-server-dict-list)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2003 (if (null dic-list)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2004 (notify (wnn-server-get-msg))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2005 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2006 (let ((hinsi (wnn-server-hinsi-name (nth 4 info)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2007 (kanji (nth 0 info))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2008 (yomi (nth 1 info))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2009 (serial (nth 3 info))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2010 (hindo (nth 5 info))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2011 (jisho (wnn-dict-name (nth 2 info) dic-list))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2012 (ima (nth 6 info))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2013 (hyoka (nth 7 info))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2014 (daihyoka (nth 8 info))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2015 (kangovect (nth 9 info)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2016 (notify-internal
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2017 (format "%s %s(%s %s:%s Freq:%s%s) S:%s D:%s V:%s "
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2018 kanji yomi hinsi jisho serial
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2019 (if (= ima 1) "*" " ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2020 hindo hyoka daihyoka kangovect)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2021 t)))))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2022
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
2023 (provide 'egg-wnn)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2024
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 98
diff changeset
2025 ;;; egg-wnn.el ends here