(Download): Renamed from "Anonymous FTP"; modify for
[elisp/apel.git] / emu-mule.el
1 ;;; emu-mule.el --- emu module for Mule 1.* and Mule 2.*
2
3 ;; Copyright (C) 1995,1996,1997,1998 MORIOKA Tomohiko
4
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;;         Katsumi Yamaoka <yamaoka@jpl.org>
7 ;; Keywords: emulation, compatibility, Mule
8
9 ;; This file is part of emu.
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., 51 Franklin Street, Fifth Floor,
24 ;; Boston, MA 02110-1301, USA.
25
26 ;;; Code:
27
28 (require 'poem)
29
30
31 ;;; @ regulation
32 ;;;
33
34 (defun regulate-latin-char (chr)
35   (cond ((and (<= ?\e$B#A\e(B chr)(<= chr ?\e$B#Z\e(B))
36          (+ (- chr ?\e$B#A\e(B) ?A))
37         ((and (<= ?\e$B#a\e(B chr)(<= chr ?\e$B#z\e(B))
38          (+ (- chr ?\e$B#a\e(B) ?a))
39         ((eq chr ?\e$B!%\e(B) ?.)
40         ((eq chr ?\e$B!$\e(B) ?,)
41         (t chr)))
42
43 (defun regulate-latin-string (str)
44   (let ((len (length str))
45         (i 0)
46         chr (dest ""))
47     (while (< i len)
48       (setq chr (sref str i))
49       (setq dest (concat dest
50                          (char-to-string (regulate-latin-char chr))))
51       (setq i (+ i (char-bytes chr))))
52     dest))
53
54
55 ;;; @ end
56 ;;;
57
58 (require 'product)
59 (product-provide (provide 'emu-mule) (require 'apel-ver))
60
61 ;;; emu-mule.el ends here