1 ;;; poem.el --- Emulate latest MULE features; -*-byte-compile-dynamic: t;-*-
3 ;; Copyright (C) 1998 Free Software Foundation, Inc.
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Keywords: emulation, compatibility, Mule
8 ;; This file is part of APEL (A Portable Emacs Library).
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.
30 (unless (fboundp 'open-network-stream)
33 (cond ((featurep 'mule)
34 (cond ((featurep 'xemacs)
37 ((>= emacs-major-version 20)
41 ;; for MULE 1.* and 2.*
46 ;; for Nemacs and Nepoch
47 (require 'poem-nemacs)
54 ;;; @ Emacs 20.3 emulation
57 (defsubst-maybe string-as-unibyte (string)
58 "Return a unibyte string with the same individual bytes as STRING.
59 If STRING is unibyte, the result is STRING itself.
60 \[Emacs 20.3 emulating macro]"
63 (defsubst-maybe string-as-multibyte (string)
64 "Return a multibyte string with the same individual bytes as STRING.
65 If STRING is multibyte, the result is STRING itself.
66 \[Emacs 20.3 emulating macro]"
69 (defun-maybe charset-after (&optional pos)
70 "Return charset of a character in current buffer at position POS.
71 If POS is nil, it defauls to the current point.
72 If POS is out of range, the value is nil.
73 \[Emacs 20.3 emulating function]"
74 (char-charset (char-after pos))
77 ;;; @ XEmacs-mule emulation
80 (defalias-maybe 'char-int 'identity)
82 (defalias-maybe 'int-char 'identity)
84 (defalias-maybe 'characterp 'integerp)
86 (defalias-maybe 'char-or-char-int-p 'integerp)
88 (defun-maybe char-octet (ch &optional n)
89 "Return the octet numbered N (should be 0 or 1) of char CH.
90 N defaults to 0 if omitted. [XEmacs-mule emulating function]"
103 ;;; poem.el ends here