* poem-20.el (write-region-as-binary): Bind `jam-zcat-filename-list' with nil.
[elisp/apel.git] / poem.el
1 ;;; poem.el --- Emulate latest MULE features; -*-byte-compile-dynamic: t;-*-
2
3 ;; Copyright (C) 1998 Free Software Foundation, Inc.
4
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Keywords: emulation, compatibility, Mule
7
8 ;; This file is part of APEL (A Portable Emacs Library).
9
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.
14
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.
19
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.
24
25 ;;; Code:
26
27 (require 'poe)
28
29 (eval-and-compile
30   (unless (fboundp 'open-network-stream)
31     (require 'tcp)))
32
33 (cond ((featurep 'mule)
34        (cond ((featurep 'xemacs)
35               (require 'poem-xm)
36               )
37              ((>= emacs-major-version 20)
38               (require 'poem-e20)
39               )
40              (t
41               ;; for MULE 1.* and 2.*
42               (require 'poem-om)
43               ))
44        )
45       ((boundp 'NEMACS)
46        ;; for Nemacs and Nepoch
47        (require 'poem-nemacs)
48        )
49       (t
50        (require 'poem-ltn1)
51        ))
52
53
54 ;;; @ Emacs 20.3 emulation
55 ;;;
56
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]"
61   string)
62
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]"
67   string)
68
69
70 ;;; @ XEmacs-mule emulation
71 ;;;
72
73 (defalias-maybe 'char-int 'identity)
74
75 (defalias-maybe 'int-char 'identity)
76
77 (defalias-maybe 'characterp 'integerp)
78
79 (defalias-maybe 'char-or-char-int-p 'integerp)
80
81 (defun-maybe char-octet (ch &optional n)
82   "Return the octet numbered N (should be 0 or 1) of char CH.
83 N defaults to 0 if omitted. [XEmacs-mule emulating function]"
84   (or (nth (if n
85                (1+ n)
86              1)
87            (split-char ch))
88       0))
89
90
91 ;;; @ end
92 ;;;
93
94 (provide 'poem)
95
96 ;;; poem.el ends here