2 ;;; emu-mule.el --- Mule 2.* emulation module for Mule
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1994,1995 MORIOKA Tomohiko
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
9 ;;; $Id: emu-mule.el,v 7.7 1996/04/27 13:27:06 morioka Exp $
10 ;;; Keywords: emulation, compatibility, Mule
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.
33 (defalias 'char-charset 'char-leading-char)
39 (defun decode-coding-region (start end coding-system &optional buffer)
40 "Decode the text between START and END which is encoded in CODING-SYSTEM.
41 \[emu-mule.el; XEmacs 20 emulating function]"
46 (code-convert start end coding-system *internal*)
49 (defun encode-coding-region (start end coding-system &optional buffer)
50 "Encode the text between START and END which is encoded in CODING-SYSTEM.
51 \[emu-mule.el; XEmacs 20 emulating function]"
56 (code-convert start end *internal* coding-system)
59 (defun decode-coding-string (str coding-system)
60 "Decode the string STR which is encoded in CODING-SYSTEM.
61 \[emu-mule.el; XEmacs 20 emulating function]"
62 (code-convert-string str coding-system *internal*)
65 (defun encode-coding-string (str coding-system)
66 "Encode the string STR which is encoded in CODING-SYSTEM.
67 \[emu-mule.el; XEmacs 20 emulating function]"
68 (code-convert-string str *internal* coding-system)
72 ;;; @ version specific features
75 (cond (running-emacs-19
78 (defun fontset-pixel-size (fontset)
79 (let* ((fonts (cdr (get-fontset-info fontset)))
86 (setq n (aref fonts i))
94 (aref (get-font-info font) 5)
99 (defun tl:make-overlay (beg end &optional buffer type))
100 (defun tl:overlay-put (overlay prop value))
101 (defun tl:add-text-properties (start end properties &optional object))
105 ;;; @@ truncate-string
108 (or (fboundp 'truncate-string)
109 ;;; Imported from Mule-2.3
110 (defun truncate-string (str width &optional start-column)
111 "Truncate STR to fit in WIDTH columns.
112 Optional non-nil arg START-COLUMN specifies the starting column.
113 \[emu-mule.el; Mule 2.3 emulating function]"
115 (setq start-column 0))
116 (let ((max-width (string-width str))
121 (if (>= width max-width)
122 (setq width max-width))
123 (if (>= start-column width)
125 (while (< column start-column)
126 (setq ch (aref str from)
127 column (+ column (char-width ch))
128 from (+ from (char-bytes ch))))
129 (if (< width max-width)
132 (while (<= column width)
133 (setq ch (aref str to)
134 column (+ column (char-width ch))
136 to (+ to (char-bytes ch))))
138 (substring str from to))))
148 ;;; emu-mule.el ends here