1 ;;; emu-xemacs.el --- emu API implementation for XEmacs
3 ;; Copyright (C) 1995 Free Software Foundation, Inc.
4 ;; Copyright (C) 1995,1996,1997 MORIOKA Tomohiko
6 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;; $Id: emu-xemacs.el,v 7.19 1997/04/05 06:50:48 morioka Exp $
9 ;; Keywords: emulation, compatibility, XEmacs
11 ;; This file is part of XEmacs.
13 ;; This program is free software; you can redistribute it and/or
14 ;; modify it under the terms of the GNU General Public License as
15 ;; published by the Free Software Foundation; either version 2, or (at
16 ;; your option) any later version.
18 ;; This program is distributed in the hope that it will be useful, but
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 ;; General Public License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with XEmacs; see the file COPYING. If not, write to the Free
25 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
33 (or (fboundp 'face-list)
34 (defalias 'face-list 'list-faces)
37 (or (memq 'underline (face-list))
38 (and (fboundp 'make-face)
39 (make-face 'underline)
42 (or (face-differs-from-default-p 'underline)
43 (set-face-underline-p 'underline t))
51 (error (defalias 'make-overlay 'make-extent)
52 (defalias 'overlay-put 'set-extent-property)
53 (defalias 'overlay-buffer 'extent-buffer)
54 (defun move-overlay (extent start end &optional buffer)
55 (set-extent-endpoints extent start end)
60 ;;; @ visible/invisible
63 (defmacro enable-invisible ())
65 (defmacro end-of-invisible ())
67 (defun invisible-region (start end)
70 (eq (following-char) ?\n))
71 (setq start (1+ start))
73 (put-text-property start end 'invisible t)
76 (defun visible-region (start end)
77 (put-text-property start end 'invisible nil)
80 (defun invisible-p (pos)
83 (eq (following-char) ?\n))
86 (get-text-property pos 'invisible)
89 (defun next-visible-point (pos)
93 (eq (following-char) ?\n))
96 (or (next-single-property-change pos 'invisible)
103 (defvar mouse-button-1 'button1)
104 (defvar mouse-button-2 'button2)
105 (defvar mouse-button-3 'button3)
111 (or (fboundp 'dired-other-frame)
112 (defun dired-other-frame (dirname &optional switches)
113 "\"Edit\" directory DIRNAME. Like `dired' but makes a new frame."
114 (interactive (dired-read-dir-and-switches "in other frame "))
115 (switch-to-buffer-other-frame (dired-noselect dirname switches)))
122 (defmacro char-list-to-string (char-list)
123 "Convert list of character CHAR-LIST to string. [emu-xemacs.el]"
124 `(mapconcat #'char-to-string ,char-list ""))
127 ;;; @@ to avoid bug of XEmacs 19.14
130 (or (string-match "^../"
131 (file-relative-name "/usr/local/share" "/usr/local/lib"))
132 ;; This function was imported from Emacs 19.33.
133 (defun file-relative-name (filename &optional directory)
134 "Convert FILENAME to be relative to DIRECTORY
135 (default: default-directory). [emu-xemacs.el]"
136 (setq filename (expand-file-name filename)
137 directory (file-name-as-directory
139 (or directory default-directory))))
141 (while (not (string-match (concat "^" (regexp-quote directory))
143 (setq directory (file-name-directory (substring directory 0 -1))
144 ancestor (concat "../" ancestor)))
145 (concat ancestor (substring filename (match-end 0)))))
152 (provide 'emu-xemacs)
154 ;;; emu-xemacs.el ends here