tm 7.48.
[elisp/apel.git] / emu.el
1 ;;;
2 ;;; emu.el --- Emulation module for each Emacs variants
3 ;;;
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1995,1996 MORIOKA Tomohiko
6 ;;;
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;;; modified by Shuhei KOBAYASHI <shuhei@cmpt01.phys.tohoku.ac.jp>
9 ;;; Version:
10 ;;;     $Id: emu.el,v 7.3 1996/03/13 17:13:31 morioka Exp $
11 ;;; Keywords: emulation, compatibility, NEmacs, Mule, XEmacs
12 ;;;
13 ;;; This file is part of tl (Tiny Library).
14 ;;;
15 ;;; This program is free software; you can redistribute it and/or
16 ;;; modify it under the terms of the GNU General Public License as
17 ;;; published by the Free Software Foundation; either version 2, or
18 ;;; (at your option) any later version.
19 ;;;
20 ;;; This program is distributed in the hope that it will be useful,
21 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23 ;;; General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with This program.  If not, write to the Free Software
27 ;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
28 ;;;
29 ;;; Code:
30
31 (cond ((boundp 'MULE)  (require 'emu-mule))
32       ((boundp 'NEMACS)(require 'emu-nemacs))
33       (t               (require 'emu-orig))
34       )
35
36
37 ;;; @ Emacs 19.29 emulation
38 ;;;
39
40 (or (fboundp 'buffer-substring-no-properties)
41     (defun buffer-substring-no-properties (beg end)
42       "Return the text from BEG to END, without text properties, as a string."
43       (let ((string (buffer-substring beg end)))
44         (tl:set-text-properties 0 (length string) nil string)
45         string))
46     )
47
48 (cond ((or (<= emacs-major-version 18)
49            (<= emacs-minor-version 28))
50        ;; for Emacs 19.28 or earlier
51        (defun tl:read-string (prompt &optional initial-input history)
52          (read-string prompt initial-input)
53          )
54        )
55       (t
56        ;; for Emacs 19.29 or later
57        (defalias 'tl:read-string 'read-string)
58        ))
59
60
61 ;;; @ XEmacs emulation
62 ;;;
63
64 (or (fboundp 'functionp)
65     (defun functionp (obj)
66       "Returns t if OBJ is a function, nil otherwise.
67 \[emu.el; XEmacs emulating function]"
68       (or (subrp obj)
69           (byte-code-function-p obj)
70           (and (symbolp obj)(fboundp obj))
71           (and (consp obj)(eq (car obj) 'lambda))
72           ))
73     )
74         
75
76 ;;; @ end
77 ;;;
78
79 (provide 'emu)
80
81 ;;; emu.el ends here