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