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)))
110 (defmacro char-list-to-string (char-list)
111 "Convert list of character CHAR-LIST to string. [poe-xemacs.el]"
112 `(mapconcat #'char-to-string ,char-list ""))
115 ;;; @@ to avoid bug of XEmacs 19.14
118 (or (string-match "^../"
119 (file-relative-name "/usr/local/share" "/usr/local/lib"))
120 ;; This function was imported from Emacs 19.33.
121 (defun file-relative-name (filename &optional directory)
122 "Convert FILENAME to be relative to DIRECTORY
123 (default: default-directory). [poe-xemacs.el]"
124 (setq filename (expand-file-name filename)
125 directory (file-name-as-directory
127 (or directory default-directory))))
129 (while (not (string-match (concat "^" (regexp-quote directory))
131 (setq directory (file-name-directory (substring directory 0 -1))
132 ancestor (concat "../" ancestor)))
133 (concat ancestor (substring filename (match-end 0)))))
137 ;;; @ Emacs 20.3 emulation
140 (or (fboundp 'line-beginning-position)
141 (defalias 'line-beginning-position 'point-at-bol))
143 (or (fboundp 'line-end-position)
144 (defalias 'line-end-position 'point-at-eol))
150 (provide 'poe-xemacs)
152 ;;; poe-xemacs.el ends here