+
+;; Copyright (C) 1995,1996 Free Software Foundation, Inc.
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Version: $Id: emu.el,v 7.37 1996/11/29 21:22:25 shuhei-k Exp $
+;; Keywords: emulation, compatibility, NEmacs, MULE, Emacs/mule, XEmacs
+
+;; This file is part of emu.
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Code:
+
+(defmacro defun-maybe (name &rest everything-else)
+ (or (and (fboundp name)
+ (not (get name 'defun-maybe))
+ )
+ (` (or (fboundp (quote (, name)))
+ (progn
+ (defun (, name) (,@ everything-else))
+ (put (quote (, name)) 'defun-maybe t)
+ ))
+ )))
+
+(put 'defun-maybe 'lisp-indent-function 'defun)
+
+
+(or (boundp 'emacs-major-version)
+ (defconst emacs-major-version (string-to-int emacs-version)))
+(or (boundp 'emacs-minor-version)
+ (defconst emacs-minor-version
+ (string-to-int
+ (substring
+ emacs-version
+ (string-match (format "%d\\." emacs-major-version) emacs-version)
+ ))))
+
+(defvar running-emacs-18 (<= emacs-major-version 18))
+(defvar running-xemacs (string-match "XEmacs" emacs-version))
+
+(defvar running-mule-merged-emacs (and (not (boundp 'MULE))
+ (not running-xemacs) (featurep 'mule)))
+(defvar running-xemacs-with-mule (and running-xemacs (featurep 'mule)))
+
+(defvar running-emacs-19 (and (not running-xemacs) (= emacs-major-version 19)))
+(defvar running-emacs-19_29-or-later
+ (or (and running-emacs-19 (>= emacs-minor-version 29))
+ (and (not running-xemacs)(>= emacs-major-version 20))))
+
+(defvar running-xemacs-19 (and running-xemacs
+ (= emacs-major-version 19)))
+(defvar running-xemacs-20-or-later (and running-xemacs
+ (>= emacs-major-version 20)))
+(defvar running-xemacs-19_14-or-later
+ (or (and running-xemacs-19 (>= emacs-minor-version 14))
+ running-xemacs-20-or-later))
+
+(cond (running-mule-merged-emacs
+ ;; for mule merged EMACS
+ (require 'emu-e20)
+ )
+ (running-xemacs-with-mule
+ ;; for XEmacs/mule
+ (require 'emu-x20)
+ )
+ ((boundp 'MULE)
+ ;; for MULE 1.* and 2.*
+ (require 'emu-mule)
+ )
+ ((boundp 'NEMACS)
+ ;; for NEmacs and NEpoch
+ (require 'emu-nemacs)
+ )
+ (t
+ ;; for EMACS 19 and XEmacs 19 (without mule)
+ (require 'emu-e19)
+ ))
+
+
+;;; @ binary access