~ubuntu-branches/ubuntu/utopic/wnn7egg/utopic

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
;;; wnn7egg-leim.el --- Egg/Wnn-related code for LEIM
;; Copyright (C) 2001 OMRON SOFTWARE Co., Ltd. <wnn-info@omronsoft.co.jp>

;; Shamelessly ripped off from
;;
;; egg-leim.el --- Egg-related code for LEIM
;; Copyright (C) 1997 Stephen Turnbull <turnbull@sk.tsukuba.ac.jp>
;; Copyright (C) 1997 Free Software Foundation, Inc.
;;
;; Shamelessly ripped off from
;;
;; skk-leim.el --- SKK related code for LEIM
;; Copyright (C) 1997
;; Murata Shuuichirou <mrt@mickey.ai.kyutech.ac.jp>
;;
;; Author: OMRON SOFTWARE Co., Ltd. <wnn-info@omronsoft.co.jp>
;; Keywords: japanese, input method, LEIM, Wnn7
;; Last Modified: 2001/5/30 00:00:00

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either versions 2, or (at your option)
;; any later version.

;; This program is distributed in the hope that it will be useful
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with XEmacs, see the file COPYING.  If not, write to the Free
;; Software Foundation Inc., 59 Temple Place - Suite 330, Boston,
;; MA 02111-1307, USA.

;;; TODO
;;
;;  Add pointers to Egg documentation in LEIM format

(defvar wnn7-activate nil "T if wnn7egg is activeate.")
(make-variable-buffer-local 'wnn7-activate)
(set-default 'wnn7-activate nil)

(if (featurep 'xemacs)
    (if (fboundp 'set-input-method)
	(defun select-input-method (lang)
	  (set-input-method lang))))

(defun wnn7egg-activate (&optional name)
  (require 'wnn7egg)
  (require 'wnn7egg-cnv)
  (setq inactivate-current-input-method-function 'wnn7egg-inactivate)
  (setq wnn7egg-default-startup-file "eggrc-wnn7")
  (wnn7-egg-mode)
  (setq wnn7-activate t);;;;
  (toggle-egg-mode))

(defun wnn7egg-inactivate ()
  (setq wnn7-activate nil);;;;
  (cond (egg:*mode-on* (toggle-egg-mode))))

(defun wnn7-p ()
  (or (and current-input-method
	   (string-match "japanese-egg-wnn7" current-input-method))
      wnn7-activate))

(register-input-method
 'japanese-egg-wnn7 "Japanese"
 'wnn7egg-activate nil
 "Wnn7EGG - an interface to the Wnn7 kana to kanji conversion program")

(provide 'wnn7egg-leim)

;;; wnn7egg-leim.el ends here