tm 7.57.
[elisp/apel.git] / emu-e19.el
1 ;;;
2 ;;; emu-e19.el --- Mule 2 emulation module for Emacs 19 and XEmacs 19
3 ;;;
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1994 .. 1996 MORIOKA Tomohiko
6 ;;;
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;;; Version:
9 ;;;     $Id: emu-e19.el,v 7.10 1996/04/27 13:48:55 morioka Exp $
10 ;;; Keywords: emulation, compatibility, Mule
11 ;;;
12 ;;; This file is part of tl (Tiny Library).
13 ;;;
14 ;;; This program is free software; you can redistribute it and/or
15 ;;; modify it under the terms of the GNU General Public License as
16 ;;; published by the Free Software Foundation; either version 2, or
17 ;;; (at your option) any later version.
18 ;;;
19 ;;; This program is distributed in the hope that it will be useful,
20 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22 ;;; General Public License for more details.
23 ;;;
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with This program.  If not, write to the Free Software
26 ;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
27 ;;;
28 ;;; Code:
29
30 ;;; @ character set
31 ;;;
32
33 (defconst lc-ascii 0)
34 (defconst lc-ltn1 129)
35
36 (defun char-charset (chr)
37   "Return the character set of char CHR.
38 \[emu-e19.el; XEmacs 20 emulating function]"
39   (if (< chr 128)
40       lc-ascii
41     lc-ltn1))
42
43 (defalias 'char-leading-char 'char-charset)
44
45 (defun find-charset-string (str)
46   "Return a list of leading-chars in the string.
47 \[emu-e19.el; Mule emulating function]"
48   (if (string-match "[\200-\377]" str)
49       (list lc-ltn1)
50     ))
51
52 (defun find-charset-region (start end)
53   "Return a list of leading-chars in the region between START and END.
54 \[emu-e19.el; Mule emulating function]"
55   (if (save-excursion
56         (save-restriction
57           (narrow-to-region start end)
58           (goto-char start)
59           (re-search-forward "[\200-\377]" nil t)
60           ))
61       (list lc-ltn1)
62     ))
63
64
65 ;;; @ coding-system
66 ;;;
67
68 (defconst *internal* nil)
69 (defconst *ctext* nil)
70 (defconst *noconv* nil)
71
72 (defun code-convert-string (str ic oc)
73   "Convert code in STRING from SOURCE code to TARGET code,
74 On successful converion, returns the result string,
75 else returns nil. [emu-e19.el; Mule emulating function]"
76   str)
77
78 (defun decode-coding-string (str coding-system)
79   "Decode the string STR which is encoded in CODING-SYSTEM.
80 \[emu-mule.el; XEmacs 20 emulating function]"
81   str)
82
83 (defun encode-coding-string (str coding-system)
84   "Encode the string STR which is encoded in CODING-SYSTEM.
85 \[emu-mule.el; XEmacs 20 emulating function]"
86   str)
87
88 (defun code-convert-region (beg end ic oc)
89   "Convert code of the text between BEGIN and END from SOURCE
90 to TARGET. On successful conversion returns t,
91 else returns nil. [emu-e19.el; Mule emulating function]"
92   t)
93
94 (defun decode-coding-region (start end coding-system &optional buffer)
95   "Decode the text between START and END which is encoded in CODING-SYSTEM.
96 \[emu-mule.el; XEmacs 20 emulating function]"
97   t)
98
99 (defun encode-coding-region (start end coding-system &optional buffer)
100   "Encode the text between START and END which is encoded in CODING-SYSTEM.
101 \[emu-mule.el; XEmacs 20 emulating function]"
102   t)
103
104 (defun code-detect-region (beg end)
105   "Detect coding-system of the text in the region between START and END.
106 \[emu-e19.el; Mule emulating function]"
107   )
108
109 (defun set-file-coding-system (coding-system &optional force)
110   )
111
112
113 ;;; @ character and string
114 ;;;
115
116 (defun char-bytes (chr) 1)
117 (defun char-width (chr) 1)
118
119 (defalias 'string-width 'length)
120
121 (defun string-to-char-list (str)
122   (mapcar (function identity) str)
123   )
124
125 (defalias 'sref 'aref)
126
127 (defun truncate-string (str width &optional start-column)
128   "Truncate STR to fit in WIDTH columns.
129 Optional non-nil arg START-COLUMN specifies the starting column.
130 \[emu-e19.el; Mule 2.3 emulating function]"
131   (or start-column
132       (setq start-column 0))
133   (substring str start-column width)
134   )
135
136
137 ;;; @ etc
138 ;;;
139
140 (cond (running-xemacs
141        (require 'emu-xemacs))
142       (running-emacs-19
143        (require 'emu-19)
144        ))
145
146
147 ;;; @ end
148 ;;;
149
150 (provide 'emu-e19)
151
152 ;;; emu-e19.el ends here