Remove non-free old and crusty clearcase pkg
[packages] / mule-packages / egg-its / egg-cwnn-leim.el
1 ;;; egg-cwnn-leim.el --- Egg/CWnn-related code for LEIM
2
3 ;; Copyright (C) 1997 Stephen Turnbull <turnbull@sk.tsukuba.ac.jp>
4 ;; Copyright (C) 1997 Free Software Foundation, Inc.
5 ;;
6 ;; Shamelessly ripped off from
7 ;;
8 ;; skk-leim.el --- SKK related code for LEIM
9 ;; Copyright (C) 1997
10 ;; Murata Shuuichirou <mrt@mickey.ai.kyutech.ac.jp>
11 ;;
12 ;; Author: Stephen Turnbull <turnbull@sk.tsukuba.ac.jp>
13 ;; Version: egg-leim.el,v 1.1 1997/10/27 09:59:23 steve Exp steve
14 ;; Keywords: japanese, input method, LEIM
15 ;; Last Modified: 1997/10/27 09:59:23
16
17 ;; This program is free software; you can redistribute it and/or modify
18 ;; it under the terms of the GNU General Public License as published by
19 ;; the Free Software Foundation; either versions 2, or (at your option)
20 ;; any later version.
21
22 ;; This program is distributed in the hope that it will be useful
23 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25 ;; GNU General Public License for more details.
26
27 ;; You should have received a copy of the GNU General Public License
28 ;; along with XEmacs, see the file COPYING.  If not, write to the Free
29 ;; Software Foundation Inc., 59 Temple Place - Suite 330, Boston,
30 ;; MA 02111-1307, USA.
31
32 ;;; TODO
33 ;;
34 ;;  Add pointers to Egg documentation in LEIM format
35
36 ;; EGG specific setup
37 (define-egg-environment 'chinese-pinyin
38   "Chinese pinyin settings for egg."
39   (lambda ()
40     (when (not (featurep 'egg-cnpinyin))
41       (load "its-pinyin")
42       (setq its:*standard-modes*
43             (append
44              (list (its:get-mode-map "PinYin"))
45              its:*standard-modes*))
46       (provide 'egg-cnpinyin))
47     (setq wnn-server-type 'cserver)
48     (setq-default its:*current-map* (its:get-mode-map "PinYin"))))
49
50 (define-egg-environment 'chinese-zhuyin
51   "Chinese zhuyin settings for egg."
52   (lambda ()
53     (when (not (featurep 'egg-cnzhuyin))
54       (load "its-zhuyin")
55       (setq its:*standard-modes*
56             (append
57              (list (its:get-mode-map "zhuyin"))
58              its:*standard-modes*))
59       (provide 'egg-cnzhuyin))
60     (setq wnn-server-type 'cserver)
61     (setq-default its:*current-map* (its:get-mode-map "zhuyin"))))
62
63
64 ;;;###autoload
65 (defun egg-pinyin-activate (&optional name)
66   (if (featurep 'wnn)
67       (require 'egg)
68     (error "Wnn is not built into this XEmacs"))
69   (setq inactivate-current-input-method-function 'egg-pinyin-inactivate)
70   (setq egg-default-startup-file "eggrc-wnn")
71   (require 'egg-wnn)
72   (let ((func (get 'chinese-pinyin 'set-egg-environ)))
73     (when func
74       (funcall func)))
75   (egg-mode)
76   (toggle-egg-mode))
77
78 ;;;###autoload
79 (defun egg-pinyin-inactivate ()
80   (cond (egg:*mode-on* (toggle-egg-mode))))
81
82 ;;;###autoload
83 (defun egg-zhuyin-activate (&optional name)
84   (if (featurep 'wnn)
85       (require 'egg)
86     (error "Wnn is not built into this XEmacs"))
87   (setq inactivate-current-input-method-function 'egg-zhuyin-inactivate)
88   (setq egg-default-startup-file "eggrc-wnn")
89   (require 'egg-wnn)
90   (let ((func (get 'chinese-zhuyin 'set-egg-environ)))
91     (when func
92       (funcall func)))
93   (egg-mode)
94   (toggle-egg-mode))
95
96 ;;;###autoload
97 (defun egg-zhuyin-inactivate ()
98   (cond (egg:*mode-on* (toggle-egg-mode))))
99
100 ;;;###autoload
101 (when (and (featurep 'mule) (featurep 'wnn))
102   (register-input-method
103    'chinese-egg-pinyin "Chinese"
104    'egg-pinyin-activate nil
105    "EGG - an interface to the CWnn Chinese conversion program" ))
106
107 ;;;###autoload
108 (when (and (featurep 'mule) (featurep 'wnn))
109   (register-input-method
110    'chinese-egg-zhuyin "Chinese"
111    'egg-zhuyin-activate nil
112    "EGG - an interface to the CWnn Chinese conversion program" ))
113
114 (provide 'egg-cwnn-leim)
115
116 ;;; egg-cwnn-leim.el ends here