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)
59 (defun-maybe dired-other-frame (dirname &optional switches)
60 "\"Edit\" directory DIRNAME. Like `dired' but makes a new frame."
61 (interactive (dired-read-dir-and-switches "in other frame "))
62 (switch-to-buffer-other-frame (dired-noselect dirname switches))
66 ;;; @ to avoid bug of XEmacs 19.14
69 (or (string-match "^../"
70 (file-relative-name "/usr/local/share" "/usr/local/lib"))
71 ;; This function was imported from Emacs 19.33.
72 (defun file-relative-name (filename &optional directory)
73 "Convert FILENAME to be relative to DIRECTORY
74 (default: default-directory). [poe-xemacs.el]"
75 (setq filename (expand-file-name filename)
76 directory (file-name-as-directory
78 (or directory default-directory))))
80 (while (not (string-match (concat "^" (regexp-quote directory))
82 (setq directory (file-name-directory (substring directory 0 -1))
83 ancestor (concat "../" ancestor)))
84 (concat ancestor (substring filename (match-end 0)))))
88 ;;; @ Emacs 20.3 emulation
91 (or (fboundp 'line-beginning-position)
92 (defalias 'line-beginning-position 'point-at-bol))
94 (or (fboundp 'line-end-position)
95 (defalias 'line-end-position 'point-at-eol))
101 (provide 'poe-xemacs)
103 ;;; poe-xemacs.el ends here