update.
[elisp/nabe.git] / yude-egg.el
1 ;;; yude-egg.el --- Boiled-Egg like roman to kanaji converter
2
3 ;; Copyright (C) 1996 MORIOKA Tomohiko
4
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Version: $Id: yude-egg.el,v 0.5 1996/11/12 09:04:30 morioka Exp $
7 ;; Keywords: input, Japanese, mule
8
9 ;; This file is not part of GNU Emacs.
10
11 ;; This program is free software; you can redistribute it and/or
12 ;; modify it under the terms of the GNU General Public License as
13 ;; published by the Free Software Foundation; either version 2, or (at
14 ;; your option) any later version.
15
16 ;; This program is distributed in the hope that it will be useful, but
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 ;; General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
25
26 ;;; Code:
27
28 (require 'nabe)
29 (require 'egg)
30
31 (defun yude-egg-its-region (start end)
32   (interactive "r")
33   (let ((string (buffer-substring start end))
34         egg-mode)
35     (delete-region start end)
36     (egg-mode)
37     (unless (string= string "")
38       (let ((last-command-char (aref string 0)))
39         (egg-self-insert-char)
40         )
41       (let ((i 1)
42             (len (length string))
43             )
44         (while (< i len)
45           (let ((last-command-char (aref string i)))
46             (its-self-insert-char)
47             )
48           (setq i (1+ i))
49           )))
50     (its-exit-mode)
51     ))
52
53 (defun yude-egg-translate-region (start end)
54   (interactive "r")
55   (save-restriction
56     (narrow-to-region start end)
57     (yude-egg-its-region start end)
58     (egg-convert-region (point-min)(point-max))
59     ))
60
61 (setq nabe-roman-to-kanji-function 'yude-egg-translate-region)
62 (setq nabe-roman-to-kana-function 'yude-egg-its-region)
63
64
65 ;;; @ end
66 ;;;
67
68 (provide 'yude-egg)
69
70 ;;; yude-egg.el ends here