;; -*- emacs-lisp -*- ;; ;; Extra stuff that needs to be loaded by ~/.emacs to make my setup ;; work with XEmacs. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Next 3 definitions taken from Emacs 20.6 startup.el. Copyright as ;; follows: ;; Copyright (C) 1985, 86, 92, 94, 95, 96, 97, 1998, 1999 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: internal ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. (defvar normal-top-level-add-subdirs-inode-list nil) (defun normal-top-level-add-subdirs-to-load-path () "Add all subdirectories of current directory to `load-path'. More precisely, this uses only the subdirectories whose names start with letters or digits; it excludes any subdirectory named `RCS' or `CVS', and any subdirectory that contains a file named `.nosearch'." (let (dirs attrs (pending (list default-directory))) ;; This loop does a breadth-first tree walk on DIR's subtree, ;; putting each subdir into DIRS as its contents are examined. (while pending (setq dirs (cons (car pending) dirs)) (setq pending (cdr pending)) (setq attrs (nthcdr 10 (file-attributes (car dirs)))) (let ((contents (directory-files (car dirs))) (default-directory (car dirs))) (unless (member attrs normal-top-level-add-subdirs-inode-list) (setq normal-top-level-add-subdirs-inode-list (cons attrs normal-top-level-add-subdirs-inode-list)) (while contents (unless (member (car contents) '("." ".." "RCS" "CVS")) (when (and (string-match "\\`[a-zA-Z0-9]" (car contents)) ;; Avoid doing a `stat' when it isn't necessary ;; because that can cause trouble when an NFS server ;; is down. (not (string-match "\\.elc?\\'" (car contents))) (file-directory-p (car contents))) (let ((expanded (expand-file-name (car contents)))) (unless (or (file-exists-p (expand-file-name ".nosearch" expanded)) (file-exists-p (expand-file-name ".xnosearch" expanded))) (setq pending (nconc pending (list expanded))))))) (setq contents (cdr contents)))))) (normal-top-level-add-to-load-path (cdr (nreverse dirs))))) ;; This function is called from a subdirs.el file. ;; It assumes that default-directory is the directory ;; in which the subdirs.el file exists, ;; and it adds to load-path the subdirs of that directory ;; as specified in DIRS. Normally the elements of DIRS are relative. (defun normal-top-level-add-to-load-path (dirs) (let ((tail load-path) (thisdir (directory-file-name default-directory))) (while (and tail (not (equal thisdir (car tail))) (not (and (memq system-type '(ms-dos windows-nt)) (equal (downcase thisdir) (downcase (car tail)))))) (setq tail (cdr tail))) (setcdr tail (append (mapcar 'expand-file-name dirs) (cdr tail))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Hacked up by me: (defun show-paren-mode (arg) "Hacked version for XEmacs compatibility using \[paren-set-mode\]." (if (and arg (> arg 0)) (paren-set-mode 'paren) (paren-set-mode))) (copy-face 'zmacs-region 'region) ;; mailabbrev is required later. This will work around the filename ;; difference. (provide 'mailabbrev) (require 'mail-abbrevs) (fset 'mail-abbrevs-setup 'mail-aliases-setup) ;; This is a real hack! (if (boundp 'initial-frame-plist) (progn (setq initial-frame-alist (plist-to-alist initial-frame-alist)))) (if (boundp 'default-frame-plist) (progn (setq default-frame-alist (plist-to-alist default-frame-alist)))) (if (boundp 'special-display-frame-plist) (progn (setq special-display-frame-alist (plist-to-alist special-display-frame-alist)))) ;; Eek! Might have duplicates, but good enough! (defun x-display-list () "Return the list of display names that XEmacs has connections to." (mapcar 'device-connection (device-list))) (vc-load-vc-hooks) (defun display-time-event-handler nil) (setq zmacs-regions t) (custom-set-variables '(toolbar-visible-p nil) '(gutter-buffers-tab-enabled nil))