-;;; emu-xemacs.el --- Emacs 19 emulation module for XEmacs
+;;; emu-xemacs.el --- emu API implementation for XEmacs
;; Copyright (C) 1995 Free Software Foundation, Inc.
-;; Copyright (C) 1995,1996 MORIOKA Tomohiko
+;; Copyright (C) 1995,1996,1997 MORIOKA Tomohiko
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Version:
-;; $Id: emu-xemacs.el,v 7.10 1996/08/30 15:14:30 morioka Exp $
+;; $Id: emu-xemacs.el,v 7.19 1997/04/05 06:50:48 morioka Exp $
;; Keywords: emulation, compatibility, XEmacs
-;; This file is part of tl (Tiny Library).
+;; This file is part of XEmacs.
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with this program; see the file COPYING. If not, write to
-;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; along with XEmacs; see the file COPYING. If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
;;; Code:
-;;; @ text property
+;;; @ face
;;;
(or (fboundp 'face-list)
(or (face-differs-from-default-p 'underline)
(set-face-underline-p 'underline t))
-(or (fboundp 'tl:set-text-properties)
- (defun tl:set-text-properties (start end props &optional buffer)
- (if (or (null buffer) (bufferp buffer))
- (if props
- (while props
- (put-text-property
- start end (car props) (nth 1 props) buffer)
- (setq props (nthcdr 2 props)))
- (remove-text-properties start end ())
- )))
- )
-
-(defun tl:add-text-properties (start end properties)
- (add-text-properties start end
- (append properties (list 'highlight t))
- )
- )
-(defalias 'tl:make-overlay 'make-extent)
-(defalias 'tl:overlay-put 'set-extent-property)
-(defalias 'tl:overlay-buffer 'extent-buffer)
+;;; @ overlay
+;;;
-(defun tl:move-overlay (extent start end &optional buffer)
- (set-extent-endpoints extent start end)
- )
+(condition-case err
+ (require 'overlay)
+ (error (defalias 'make-overlay 'make-extent)
+ (defalias 'overlay-put 'set-extent-property)
+ (defalias 'overlay-buffer 'extent-buffer)
+ (defun move-overlay (extent start end &optional buffer)
+ (set-extent-endpoints extent start end)
+ )
+ ))
-;;; @@ visible/invisible
+;;; @ visible/invisible
;;;
(defmacro enable-invisible ())
`(mapconcat #'char-to-string ,char-list ""))
+;;; @@ to avoid bug of XEmacs 19.14
+;;;
+
+(or (string-match "^../"
+ (file-relative-name "/usr/local/share" "/usr/local/lib"))
+ ;; This function was imported from Emacs 19.33.
+ (defun file-relative-name (filename &optional directory)
+ "Convert FILENAME to be relative to DIRECTORY
+(default: default-directory). [emu-xemacs.el]"
+ (setq filename (expand-file-name filename)
+ directory (file-name-as-directory
+ (expand-file-name
+ (or directory default-directory))))
+ (let ((ancestor ""))
+ (while (not (string-match (concat "^" (regexp-quote directory))
+ filename))
+ (setq directory (file-name-directory (substring directory 0 -1))
+ ancestor (concat "../" ancestor)))
+ (concat ancestor (substring filename (match-end 0)))
+ ))
+ )
+
+
;;; @ end
;;;