2 ;;; emu-e19.el --- Mule 2 emulation module for Emacs 19 and XEmacs 19
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1994 .. 1996 MORIOKA Tomohiko
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
9 ;;; $Id: emu-e19.el,v 7.20 1996/05/28 06:37:36 morioka Exp $
10 ;;; Keywords: emulation, compatibility, Mule, Latin-1
12 ;;; This file is part of tl (Tiny Library).
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.
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.
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.
30 ;;; @ version and variant specific features
34 (require 'emu-xemacs))
43 (defconst charset-ascii 0 "Character set of ASCII")
44 (defconst charset-latin-1 129 "Character set of ISO-8859-1")
46 (defun charset-description (charset)
47 "Return description of CHARSET. [emu-e19.el]"
49 (documentation-property 'charset-ascii 'variable-documentation)
50 (documentation-property 'charset-latin-1 'variable-documentation)
53 (defun charset-registry (charset)
54 "Return registry name of CHARSET. [emu-e19.el]"
59 (defun charset-columns (charset)
60 "Return number of columns a CHARSET occupies when displayed.
64 (defun charset-direction (charset)
65 "Return the direction of a character of CHARSET by
66 0 (left-to-right) or 1 (right-to-left). [emu-e19.el]"
69 (defun find-charset-string (str)
70 "Return a list of charsets in the string.
71 \[emu-e19.el; Mule emulating function]"
72 (if (string-match "[\200-\377]" str)
76 (defun find-charset-region (start end)
77 "Return a list of charsets in the region between START and END.
78 \[emu-e19.el; Mule emulating function]"
81 (narrow-to-region start end)
83 (re-search-forward "[\200-\377]" nil t)
88 ;;; @@ for Mule emulation
92 (defconst lc-ltn1 129)
98 (defconst *internal* nil)
99 (defconst *ctext* nil)
100 (defconst *noconv* nil)
102 (defun character-encode-string (str coding-system)
103 "Encode the string STR which is encoded in CODING-SYSTEM. [emu-e19.el]"
106 (defun character-decode-string (str coding-system)
107 "Decode the string STR which is encoded in CODING-SYSTEM. [emu-e19.el]"
110 (defun character-encode-region (start end coding-system)
111 "Encode the text between START and END which is
112 encoded in CODING-SYSTEM. [emu-e19.el]"
115 (defun character-decode-region (start end coding-system)
116 "Decode the text between START and END which is
117 encoded in CODING-SYSTEM. [emu-e19.el]"
120 (defun code-convert-string (str ic oc)
121 "Convert code in STRING from SOURCE code to TARGET code,
122 On successful converion, returns the result string,
123 else returns nil. [emu-e19.el; Mule emulating function]"
126 (defun code-convert-region (beg end ic oc)
127 "Convert code of the text between BEGIN and END from SOURCE
128 to TARGET. On successful conversion returns t,
129 else returns nil. [emu-e19.el; Mule emulating function]"
132 (defun code-detect-region (beg end)
133 "Detect coding-system of the text in the region
134 between START and END. [emu-e19.el; Mule emulating function]"
137 (defun set-file-coding-system (coding-system &optional force)
144 (defun char-charset (chr)
145 "Return the character set of char CHR.
146 \[emu-e19.el; XEmacs 20 emulating function]"
151 (defun char-bytes (char)
152 "Return number of bytes a character in CHAR occupies in a buffer.
153 \[emu-e19.el; Mule emulating function]"
156 (defun char-columns (character)
157 "Return number of columns a CHARACTER occupies when displayed.
161 ;;; @@ for Mule emulation
164 (defalias 'char-width 'char-columns)
166 (defalias 'char-leading-char 'char-charset)
172 (defalias 'string-columns 'length)
174 (defun string-to-char-list (str)
175 (mapcar (function identity) str)
178 (defalias 'string-to-int-list 'string-to-char-list)
180 (defalias 'sref 'aref)
182 (defun truncate-string (str width &optional start-column)
183 "Truncate STR to fit in WIDTH columns.
184 Optional non-nil arg START-COLUMN specifies the starting column.
185 \[emu-e19.el; Mule 2.3 emulating function]"
187 (setq start-column 0))
188 (substring str start-column width)
191 ;;; @@ for Mule emulation
194 (defalias 'string-width 'length)
202 ;;; emu-e19.el ends here