1 ;;; poe-xemacs.el --- poe submodule for XEmacs
3 ;; Copyright (C) 1995 Free Software Foundation, Inc.
4 ;; Copyright (C) 1995,1996,1997,1998 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
34 (defun-maybe set-cursor-color (color-name)
35 "Set the text cursor color of the selected frame to COLOR.
36 When called interactively, prompt for the name of the color to use."
37 (interactive "sColor: ")
38 (set-frame-property (selected-frame) 'cursor-color
39 (if (color-instance-p color-name)
41 (make-color-instance color-name))))
47 (defalias-maybe 'face-list 'list-faces)
49 (or (memq 'underline (face-list))
50 (and (fboundp 'make-face)
51 (make-face 'underline)))
53 (or (face-differs-from-default-p 'underline)
54 (set-face-underline-p 'underline t))
63 (defalias 'make-overlay 'make-extent)
64 (defalias 'overlayp 'extentp)
65 (defalias 'overlay-put 'set-extent-property)
66 (defalias 'overlay-buffer 'extent-buffer)
67 (defun move-overlay (extent start end &optional buffer)
68 (set-extent-endpoints extent start end))
69 (defalias 'delete-overlay 'detach-extent)))
75 (defun-maybe dired-other-frame (dirname &optional switches)
76 "\"Edit\" directory DIRNAME. Like `dired' but makes a new frame."
77 (interactive (dired-read-dir-and-switches "in other frame "))
78 (switch-to-buffer-other-frame (dired-noselect dirname switches)))
81 ;;; @ to avoid bug of XEmacs 19.14
84 (or (string-match "^../"
85 (file-relative-name "/usr/local/share" "/usr/local/lib"))
86 ;; This function was imported from Emacs 19.33.
87 (defun file-relative-name (filename &optional directory)
88 "Convert FILENAME to be relative to DIRECTORY
89 (default: default-directory)."
90 (setq filename (expand-file-name filename)
91 directory (file-name-as-directory
93 (or directory default-directory))))
95 (while (not (string-match (concat "^" (regexp-quote directory))
97 (setq directory (file-name-directory (substring directory 0 -1))
98 ancestor (concat "../" ancestor)))
99 (concat ancestor (substring filename (match-end 0))))))
102 ;;; @ Emacs 20.3 emulation
105 (defalias-maybe 'line-beginning-position 'point-at-bol)
106 (defalias-maybe 'line-end-position 'point-at-eol)
112 (provide 'poe-xemacs)
114 ;;; poe-xemacs.el ends here