Initial Commit
[packages] / xemacs-packages / xwem / lisp / xwem-compat.el
1 ;;; xwem-compat.el --- GNU Emacs compatibility layer.
2
3 ;; Copyright (C) 2003-2005 by XWEM Org.
4
5 ;; Author: Zajcev Evgeny <zevlg@yandex.ru>
6 ;; Created: Fri Dec 12 15:51:10 MSK 2003
7 ;; Keywords: xwem, xlib
8 ;; X-CVS: $Id: xwem-compat.el,v 1.7 2005-04-04 19:54:10 lg Exp $
9
10 ;; This file is part of XWEM.
11
12 ;; XWEM is free software; you can redistribute it and/or modify it
13 ;; under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; any later version.
16
17 ;; XWEM is distributed in the hope that it will be useful, but WITHOUT
18 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
20 ;; License for more details.
21
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with XEmacs; see the file COPYING.  If not, write to the Free
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 ;; 02111-1307, USA.
26
27 ;;; Synched up with: Not in FSF
28
29 ;;; Commentary:
30
31 ;; Compatibility layer betwean XEmacs and GNU Emacs.  However xwem
32 ;; still can't run on GNU Emacs.
33
34 ;;; Code:
35 \f
36
37 (defvar xwem-gnuemacs-p (string-match "GNU Emacs" emacs-version)
38   "Non-nil when running under GNU Emacs.")
39
40 (defun xwem-define-prefix-command (name &optional mapvar)
41   "Compat version for `define-prefix-command'."
42   (if xwem-gnuemacs-p
43       (define-prefix-command name)
44     (define-prefix-command name t)))
45
46 (unless (fboundp 'set-keymap-default-binding)
47   (fset 'set-keymap-default-binding
48         #'(lambda (keym cmd) (define-key keym [t] cmd))))
49
50 (unless (fboundp 'events-to-keys)
51   (defalias 'events-to-keys 'identity))
52
53 \f
54 (provide 'xwem-compat)
55
56 ;;; xwem-compat.el ends here