1 ;;; emu-e20_2.el --- emu API implementation for Emacs 20.1 and 20.2
3 ;; Copyright (C) 1996,1997,1998 Free Software Foundation, Inc.
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Keywords: emulation, compatibility, Mule
8 ;; This file is part of emu.
10 ;; This program is free software; you can redistribute it and/or
11 ;; modify it under the terms of the GNU General Public License as
12 ;; published by the Free Software Foundation; either version 2, or (at
13 ;; your option) any later version.
15 ;; This program is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;; General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
27 ;; This module requires Emacs 20.1 and 20.2.
34 (defsubst encode-mime-charset-region (start end charset)
35 "Encode the text between START and END as MIME CHARSET."
37 (if (and enable-multibyte-characters
38 (setq cs (mime-charset-to-coding-system charset)))
39 (encode-coding-region start end cs)
42 (defsubst decode-mime-charset-region (start end charset)
43 "Decode the text between START and END as MIME CHARSET."
45 (if (and enable-multibyte-characters
46 (setq cs (mime-charset-to-coding-system charset)))
47 (decode-coding-region start end cs)
50 (defsubst encode-mime-charset-string (string charset)
51 "Encode the STRING as MIME CHARSET."
53 (if (and enable-multibyte-characters
54 (setq cs (mime-charset-to-coding-system charset)))
55 (encode-coding-string string cs)
58 (defsubst decode-mime-charset-string (string charset)
59 "Decode the STRING as MIME CHARSET."
61 (if (and enable-multibyte-characters
62 (setq cs (mime-charset-to-coding-system charset)))
63 (decode-coding-string string cs)
70 (defalias 'char-length 'char-bytes)
72 (defmacro char-next-index (char index)
73 "Return index of character succeeding CHAR whose index is INDEX."
74 `(+ index (char-bytes char)))
80 (defalias 'sset 'store-substring)
82 (defun string-to-char-list (string)
83 "Return a list of which elements are characters in the STRING."
84 (let* ((len (length string))
88 (setq chr (sref string i))
90 (setq i (+ i (char-bytes chr)))
95 (defalias 'string-to-int-list 'string-to-char-list)
97 ;;; @@ obsoleted aliases
99 ;;; You should not use them.
101 (defalias 'string-columns 'string-width)
102 (make-obsolete 'string-columns 'string-width)
110 ;;; emu-e20_2.el ends here