;;; yude-canna.el --- Boiled-Egg like roman to kanaji converter ;; Copyright (C) 1996 MORIOKA Tomohiko ;; Author: MORIOKA Tomohiko ;; Version: $Id: yude-canna.el,v 0.2 1996/11/12 09:18:37 morioka Exp $ ;; Keywords: input, Japanese, mule ;; This file is not part of GNU Emacs. ;; 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 version 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 GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Code: (require 'nabe) (require 'canna) ;;; @ initialize ;;; (canna) ;;; @ functions ;;; (defun canna-rk-no-trans-region (start end) "Insert alpha-numeric string as it is sent from keyboard." (interactive "r") (let ((res)) (setq res (canna-rk-region start end)) (delete-region start end) (if (null canna:*japanese-mode*) (progn (setq canna:*exit-japanese-mode* t) )) (canna:enter-canna-mode) (canna:display-candidates res) (canna-kakutei-to-basic-stat) )) (setq nabe-roman-to-kanji-function 'canna-rk-trans-region) (setq nabe-roman-to-kana-function 'canna-rk-no-trans-region) ;;; @ redefine ;;; (or (fboundp 'canna:original-quit-canna-mode) (fset 'canna:original-quit-canna-mode (symbol-function 'canna:quit-canna-mode)) ) (defun canna:quit-canna-mode () (canna:original-quit-canna-mode) (if (string= (canna-query-mode) "[半英]") (progn (canna-do-function canna-func-base-zenkaku) (canna-do-function canna-func-base-kana) (canna-toggle-japanese-mode) ))) (defun canna-kakutei-to-basic-stat () (let ((res 0) (kakutei (mapconcat (function (lambda (chr) (if (eq chr ?\ ) "" (char-to-string chr) ) )) canna-henkan-string "")) ) (while (not canna-empty-info) (setq res (canna-do-function canna-func-kakutei)) ) (setq canna-kakutei-string kakutei) (canna:display-candidates (length canna-kakutei-string)) (if (not canna:*japanese-mode*) (mode-line-canna-mode-update canna:*alpha-mode-string*)) )) ;;; @ end ;;; (provide 'yude-canna) ;;; yude-canna.el ends here