1 ;;; poe-xemacs.el --- poe 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>
7 ;; Keywords: emulation, compatibility, XEmacs
9 ;; This file is part of APEL (A Portable Emacs Library).
11 ;; This program is free software; you can redistribute it and/or
12 ;; modify it under the terms of the GNU General Public License as
13 ;; published by the Free Software Foundation; either version 2, or (at
14 ;; your option) any later version.
16 ;; This program is distributed in the hope that it will be useful, but
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ;; General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
31 (or (fboundp 'face-list)
32 (defalias 'face-list 'list-faces))
34 (or (memq 'underline (face-list))
35 (and (fboundp 'make-face)
36 (make-face 'underline)))
38 (or (face-differs-from-default-p 'underline)
39 (set-face-underline-p 'underline t))
47 (error (defalias 'make-overlay 'make-extent)
48 (defalias 'overlay-put 'set-extent-property)
49 (defalias 'overlay-buffer 'extent-buffer)
50 (defun move-overlay (extent start end &optional buffer)
51 (set-extent-endpoints extent start end)
56 ;;; @ visible/invisible
59 (defmacro enable-invisible ())
61 (defmacro end-of-invisible ())
63 (defun invisible-region (start end)
66 (eq (following-char) ?\n))
67 (setq start (1+ start))
69 (put-text-property start end 'invisible t)
72 (defun visible-region (start end)
73 (put-text-property start end 'invisible nil)
76 (defun invisible-p (pos)
79 (eq (following-char) ?\n))
82 (get-text-property pos 'invisible)
85 (defun next-visible-point (pos)
89 (eq (following-char) ?\n))
92 (or (next-single-property-change pos 'invisible)
99 (or (fboundp 'dired-other-frame)
100 (defun dired-other-frame (dirname &optional switches)
101 "\"Edit\" directory DIRNAME. Like `dired' but makes a new frame."
102 (interactive (dired-read-dir-and-switches "in other frame "))
103 (switch-to-buffer-other-frame (dired-noselect dirname switches)))
107 ;;; @ to avoid bug of XEmacs 19.14
110 (or (string-match "^../"
111 (file-relative-name "/usr/local/share" "/usr/local/lib"))
112 ;; This function was imported from Emacs 19.33.
113 (defun file-relative-name (filename &optional directory)
114 "Convert FILENAME to be relative to DIRECTORY
115 (default: default-directory). [poe-xemacs.el]"
116 (setq filename (expand-file-name filename)
117 directory (file-name-as-directory
119 (or directory default-directory))))
121 (while (not (string-match (concat "^" (regexp-quote directory))
123 (setq directory (file-name-directory (substring directory 0 -1))
124 ancestor (concat "../" ancestor)))
125 (concat ancestor (substring filename (match-end 0)))))
129 ;;; @ Emacs 20.3 emulation
132 (or (fboundp 'line-beginning-position)
133 (defalias 'line-beginning-position 'point-at-bol))
135 (or (fboundp 'line-end-position)
136 (defalias 'line-end-position 'point-at-eol))
142 (provide 'poe-xemacs)
144 ;;; poe-xemacs.el ends here