annotate lisp/mule/mule-cne.el @ 208:f427b8ec4379

Added tag r20-4b2 for changeset e45d5e7c476e
author cvs
date Mon, 13 Aug 2007 10:03:54 +0200
parents 131b0175ea99
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1 ;;; mule-cne.el --- interface between input methods Canna and EGG.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
3 ;; This file is part of XEmacs.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
4
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
5 ;; XEmacs is free software; you can redistribute it and/or modify it
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
6 ;; under the terms of the GNU General Public License as published by
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
7 ;; the Free Software Foundation; either version 2, or (at your option)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
8 ;; any later version.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
9
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
10 ;; XEmacs is distributed in the hope that it will be useful, but
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
11 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
12 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
13 ;; General Public License for more details.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
14
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
15 ;; You should have received a copy of the GNU General Public License
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
16 ;; along with XEmacs; see the file COPYING. If not, write to the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
17 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
18 ;; Boston, MA 02111-1307, USA.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
19 ;; Canna and Egg on Nemacs/Mule is distributed in the forms of
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
20 ;; patches to Nemacs under the terms of the GNU EMACS GENERAL
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
21 ;; PUBLIC LICENSE which is distributed along with GNU Emacs by
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
22 ;; the Free Software Foundation.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
23
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
24 ;; Written by Akira Kon, NEC Corporation.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
25 ;; E-Mail: kon@d1.bs2.mt.nec.co.jp.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
26
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
27 ;; -*-mode: emacs-lisp-*-
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
28
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
29 ;; !Id: can-n-egg.el,v 1.7 1994/03/16 07:24:15 kon Exp !
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
30
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
31 ;; $B$3$N5!G=$r;H$&$K$O!"(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
32 ;; M-x load $B$3$N%U%!%$%k(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
33 ;; M-x can-n-egg
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
34 ;; $B$r<B9T$7$^$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 (require 'canna)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
37
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
38 (if (featurep 'mule)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
39 (require 'egg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
40 (require 'wnn-egg))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
41
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
42 (provide 'can-n-egg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
43
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
44 ;;; $B$3$N4X?t$G$O!"8=:_$N%b!<%I$,!X$+$s$J!Y$NF|K\8lF~NO%b!<%I$+(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
45 ;;; $B$I$&$+$r%A%'%C%/$7$F!"!X$+$s$J!Y$NF|K\8lF~NO%b!<%I$G$J$$$N(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
46 ;;; $B$G$"$l$P!"!X$?$^$4!Y$N(B egg-self-insert-command $B$r8F$V!#!X$+(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
47 ;;; $B$s$J!Y$NF|K\8lF~NO%b!<%I$G$"$l$P!"!X$+$s$J!Y$N(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
48 ;;; canna-self-insert-command $B$r8F$V!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
49
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
50 (defvar canna-exec-hook nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
51 (defvar canna-toggle-key nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
52 (defvar egg-toggle-key nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
53
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
54 (defun can-n-egg-self-insert-command (arg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
55 "Self insert pressed key and use it to assemble Romaji character."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
56 (interactive "p")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
57 (if canna:*japanese-mode*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
58 (canna-self-insert-command arg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
59 (egg-self-insert-command arg)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
60
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
61 ;; $B$+$s$J$@$C$?$i:FJQ49!"$?$^$4$@$C$?$iIaDL$N%-!<F~NO!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
62 ;; by rtakigaw@jp.oracle.com, 1994.3.16
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
63 (defun can-n-egg-henkan-region-or-self-insert (arg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
64 "Do Canna Kana-to-Kanji re-conversion in region or Egg self insert."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
65 (interactive "p")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
66 (if canna:*japanese-mode*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
67 (canna-henkan-region-or-self-insert arg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
68 (egg-self-insert-command arg)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
69
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
70 (defun can-n-egg ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
71 "Start to use both Canna and Egg."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
72 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
73 (if canna-exec-hook
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
74 (run-hooks canna-exec-hook)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
75 (canna))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
76 (let ((ch 32))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
77 (while (< ch 127)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
78 (define-key global-map (make-string 1 ch) 'can-n-egg-self-insert-command)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
79 (setq ch (1+ ch)) ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
80 (if canna-use-space-key-as-henkan-region
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
81 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
82 (global-set-key "\C-@" 'canna-set-mark-command)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
83 (global-set-key " " 'can-n-egg-henkan-region-or-self-insert)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
84 (global-set-key
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
85 (if canna-toggle-key canna-toggle-key "\C-o") 'canna-toggle-japanese-mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
86 (global-set-key
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
87 (if egg-toggle-key egg-toggle-key "\C-\\") 'toggle-egg-mode) )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
88