;; Copyright 1992 NEC Corporation, Tokyo, Japan.
;;
;; Permission to use, copy, modify, distribute and sell this software
;; and its documentation for any purpose is hereby granted without
;; fee, provided that the above copyright notice appear in all copies
;; and that both that copyright notice and this permission notice
;; appear in supporting documentation, and that the name of NEC
;; Corporation not be used in advertising or publicity pertaining to
;; distribution of the software without specific, written prior
;; permission.  NEC Corporation makes no representations about the
;; suitability of this software for any purpose.  It is provided "as
;; is" without express or implied warranty.
;;
;; NEC CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
;; INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN 
;; NO EVENT SHALL NEC CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
;; CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF 
;; USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 
;; OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 
;; PERFORMANCE OF THIS SOFTWARE. 

;; Using this customize file gives you a Japanese Input Interface
;; like EWS-UX/v R6.1 does.

;;  @(#) 102.1 $Id: lan5.canna,v 1.7 1996/10/25 05:22:56 kon Exp $

; definition of modes peculier to jdaemon.

(initialize-function '(japanese-mode))

(setq romkana-table "lan5.cbp")

(use-dictionary
 "iroha"
 "fuzokugo"
 "hojomwd"
 "hojoswd"
 :bushu "bushu"
 :user  "user"
 )

(setq cursor-wrap          t)	; default t
(setq select-direct        t)	; default t
(setq numerical-key-select t)	; default t
(setq character-based-move t)	; default t
(setq reverse-widely       t)	; default nil
(setq break-into-roman     nil)	; default nil
(setq quit-if-end-of-ichiran t)	; default nil
(setq kakutei-if-end-of-bunsetsu t)	; default nil
(setq stay-after-validate  nil)	; default t
(setq abandon-illegal-phonogram t)	; default nil

;;  setting for mode string

(set-mode-display 'alpha-mode             " 半【英数】")
(set-mode-display 'empty-mode             "   【かな】")
(set-mode-display 'hex-mode               "   【16進】")
(set-mode-display 'bushu-mode             "   【部首】")
(set-mode-display 'henkan-nyuuryoku-mode  "   【かな】")

(set-mode-display 'zen-hira-henkan-mode   "   【かな】")
(set-mode-display 'han-hira-henkan-mode   " 半【かな】")
(set-mode-display 'zen-kata-henkan-mode   "   【カナ】")
(set-mode-display 'han-kata-henkan-mode   " 半【カナ】")
(set-mode-display 'zen-alpha-henkan-mode  "   【英数】")
(set-mode-display 'han-alpha-henkan-mode  " 半【英数】")

(set-mode-display 'zen-hira-kakutei-mode  "   【かな】")
(set-mode-display 'han-hira-kakutei-mode  " 半【かな】")
(set-mode-display 'zen-kata-kakutei-mode  "   【カナ】")
(set-mode-display 'han-kata-kakutei-mode  " 半【カナ】")
(set-mode-display 'zen-alpha-kakutei-mode "   【英数】")
(set-mode-display 'han-alpha-kakutei-mode " 半【英数】")

(set-mode-display 'kigou-mode             " 半【記号】")
(set-mode-display 'mojishu-mode           nil)
(set-mode-display 'tankouho-mode         nil)
(set-mode-display 'ichiran-mode           nil)
(set-mode-display 'yes-no-mode            nil)
(set-mode-display 'extend-mode            nil)
(set-mode-display 'russian-mode           "   【 ロ 】")
(set-mode-display 'greek-mode             "   【 ギ 】")
(set-mode-display 'line-mode              "   【罫線】")
(set-mode-display 'changing-server-mode   nil)
(set-mode-display 'henkan-method-mode     nil)
(set-mode-display 'delete-dic-mode        nil)
(set-mode-display 'touroku-mode           "   【登録】")
(set-mode-display 'touroku-hinshi-mode    "   【品詞】")
(set-mode-display 'touroku-dic-mode       "   【辞書】")
(set-mode-display 'quoted-insert-mode     "   【 ｑ 】")
(set-mode-display 'bubun-muhenkan-mode    "   【編集】")
(set-mode-display 'mount-dic-mode         nil)

;;  setting for keymapping

(global-unbind-key-function 'quoted-insert)
(global-unbind-key-function 'extend)
(global-unbind-key-function 'shrink)
(global-unbind-key-function 'alpha-mode)
(global-unbind-key-function 'quoted-insert)
(global-unbind-key-function 'forward)
(global-unbind-key-function 'backward)
(global-unbind-key-function 'previous)
(global-unbind-key-function 'next)
(global-unbind-key-function 'beginning-of-line)
(global-unbind-key-function 'end-of-line)
(global-unbind-key-function 'delete-next)
(global-unbind-key-function 'kill-to-end-of-line)
(global-unbind-key-function 'henkan)
(global-unbind-key-function 'quit)
(global-unbind-key-function 'japanese-mode)

(global-set-key " "         'henkan)
(global-set-key "\Xfer"     'henkan)

(global-set-key "\Backspace" 'backward)
(global-set-key "\Delete"   'delete-next)

(global-set-key "\Nfer"     'kakutei)
(global-set-key "\Return"   'kakutei)

(global-set-key "\Left"     'backward)
(global-set-key "\Right"    'forward)

(global-set-key "\Pf1"      'base-eisu)
(global-set-key "\Pf2"      'base-katakana)
(global-set-key "\Pf3"      'base-hiragana)
(global-set-key "\Pf4"      'base-zenkaku-hankaku-toggle)

(set-key 'empty-mode " " '(self-insert kakutei))

(set-key 'tankouho-mode "\Backspace" 'quit)

; 次の項目について、認識して利用している場合にはコメントをはずす。
;(set-key 'empty-mode "\Backspace" 'base-kakutei)

(set-key 'ichiran-mode  "\Left"   'quit)

(set-key 'tankouho-mode "\Nfer"   'forward)
(set-key 'tankouho-mode "\C-Nfer" 'backward)

(set-key 'tankouho-mode "\Left"   '(shinshuku-mode shrink))
(set-key 'tankouho-mode "\Right"  '(shinshuku-mode extend))

(set-key 'empty-mode    "\Nfer"   'base-henkan)
