tm 7.49.
[elisp/apel.git] / emu-xemacs.el
1 ;;;
2 ;;; emu-xemacs.el --- Emacs 19 emulation module for XEmacs
3 ;;;
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1995 MORIOKA Tomohiko
6 ;;;
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;;; Version:
9 ;;;     $Id: emu-xemacs.el,v 7.2 1996/04/11 01:05:58 morioka Exp $
10 ;;; Keywords: emulation, compatibility, XEmacs
11 ;;;
12 ;;; This file is part of tl (Tiny Library).
13 ;;;
14 ;;; This program is free software; you can redistribute it and/or
15 ;;; modify it under the terms of the GNU General Public License as
16 ;;; published by the Free Software Foundation; either version 2, or
17 ;;; (at your option) any later version.
18 ;;;
19 ;;; This program is distributed in the hope that it will be useful,
20 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22 ;;; General Public License for more details.
23 ;;;
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with This program.  If not, write to the Free Software
26 ;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
27 ;;;
28 ;;; Code:
29
30 ;;; @ text property
31 ;;;
32
33 (or (fboundp 'face-list)
34     (defalias 'face-list 'list-faces)
35     )
36
37 (or (memq 'underline (face-list))
38     (and (fboundp 'make-face)
39          (make-face 'underline)
40          ))
41
42 (or (face-differs-from-default-p 'underline)
43     (set-face-underline-p 'underline t))
44
45 (or (fboundp 'tl:set-text-properties)
46     (defun tl:set-text-properties (start end props &optional buffer)
47       (if (or (null buffer) (bufferp buffer))
48           (if props
49               (while props
50                 (put-text-property 
51                  start end (car props) (nth 1 props) buffer)
52                 (setq props (nthcdr 2 props)))
53             (remove-text-properties start end ())
54             )))
55     )
56
57 (defun tl:add-text-properties (start end properties)
58   (add-text-properties start end
59                        (append properties (list 'highlight t))
60                        )
61   )
62
63 (defalias 'tl:make-overlay 'make-extent)
64 (defalias 'tl:overlay-put 'set-extent-property)
65 (defalias 'tl:overlay-buffer 'extent-buffer)
66
67 (defun tl:move-overlay (extent start end &optional buffer)
68   (set-extent-endpoints extent start end)
69   )
70
71
72 ;;; @ mouse
73 ;;;
74
75 (defvar mouse-button-1 'button1)
76 (defvar mouse-button-2 'button2)
77 (defvar mouse-button-3 'button3)
78
79
80 ;;; @ dired
81 ;;;
82
83 (or (fboundp 'dired-other-frame)
84     (defun dired-other-frame (dirname &optional switches)
85       "\"Edit\" directory DIRNAME.  Like `dired' but makes a new frame."
86       (interactive (dired-read-dir-and-switches "in other frame "))
87       (switch-to-buffer-other-frame (dired-noselect dirname switches))
88       )
89     )
90
91
92 ;;; @ string
93 ;;;
94
95 (defmacro char-list-to-string (char-list)
96   "Convert list of character CHAR-LIST to string. [emu-xemacs.el]"
97   `(mapconcat #'char-to-string ,char-list ""))
98
99
100 ;;; @ end
101 ;;;
102
103 (provide 'emu-xemacs)
104
105 ;;; emu-xemacs.el ends here