1 ;;; poem.el --- Emulate latest MULE features; -*-byte-compile-dynamic: t;-*-
3 ;; Copyright (C) 1998,1999 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., 51 Franklin Street, Fifth Floor,
23 ;; Boston, MA 02110-1301, USA.
29 (cond ((featurep 'mule)
30 (cond ((featurep 'xemacs)
33 ((>= emacs-major-version 20)
37 ;; for MULE 1.* and 2.*
42 ;; for Nemacs and Nepoch
43 (require 'poem-nemacs)
50 ;;; @ Emacs 20.3 emulation
53 (defsubst-maybe string-as-unibyte (string)
54 "Return a unibyte string with the same individual bytes as STRING.
55 If STRING is unibyte, the result is STRING itself.
56 \[Emacs 20.3 emulating macro]"
59 (defsubst-maybe string-as-multibyte (string)
60 "Return a multibyte string with the same individual bytes as STRING.
61 If STRING is multibyte, the result is STRING itself.
62 \[Emacs 20.3 emulating macro]"
65 (defun-maybe charset-after (&optional pos)
66 "Return charset of a character in current buffer at position POS.
67 If POS is nil, it defaults to the current point.
68 If POS is out of range, the value is nil.
69 \[Emacs 20.3 emulating function]"
70 (char-charset (char-after pos))
73 ;;; @ XEmacs-mule emulation
76 (defalias-maybe 'char-int 'identity)
78 (defalias-maybe 'int-char 'identity)
80 (defalias-maybe 'characterp
82 ((fboundp 'char-valid-p) 'char-valid-p)
85 (defalias-maybe 'char-or-char-int-p
87 ((fboundp 'char-valid-p) 'char-valid-p)
90 (defun-maybe char-octet (ch &optional n)
91 "Return the octet numbered N (should be 0 or 1) of char CH.
92 N defaults to 0 if omitted. [XEmacs-mule emulating function]"
104 (product-provide (provide 'poem) (require 'apel-ver))
106 ;;; poem.el ends here