Mercurial > hg > xemacs-beta
comparison lisp/mule/canna.el @ 120:cca96a509cfe r20-1b12
Import from CVS: tag r20-1b12
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:25:29 +0200 |
parents | 7d55a9ba150c |
children | 6608ceec7cf8 |
comparison
equal
deleted
inserted
replaced
119:d101af7320b8 | 120:cca96a509cfe |
---|---|
1 ;;; canna.el --- Interface to the Canna input method. | 1 ;;; canna.el --- Interface to the Canna input method. |
2 | 2 |
3 ;; This file is part of XEmacs. | 3 ;; Copyright (C) 1994 Akira Kon, NEC Corporation. |
4 | 4 ;; Copyright (C) 1996,1997 MORIOKA Tomohiko |
5 ;; XEmacs is free software; you can redistribute it and/or modify it | 5 |
6 ;; under the terms of the GNU General Public License as published by | 6 ;; Author: Akira Kon <kon@d1.bs2.mt.nec.co.jp> |
7 ;; the Free Software Foundation; either version 2, or (at your option) | 7 ;; MORIOKA Tomohiko <morioka@jaist.ac.jp> |
8 ;; any later version. | 8 ;; Version: $Revision: 1.5 $ |
9 | 9 ;; Keywords: Canna, Japanese, input method, mule, multilingual |
10 ;; XEmacs is distributed in the hope that it will be useful, but | 10 |
11 ;; This file is not a part of Emacs yet. | |
12 | |
13 ;; This program is free software; you can redistribute it and/or | |
14 ;; modify it under the terms of the GNU General Public License as | |
15 ;; published by the Free Software Foundation; either version 2, or (at | |
16 ;; your option) any later version. | |
17 | |
18 ;; This program is distributed in the hope that it will be useful, but | |
11 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | 19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of |
12 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 ;; General Public License for more details. | 21 ;; General Public License for more details. |
14 | 22 |
15 ;; You should have received a copy of the GNU General Public License | 23 ;; You should have received a copy of the GNU General Public License |
16 ;; along with XEmacs; see the file COPYING. If not, write to the | 24 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
17 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 ;; Boston, MA 02111-1307, USA. | 26 ;; Boston, MA 02111-1307, USA. |
19 | 27 |
20 ;;; Synched up with: Mule 2.3. | 28 ;;; Commentary: |
21 | 29 |
22 ;; Egg offered some influences to the implementation of | 30 ;; Egg offered some influences to the implementation of Canna on |
23 ;; Canna on Nemacs/Mule, and this file contains a few part | 31 ;; Nemacs/Mule, and this file contains a few part of Egg which is |
24 ;; of Egg which is written by S.Tomura, Electrotechnical | 32 ;; written by S.Tomura, Electrotechnical Lab. (tomura@etl.go.jp) |
25 ;; Lab. (tomura@etl.go.jp) | 33 |
26 | 34 ;; This program is rewritten for Emacs/mule and XEmacs/mule by MORIOKA |
27 ;; Written by Akira Kon, NEC Corporation. | 35 ;; Tomohiko. |
28 ;; E-Mail: kon@d1.bs2.mt.nec.co.jp. | 36 |
29 | 37 ;;; Code: |
30 ;; #### This is far from working in XEmacs. | 38 |
31 | 39 ;; -*-mode: emacs-lisp-*- |
32 ;; added by MORIOKA Tomohiko <morioka@jaist.ac.jp>, 1996/6/18 | 40 |
33 (defvar running-xemacs (string-match "XEmacs" emacs-version)) | 41 ;; by $B<i2,(B $BCNI'(B <morioka@jaist.ac.jp> 1996/11/11 |
34 | 42 (or (boundp 'CANNA) |
35 (if running-xemacs (require 'overlay)) | 43 (let ((handle (dynamic-link (expand-file-name "canna.so" exec-directory)))) |
36 | 44 (dynamic-call "emacs_canna_init" handle)) |
37 ;; added by MORIOKA Tomohiko <morioka@jaist.ac.jp>, 1996/6/7 | |
38 (or (fboundp 'minibuffer-prompt-width) | |
39 (defun minibuffer-prompt-width () | |
40 (save-excursion | |
41 (set-buffer (window-buffer (minibuffer-window))) | |
42 (current-column) | |
43 )) | |
44 ) | 45 ) |
45 (or (fboundp 'char-before) | 46 |
46 (defun char-before (pos) | 47 (defvar self-insert-after-hook nil) |
47 (char-after (1- (point))) | 48 ;; (defalias 'self-insert-internal 'self-insert-command) |
48 ) | 49 ;; end |
49 ) | 50 |
51 (defconst canna-rcs-version | |
52 "$Id: canna.el,v 1.5 1997/04/10 05:55:27 steve Exp $") | |
53 | |
54 (defun canna-version () | |
55 "Display version of canna.el in mini-buffer." | |
56 (interactive) | |
57 (message (concat | |
58 (substring canna-rcs-version | |
59 5 | |
60 (if (string-match "[0-9] [a-z]" canna-rcs-version) | |
61 (1+ (match-beginning 0)) | |
62 )) | |
63 " ..."))) | |
64 | |
65 (require 'emu) | |
50 | 66 |
51 (if running-xemacs | 67 (if running-xemacs |
52 (progn | 68 (defun canna-self-insert-string (string) |
53 (defun self-insert-string (string) | 69 (let ((len (length string)) |
54 (let ((len (length string)) | 70 (i 0) |
55 (i 0) | 71 ;; $BA^F~$NESCf$G(B blink $B$,5/$-$k$H$&$C$H$*$7$$$N$G!"(B |
56 ;; $BA^F~$NESCf$G(B blink $B$,5/$-$k$H$&$C$H$*$7$$$N$G!"(B | 72 ;; $B0l;~E*$K(B blink $B$rM^;_$9$k!#(B |
57 ;; $B0l;~E*$K(B blink $B$rM^;_$9$k!#(B | 73 (blink-matching-paren nil)) |
58 (blink-matching-paren nil)) | 74 (while (< i len) |
59 (while (< i len) | 75 (self-insert-internal (aref canna-kakutei-string i)) |
60 (self-insert-internal (aref canna-kakutei-string i)) | 76 (setq i (1+ i)) |
61 (setq i (1+ i)) | 77 ))) |
62 ))) | 78 (defalias 'canna-self-insert-string 'insert) |
63 ) | |
64 (defun self-insert-string (string) | |
65 (let ((len (length string)) | |
66 (i 0) chr | |
67 ;; $BA^F~$NESCf$G(B blink $B$,5/$-$k$H$&$C$H$*$7$$$N$G!"(B | |
68 ;; $B0l;~E*$K(B blink $B$rM^;_$9$k!#(B | |
69 (blink-matching-paren nil)) | |
70 (while (< i len) | |
71 (setq chr (sref canna-kakutei-string i)) | |
72 (self-insert-internal chr) | |
73 (setq i (+ i (char-bytes chr))) | |
74 ))) | |
75 ) | 79 ) |
76 | 80 |
77 | |
78 ;; -*-mode: emacs-lisp-*- | |
79 | |
80 (defconst canna-rcs-version "Canna/mule 2.x, based on Canna 2.2/3.2. : canna.el,v x.xx 1994/11/7 00:00:00") | |
81 | |
82 (defun canna-version () | |
83 (interactive) | |
84 (message (concat (substring canna-rcs-version 0 72) " ...")) ) | |
85 | 81 |
86 ;;; $B$+$s$J$NJQ?t(B | 82 ;;; $B$+$s$J$NJQ?t(B |
87 | 83 |
88 (defvar canna-save-undo-text-predicate nil) | 84 (defvar canna-save-undo-text-predicate nil) |
89 (defvar canna-undo-hook nil) | 85 (defvar canna-undo-hook nil) |
155 (if (and display-minibuffer-mode-in-minibuffer | 151 (if (and display-minibuffer-mode-in-minibuffer |
156 (boundp 'minibuffer-preprompt)) | 152 (boundp 'minibuffer-preprompt)) |
157 (setq minibuffer-preprompt str) | 153 (setq minibuffer-preprompt str) |
158 ;else | 154 ;else |
159 (setq mode-line-canna-mode-in-minibuffer str)) | 155 (setq mode-line-canna-mode-in-minibuffer str)) |
160 (setq mode-line-canna-mode str)) | 156 (setq mode-line-canna-mode str) ) |
161 (redraw-modeline)) | 157 (set-buffer-modified-p (buffer-modified-p)) ) |
162 | 158 |
163 ;; memq $B$r6/D4$9$k$J$i!"0J2<$@$,!"(B | 159 ;; memq $B$r6/D4$9$k$J$i!"0J2<$@$,!"(B |
164 ;(defun canna:memq-recursive (a l) | 160 ;(defun canna:memq-recursive (a l) |
165 ; (or (eq a l) | 161 ; (or (eq a l) |
166 ; (and (consp l) | 162 ; (and (consp l) |
171 (if (atom l) (eq a l) | 167 (if (atom l) (eq a l) |
172 (or (canna:memq-recursive a (car l)) | 168 (or (canna:memq-recursive a (car l)) |
173 (canna:memq-recursive a (cdr l)) ))) | 169 (canna:memq-recursive a (cdr l)) ))) |
174 | 170 |
175 (defun canna:create-mode-line () | 171 (defun canna:create-mode-line () |
176 (if (not (canna:memq-recursive 'mode-line-canna-mode mode-line-format)) | 172 "Add string of Canna status into mode-line." |
177 (setq-default | 173 (cond (running-xemacs |
178 mode-line-format | 174 (or (canna:memq-recursive 'mode-line-canna-mode |
179 (append (list (list 'minibuffer-window-selected | 175 default-modeline-format) |
180 (list 'display-minibuffer-mode-in-minibuffer | 176 (setq-default default-modeline-format |
181 "-" "m") "-") | 177 (nconc '("" mode-line-canna-mode) |
182 (list 'minibuffer-window-selected | 178 default-modeline-format)) |
183 (list 'display-minibuffer-mode-in-minibuffer | 179 ) |
184 'mode-line-canna-mode | 180 (mapcar (function |
185 'mode-line-canna-mode-in-minibuffer) | 181 (lambda (buffer) |
186 'mode-line-canna-mode)) | 182 (save-excursion |
187 mode-line-format))) | 183 (set-buffer buffer) |
188 (mode-line-canna-mode-update mode-line-canna-mode) ) | 184 (or (canna:memq-recursive 'mode-line-canna-mode |
185 modeline-format) | |
186 (setq modeline-format | |
187 (nconc '("" mode-line-canna-mode) | |
188 modeline-format)) | |
189 ) | |
190 ))) | |
191 (buffer-list)) | |
192 ) | |
193 (t | |
194 (or (canna:memq-recursive 'mode-line-canna-mode mode-line-format) | |
195 (setq-default | |
196 mode-line-format | |
197 (append (list (list 'minibuffer-window-selected | |
198 (list 'display-minibuffer-mode-in-minibuffer | |
199 "-" "m") "-") | |
200 (list 'minibuffer-window-selected | |
201 (list 'display-minibuffer-mode-in-minibuffer | |
202 'mode-line-canna-mode | |
203 'mode-line-canna-mode-in-minibuffer) | |
204 'mode-line-canna-mode)) | |
205 mode-line-format)) | |
206 ))) | |
207 (mode-line-canna-mode-update mode-line-canna-mode)) | |
189 | 208 |
190 (defun canna:mode-line-display () | 209 (defun canna:mode-line-display () |
191 (mode-line-canna-mode-update mode-line-canna-mode)) | 210 (mode-line-canna-mode-update mode-line-canna-mode)) |
192 | 211 |
193 ;;; | 212 ;;; |
266 (let ((ch 0)) | 285 (let ((ch 0)) |
267 (while (<= ch 127) | 286 (while (<= ch 127) |
268 (define-key canna-mode-map (make-string 1 ch) 'canna-functional-insert-command) | 287 (define-key canna-mode-map (make-string 1 ch) 'canna-functional-insert-command) |
269 (setq ch (1+ ch)))) | 288 (setq ch (1+ ch)))) |
270 | 289 |
271 (define-key canna-mode-map [up] "\C-p") | 290 (cond (running-xemacs |
272 (define-key canna-mode-map [(shift up)] "\C-p") | 291 (define-key canna-mode-map [up] "\C-p") |
273 (define-key canna-mode-map [(control up)] "\C-p") | 292 (define-key canna-mode-map [(shift up)] "\C-p") |
274 (define-key canna-mode-map [down] "\C-n") | 293 (define-key canna-mode-map [(control up)] "\C-p") |
275 (define-key canna-mode-map [(shift down)] "\C-n") | 294 (define-key canna-mode-map [down] "\C-n") |
276 (define-key canna-mode-map [(control down)] "\C-n") | 295 (define-key canna-mode-map [(shift down)] "\C-n") |
277 (define-key canna-mode-map [right] "\C-f") | 296 (define-key canna-mode-map [(control down)] "\C-n") |
278 (define-key canna-mode-map [(shift right)] "\C-f") | 297 (define-key canna-mode-map [right] "\C-f") |
279 (define-key canna-mode-map [(control right)] "\C-f") | 298 (define-key canna-mode-map [(shift right)] "\C-f") |
280 (define-key canna-mode-map [left] "\C-b") | 299 (define-key canna-mode-map [(control right)] "\C-f") |
281 (define-key canna-mode-map [(shift left)] "\C-b") | 300 (define-key canna-mode-map [left] "\C-b") |
282 (define-key canna-mode-map [(control left)] "\C-b") | 301 (define-key canna-mode-map [(shift left)] "\C-b") |
283 (define-key canna-mode-map [kanji] " ") | 302 (define-key canna-mode-map [(control left)] "\C-b") |
284 (define-key canna-mode-map [(control space)] [(control @)]) | 303 (define-key canna-mode-map [kanji] " ") |
304 (define-key canna-mode-map [(control space)] [(control @)]) | |
305 ) | |
306 (t | |
307 (define-key canna-mode-map [up] [?\C-p]) | |
308 (define-key canna-mode-map [S-up] [?\C-p]) | |
309 (define-key canna-mode-map [C-up] [?\C-p]) | |
310 (define-key canna-mode-map [down] [?\C-n]) | |
311 (define-key canna-mode-map [S-down] [?\C-n]) | |
312 (define-key canna-mode-map [C-down] [?\C-n]) | |
313 (define-key canna-mode-map [right] [?\C-f]) | |
314 (define-key canna-mode-map [S-right] [?\C-f]) | |
315 (define-key canna-mode-map [C-right] [?\C-f]) | |
316 (define-key canna-mode-map [left] [?\C-b]) | |
317 (define-key canna-mode-map [S-left] [?\C-b]) | |
318 (define-key canna-mode-map [C-left] [?\C-b]) | |
319 (define-key canna-mode-map [kanji] [? ]) | |
320 (define-key canna-mode-map [?\C- ] [?\C-@]) | |
321 )) | |
285 | 322 |
286 ;; $B%_%K%P%C%U%!$K2?$+$rI=<($7$F$$$k;~$N%m!<%+%k%^%C%W(B | 323 ;; $B%_%K%P%C%U%!$K2?$+$rI=<($7$F$$$k;~$N%m!<%+%k%^%C%W(B |
287 (defvar canna-minibuffer-mode-map (make-sparse-keymap)) | 324 (defvar canna-minibuffer-mode-map (make-sparse-keymap)) |
288 | 325 |
289 (let ((ch 0)) | 326 (let ((ch 0)) |
290 (while (<= ch 127) | 327 (while (<= ch 127) |
291 (define-key canna-minibuffer-mode-map (make-string 1 ch) 'canna-minibuffer-insert-command) | 328 (define-key canna-minibuffer-mode-map (make-string 1 ch) 'canna-minibuffer-insert-command) |
292 (setq ch (1+ ch)))) | 329 (setq ch (1+ ch)))) |
293 | 330 |
294 (define-key canna-minibuffer-mode-map [up] "\C-p") | 331 (cond (running-xemacs |
295 (define-key canna-minibuffer-mode-map [(shift up)] "\C-p") | 332 (define-key canna-minibuffer-mode-map [up] "\C-p") |
296 (define-key canna-minibuffer-mode-map [(control up)] "\C-p") | 333 (define-key canna-minibuffer-mode-map [(shift up)] "\C-p") |
297 (define-key canna-minibuffer-mode-map [down] "\C-n") | 334 (define-key canna-minibuffer-mode-map [(control up)] "\C-p") |
298 (define-key canna-minibuffer-mode-map [(shift down)] "\C-n") | 335 (define-key canna-minibuffer-mode-map [down] "\C-n") |
299 (define-key canna-minibuffer-mode-map [(control down)] "\C-n") | 336 (define-key canna-minibuffer-mode-map [(shift down)] "\C-n") |
300 (define-key canna-minibuffer-mode-map [right] "\C-f") | 337 (define-key canna-minibuffer-mode-map [(control down)] "\C-n") |
301 (define-key canna-minibuffer-mode-map [(shift right)] "\C-f") | 338 (define-key canna-minibuffer-mode-map [right] "\C-f") |
302 (define-key canna-minibuffer-mode-map [(control right)] "\C-f") | 339 (define-key canna-minibuffer-mode-map [(shift right)] "\C-f") |
303 (define-key canna-minibuffer-mode-map [left] "\C-b") | 340 (define-key canna-minibuffer-mode-map [(control right)] "\C-f") |
304 (define-key canna-minibuffer-mode-map [(shift left)] "\C-b") | 341 (define-key canna-minibuffer-mode-map [left] "\C-b") |
305 (define-key canna-minibuffer-mode-map [(control left)] "\C-b") | 342 (define-key canna-minibuffer-mode-map [(shift left)] "\C-b") |
306 (define-key canna-minibuffer-mode-map [kanji] " ") | 343 (define-key canna-minibuffer-mode-map [(control left)] "\C-b") |
307 (define-key canna-minibuffer-mode-map [(control space)] [(control @)]) | 344 (define-key canna-minibuffer-mode-map [kanji] " ") |
345 (define-key canna-minibuffer-mode-map [(control space)] [(control @)]) | |
346 ) | |
347 (t | |
348 (define-key canna-minibuffer-mode-map [up] [?\C-p]) | |
349 (define-key canna-minibuffer-mode-map [S-up] [?\C-p]) | |
350 (define-key canna-minibuffer-mode-map [C-up] [?\C-p]) | |
351 (define-key canna-minibuffer-mode-map [down] [?\C-n]) | |
352 (define-key canna-minibuffer-mode-map [S-down] [?\C-n]) | |
353 (define-key canna-minibuffer-mode-map [C-down] [?\C-n]) | |
354 (define-key canna-minibuffer-mode-map [right] [?\C-f]) | |
355 (define-key canna-minibuffer-mode-map [S-right] [?\C-f]) | |
356 (define-key canna-minibuffer-mode-map [C-right] [?\C-f]) | |
357 (define-key canna-minibuffer-mode-map [left] [?\C-b]) | |
358 (define-key canna-minibuffer-mode-map [S-left] [?\C-b]) | |
359 (define-key canna-minibuffer-mode-map [C-left] [?\C-b]) | |
360 (define-key canna-minibuffer-mode-map [kanji] [? ]) | |
361 (define-key canna-minibuffer-mode-map [?\C- ] [?\C-@]) | |
362 )) | |
308 | 363 |
309 ;;; | 364 ;;; |
310 ;;; $B%0%m!<%P%k4X?t$N=q$-BX$((B | 365 ;;; $B%0%m!<%P%k4X?t$N=q$-BX$((B |
311 ;;; | 366 ;;; |
312 | 367 |
321 ; (interactive) | 376 ; (interactive) |
322 ; (if canna:*japanese-mode* | 377 ; (if canna:*japanese-mode* |
323 ; (progn | 378 ; (progn |
324 ;; (setq canna:*japanese-mode* nil) | 379 ;; (setq canna:*japanese-mode* nil) |
325 ; (setq canna:*fence-mode* nil) | 380 ; (setq canna:*fence-mode* nil) |
326 ; (buffer-enable-undo (current-buffer)) | 381 ; (if (boundp 'disable-undo) |
382 ; (setq disable-undo canna:*fence-mode*)) | |
327 ; (canna:mode-line-display) )) | 383 ; (canna:mode-line-display) )) |
328 ; (canna-sys:keyboard-quit) ) | 384 ; (canna-sys:keyboard-quit) ) |
329 | 385 |
330 ;; Abort recursive edit | 386 ;; Abort recursive edit |
331 | 387 |
338 ; (interactive) | 394 ; (interactive) |
339 ; (if canna:*japanese-mode* | 395 ; (if canna:*japanese-mode* |
340 ; (progn | 396 ; (progn |
341 ; (setq canna:*japanese-mode* nil) | 397 ; (setq canna:*japanese-mode* nil) |
342 ; (setq canna:*fence-mode* nil) | 398 ; (setq canna:*fence-mode* nil) |
343 ; (buffer-enable-undo (current-buffer)) | 399 ; (if (boundp 'disable-undo) |
400 ; (setq disable-undo canna:*fence-mode*)) | |
344 ; (canna:mode-line-display) )) | 401 ; (canna:mode-line-display) )) |
345 ; (canna-sys:abort-recursive-edit) ) | 402 ; (canna-sys:abort-recursive-edit) ) |
346 | 403 |
347 ;; Exit-minibuffer | 404 ;; Exit-minibuffer |
348 | 405 |
414 (setq canna:*undo-text-yomi* | 471 (setq canna:*undo-text-yomi* |
415 (cons canna-kakutei-yomi canna-kakutei-romaji)) | 472 (cons canna-kakutei-yomi canna-kakutei-romaji)) |
416 (set-marker canna:*spos-undo-text* (point)) | 473 (set-marker canna:*spos-undo-text* (point)) |
417 ;; | 474 ;; |
418 ;; update kbnes | 475 ;; update kbnes |
419 (self-insert-string canna-kakutei-string) | 476 (canna-self-insert-string canna-kakutei-string) |
420 ;; $BL$3NDj$NJ8;z$,$J$/!"3NDjJ8;zNs$N:G8e$,JD$83g8L$N(B | 477 ;; $BL$3NDj$NJ8;z$,$J$/!"3NDjJ8;zNs$N:G8e$,JD$83g8L$N(B |
421 ;; $BN`$@$C$?$H$-$O(B blink $B$5$;$k!#(B | 478 ;; $BN`$@$C$?$H$-$O(B blink $B$5$;$k!#(B |
422 (if (and canna-empty-info | 479 (if (and canna-empty-info |
423 (eq (char-syntax (char-before (point))) ?\)) ) | 480 (eq (char-syntax (char-before (point))) ?\)) ) |
424 (blink-matching-open)) | 481 (blink-matching-open)) |
442 (canna:do-auto-fill) | 499 (canna:do-auto-fill) |
443 (set-marker canna:*epos-undo-text* (point)) ) | 500 (set-marker canna:*epos-undo-text* (point)) ) |
444 (t | 501 (t |
445 ;; | 502 ;; |
446 ;; update kbnes | 503 ;; update kbnes |
447 (self-insert-string canna-kakutei-string) | 504 (canna-self-insert-string canna-kakutei-string) |
448 ;; $BL$3NDj$NJ8;z$,$J$/!"3NDjJ8;zNs$N:G8e$,JD$83g8L$N(B | 505 ;; $BL$3NDj$NJ8;z$,$J$/!"3NDjJ8;zNs$N:G8e$,JD$83g8L$N(B |
449 ;; $BN`$@$C$?$H$-$O(B blink $B$5$;$k!#(B | 506 ;; $BN`$@$C$?$H$-$O(B blink $B$5$;$k!#(B |
450 (if (and canna-empty-info | 507 (if (and canna-empty-info |
451 (eq (char-syntax (char-before (point))) ?\)) ) | 508 (eq (char-syntax (char-before (point))) ?\)) ) |
452 (blink-matching-open)) | 509 (blink-matching-open)) |
484 (set-marker canna:*region-end* (point)) ) | 541 (set-marker canna:*region-end* (point)) ) |
485 (if canna-underline | 542 (if canna-underline |
486 (canna:yomi-attr-on canna:*region-start* canna:*region-end*)) | 543 (canna:yomi-attr-on canna:*region-start* canna:*region-end*)) |
487 (setq canna:*last-kouho* canna-henkan-length) | 544 (setq canna:*last-kouho* canna-henkan-length) |
488 )) | 545 )) |
489 | 546 |
490 ;; $B8uJdNN0h$G$O6/D4$7$?$$J8;zNs$,B8:_$9$k$b$N$H9M$($i(B | 547 ;; $B8uJdNN0h$G$O6/D4$7$?$$J8;zNs$,B8:_$9$k$b$N$H9M$($i(B |
491 ;; $B$l$k!#6/D4$7$?$$J8;z$O(BEmacs$B$G$O%+!<%=%k%]%8%7%g%s$K$FI=<((B | 548 ;; $B$l$k!#6/D4$7$?$$J8;z$O(BEmacs$B$G$O%+!<%=%k%]%8%7%g%s$K$FI=<((B |
492 ;; $B$9$k$3$H$H$9$k!#6/D4$7$?$$J8;z$,$J$$$N$G$"$l$P!"%+!<%=%k(B | 549 ;; $B$9$k$3$H$H$9$k!#6/D4$7$?$$J8;z$,$J$$$N$G$"$l$P!"%+!<%=%k(B |
493 ;; $B$O0lHV8e$NItJ,(B($BF~NO$,9T$o$l$k%]%$%s%H(B)$B$KCV$$$F$*$/!#(B | 550 ;; $B$O0lHV8e$NItJ,(B($BF~NO$,9T$o$l$k%]%$%s%H(B)$B$KCV$$$F$*$/!#(B |
494 | 551 |
495 ;; $B%+!<%=%k$r0\F0$9$k!#(B | 552 ;; $B%+!<%=%k$r0\F0$9$k!#(B |
496 (if (not canna-underline) | 553 (if (not canna-underline) |
497 (backward-char | 554 (backward-char |
498 (- canna:*last-kouho* | 555 (- canna:*last-kouho* |
499 ;; $B%+!<%=%k0LCV$O!"H?E>I=<(ItJ,$,B8:_$7$J$$$N$G$"$l$P!"(B | 556 ;; $B%+!<%=%k0LCV$O!"H?E>I=<(ItJ,$,B8:_$7$J$$$N$G$"$l$P!"(B |
500 ;; $B8uJdJ8;zNs$N:G8e$NItJ,$H$7!"H?E>I=<(ItJ,$,B8:_$9$k$N(B | 557 ;; $B8uJdJ8;zNs$N:G8e$NItJ,$H$7!"H?E>I=<(ItJ,$,B8:_$9$k$N(B |
501 ;; $B$G$"$l$P!"$=$NItJ,$N;O$a$H$9$k!#(B | 558 ;; $B$G$"$l$P!"$=$NItJ,$N;O$a$H$9$k!#(B |
502 (cond ((zerop canna-henkan-revlen) | 559 (cond ((zerop canna-henkan-revlen) |
503 canna:*last-kouho*) | 560 canna:*last-kouho*) |
504 (t canna-henkan-revpos) )) ) | 561 (t canna-henkan-revpos) )) ) |
505 (if (and (> canna-henkan-revlen 0) | 562 (if (and (> canna-henkan-revlen 0) |
506 (> canna-henkan-length 0)) | 563 (> canna-henkan-length 0)) |
507 ; $B8uJd$ND9$5$,(B0$B$G$J$/!"(B | 564 ; $B8uJd$ND9$5$,(B0$B$G$J$/!"(B |
508 ; $BH?E>I=<($ND9$5$,(B0$B$G$J$1$l$P!"(B | 565 ; $BH?E>I=<($ND9$5$,(B0$B$G$J$1$l$P!"(B |
509 ; $B$=$NItJ,$rJQE>I=<($9$k!#(B | 566 ; $B$=$NItJ,$rJQE>I=<($9$k!#(B |
510 (let ((start (+ canna:*region-start* | 567 (let ((start (+ canna:*region-start* |
511 (if canna-with-fences 1 0) | 568 (if canna-with-fences 1 0) |
512 canna-henkan-revpos) )) | 569 canna-henkan-revpos) )) |
513 (if canna-underline | 570 (if canna-underline |
514 (canna:henkan-attr-on start | 571 (canna:henkan-attr-on start |
515 (+ start canna-henkan-revlen))))) | 572 (+ start canna-henkan-revlen))))) |
516 ) ) | 573 ) ) |
517 | 574 |
518 (defun canna:display-candidates (strs) | 575 (defun canna:display-candidates (strs) |
519 (cond ((stringp strs) ; $B%(%i!<$,5/$3$C$?>l9g(B | 576 (cond ((stringp strs) ; $B%(%i!<$,5/$3$C$?>l9g(B |
520 (beep) | 577 (beep) |
521 (message strs) ) | 578 (message strs) ) |
578 ;; $B%_%K%P%C%U%!%&%#%s%I%&$K8uJd0lMwMQ$N%P%C%U%!$r3d$jEv$F$k!#(B | 635 ;; $B%_%K%P%C%U%!%&%#%s%I%&$K8uJd0lMwMQ$N%P%C%U%!$r3d$jEv$F$k!#(B |
579 (setq canna:*saved-minibuffer* (window-buffer (minibuffer-window))) | 636 (setq canna:*saved-minibuffer* (window-buffer (minibuffer-window))) |
580 ; (set-window-buffer (minibuffer-window) | 637 ; (set-window-buffer (minibuffer-window) |
581 ; (get-buffer-create canna:*menu-buffer*)) | 638 ; (get-buffer-create canna:*menu-buffer*)) |
582 ;; modified by $B<i2,(B $BCNI'(B <morioka@jaist.ac.jp>, 1996/6/7 | 639 ;; modified by $B<i2,(B $BCNI'(B <morioka@jaist.ac.jp>, 1996/6/7 |
583 ;; $B$H$j$"$($:(B comment out $B$7$F$*$3$&(B (^_^; | 640 (unless running-xemacs |
584 ;; (setq canna:*saved-redirection* (frame-focus (selected-frame))) | 641 ;; $B$H$j$"$($:(B XEmacs $B$G$OF0$+$5$J$$$3$H$K$7$F$*$3$&(B (^_^; |
585 ;; (redirect-frame-focus (selected-frame) | 642 (setq canna:*saved-redirection* (frame-focus (selected-frame))) |
586 ;; (window-frame (minibuffer-window))) | 643 (redirect-frame-focus (selected-frame) |
587 ;; end of modification | 644 (window-frame (minibuffer-window))) |
588 | 645 ) |
589 ;; $B%_%K%P%C%U%!$N%-!<%^%C%W$rJ]B8$7$F$*$/!#(B | 646 ;; $B%_%K%P%C%U%!$N%-!<%^%C%W$rJ]B8$7$F$*$/!#(B |
590 (setq canna:*minibuffer-local-map-backup* (current-local-map)) | 647 (setq canna:*minibuffer-local-map-backup* (current-local-map)) |
591 )) | 648 )) |
592 (select-window (minibuffer-window)) | 649 (select-window (minibuffer-window)) |
593 (set-window-buffer (minibuffer-window) | 650 (set-window-buffer (minibuffer-window) |
624 | 681 |
625 ;; $B%_%K%P%C%U%!%&%#%s%I%&$N%P%C%U%!$r85$KLa$9!#(B | 682 ;; $B%_%K%P%C%U%!%&%#%s%I%&$N%P%C%U%!$r85$KLa$9!#(B |
626 (set-window-buffer (minibuffer-window) canna:*saved-minibuffer*) | 683 (set-window-buffer (minibuffer-window) canna:*saved-minibuffer*) |
627 ; (setq canna:*saved-minibuffer* nil) | 684 ; (setq canna:*saved-minibuffer* nil) |
628 ;; modified by $B<i2,(B $BCNI'(B <morioka@jaist.ac.jp>, 1996/6/7 | 685 ;; modified by $B<i2,(B $BCNI'(B <morioka@jaist.ac.jp>, 1996/6/7 |
629 ;; $B$H$j$"$($:(B comment out $B$7$F$*$3$&(B (^_^; | 686 (unless running-xemacs |
630 ;; (redirect-frame-focus (window-frame canna:*previous-window*) | 687 ;; $B$H$j$"$($:(B XEmacs $B$G$OF0$+$5$J$$$h$&$K$7$F$*$3$&(B (^_^; |
631 ;; canna:*saved-redirection*) | 688 (redirect-frame-focus (window-frame canna:*previous-window*) |
632 ;; end of modification | 689 canna:*saved-redirection*) |
633 ;; $B%_%K%P%C%U%!$GF~NO$7$F$$$?$N$J$i0J2<$b$9$k!#(B | 690 ) |
691 ; $B%_%K%P%C%U%!$GF~NO$7$F$$$?$N$J$i0J2<$b$9$k!#(B | |
634 ; (if (eq canna:*previous-window* (selected-window)) | 692 ; (if (eq canna:*previous-window* (selected-window)) |
635 ; (progn | 693 ; (progn |
636 ; (canna:insert-fixed nfixed) | 694 ; (canna:insert-fixed nfixed) |
637 ; (canna:insert-preedit) )) | 695 ; (canna:insert-preedit) )) |
638 | 696 |
782 0))) | 840 0))) |
783 (setq canna:*local-map-backup* (current-local-map)) | 841 (setq canna:*local-map-backup* (current-local-map)) |
784 (setq canna:*fence-mode* t) | 842 (setq canna:*fence-mode* t) |
785 ;; XEmacs change: | 843 ;; XEmacs change: |
786 (buffer-disable-undo (current-buffer)) | 844 (buffer-disable-undo (current-buffer)) |
845 ;; (if (boundp 'disable-undo) | |
846 ;; (setq disable-undo canna:*fence-mode*)) | |
787 (use-local-map canna-mode-map)) | 847 (use-local-map canna-mode-map)) |
788 | 848 |
789 (defun canna:enter-canna-mode-and-functional-insert () | 849 (defun canna:enter-canna-mode-and-functional-insert () |
790 (canna:enter-canna-mode) | 850 (canna:enter-canna-mode) |
791 (setq canna:*use-region-as-henkan-region* nil) | 851 (setq canna:*use-region-as-henkan-region* nil) |
802 (if canna:*japanese-mode* | 862 (if canna:*japanese-mode* |
803 (canna-toggle-japanese-mode) | 863 (canna-toggle-japanese-mode) |
804 (mode-line-canna-mode-update canna:*alpha-mode-string*) ))) | 864 (mode-line-canna-mode-update canna:*alpha-mode-string*) ))) |
805 ;; XEmacs change: | 865 ;; XEmacs change: |
806 (buffer-enable-undo (current-buffer)) | 866 (buffer-enable-undo (current-buffer)) |
867 ;; (if (boundp 'disable-undo) | |
868 ;; (setq disable-undo canna:*fence-mode*)) | |
807 )) | 869 )) |
808 (set-marker canna:*region-start* nil) | 870 (set-marker canna:*region-start* nil) |
809 (set-marker canna:*region-end* nil) | 871 (set-marker canna:*region-end* nil) |
810 ) | 872 ) |
811 | 873 |
933 ((or (and (boundp 'hilit-background-mode) | 995 ((or (and (boundp 'hilit-background-mode) |
934 (eq hilit-background-mode 'dark)) | 996 (eq hilit-background-mode 'dark)) |
935 (string-match | 997 (string-match |
936 "on\\|t" | 998 "on\\|t" |
937 (or (if running-xemacs | 999 (or (if running-xemacs |
938 (x-get-resource "ReverseVideo" "reverseVideo" 'string) | 1000 (x-get-resource "ReverseVideo" |
1001 "reverseVideo" 'string) | |
939 (x-get-resource "ReverseVideo" "reverseVideo")) | 1002 (x-get-resource "ReverseVideo" "reverseVideo")) |
940 ""))) | 1003 ""))) |
941 'reverse) ;$BH?E>$7$F$$$k$J$i(B 'reverse | 1004 'reverse) ;$BH?E>$7$F$$$k$J$i(B 'reverse |
942 (t 'normal))) | 1005 (t 'normal))) |
943 (setq canna:attr-yomi | 1006 (setq canna:attr-yomi |
1285 ;; $B?'$E$1$N$?$a$N4X?t(B | 1348 ;; $B?'$E$1$N$?$a$N4X?t(B |
1286 ;; | 1349 ;; |
1287 (defun canna:yomi-attr-on (start end) | 1350 (defun canna:yomi-attr-on (start end) |
1288 (if (overlayp canna:*yomi-overlay*) | 1351 (if (overlayp canna:*yomi-overlay*) |
1289 (move-overlay canna:*yomi-overlay* start end) | 1352 (move-overlay canna:*yomi-overlay* start end) |
1290 (overlay-put (setq canna:*yomi-overlay* (make-overlay start end nil t)) | 1353 (overlay-put (setq canna:*yomi-overlay* (make-overlay start end nil nil t)) |
1291 'face | 1354 'face |
1292 (if canna:color-p 'attr-yomi 'underline)) | 1355 (if canna:color-p 'attr-yomi 'underline)) |
1293 ) | 1356 ) |
1294 ) | 1357 ) |
1295 | 1358 |
1300 ) | 1363 ) |
1301 | 1364 |
1302 (defun canna:henkan-attr-on (start end) | 1365 (defun canna:henkan-attr-on (start end) |
1303 (if (overlayp canna:*henkan-overlay*) | 1366 (if (overlayp canna:*henkan-overlay*) |
1304 (move-overlay canna:*henkan-overlay* start end) | 1367 (move-overlay canna:*henkan-overlay* start end) |
1305 (overlay-put (setq canna:*henkan-overlay* (make-overlay start end nil t)) | 1368 (overlay-put (setq canna:*henkan-overlay* |
1369 (make-overlay start end nil nil t)) | |
1306 'face | 1370 'face |
1307 (if canna:color-p 'attr-taishou 'region)) | 1371 (if canna:color-p 'attr-taishou 'region)) |
1308 ) | 1372 ) |
1309 ) | 1373 ) |
1310 | 1374 |
1315 ) | 1379 ) |
1316 | 1380 |
1317 (defun canna:select-attr-on (start end) | 1381 (defun canna:select-attr-on (start end) |
1318 (if (overlayp canna:*select-overlay*) | 1382 (if (overlayp canna:*select-overlay*) |
1319 (move-overlay canna:*select-overlay* start end) | 1383 (move-overlay canna:*select-overlay* start end) |
1320 (overlay-put (setq canna:*select-overlay* (make-overlay start end nil t)) | 1384 (overlay-put (setq canna:*select-overlay* |
1385 (make-overlay start end nil nil t)) | |
1321 'face | 1386 'face |
1322 'attr-select)) | 1387 'attr-select)) |
1323 ) | 1388 ) |
1324 | 1389 |
1325 (defun canna:select-attr-off (start end) | 1390 (defun canna:select-attr-off (start end) |
1326 (and (overlayp canna:*select-overlay*) | 1391 (and (overlayp canna:*select-overlay*) |
1327 (delete-overlay canna:*select-overlay*) | 1392 (delete-overlay canna:*select-overlay*) |
1328 ) | 1393 ) |
1329 ) | 1394 ) |
1330 | 1395 |
1396 | |
1331 (provide 'canna) | 1397 (provide 'canna) |
1398 | |
1399 ;;; canna.el ends here |