The very unofficial .emacs home DavidAllen.emacs
emacs
Sections
home
what is this all about ?
customization basics
special topics
local dotfiles
dotfiles on the web
new and updated pages
useful sites and pages
search locally
EMacro
OS/2 Emacs
Latest Additions
local files:
John J. Glynn
David Jolley

linked files:


articles:


links:
The Emacs wiki
ODP search for Emacs


dmoz.org
;(put 'eval-expression 'disabled nil)
(setq explicit-shell-file-name "/bin/bash")

;; Set my email address for whatever.
(setq user-mail-address "s2mdalle@titan.vcu.edu")

;; Use column and line numbering.
(line-number-mode 1)
(column-number-mode 1)

;; Turn off the status bar if we're not in a window system
(menu-bar-mode (if window-system 1 -1))
;; Display time in the minibuffer
(display-time)
(global-set-key [home] 'beginning-of-line)
(global-set-key [end] 'end-of-line)

(global-set-key [f1] 'describe-function)
(global-set-key [f2] 'eval-buffer)
(global-set-key [f3] 'telephone)
(global-set-key [f5] 'undo)

(defun telephone ()
  (interactive)
  (find-file "~/phone.txt"))



;; Set major mode to text mode by default
(setq default-major-mode 'text-mode)
;; Turn on auto-fill-mode by default in unadorned files.
(add-hook 'text-mode-hook 'turn-on-auto-fill)

; Set C code mode to Kernighan and Ritchie mode - book p.326
(add-hook 'c-mode-hook
        '(lambda ()
                (c-set-style "K&R")))

(define-key ctl-x-map "[" 'shell)
;; $Id: DavidAllen.emacs.html,v 1.1.1.1 2003/10/25 21:10:51 ingo Exp $
;;
;; The Franz Inc. Lisp/Emacs interface.

(require 'cl)

(defun on-ms-windows ()
  (memq system-type '(windows-nt ms-windows ms-dos win386)))

(defvar *on-windows-nt*
    (and (on-ms-windows)
         (file-exists-p (format "%s/system32" (getenv "WINDIR")))))

(setq fi::emacs-type
  (let ((case-fold-search t))
    (cond ((or (string-match "xemacs" emacs-version)
               (string-match "lucid" emacs-version))
           (cond ((string-match "^20\." emacs-version) 'xemacs20)
                 (t 'xemacs19)))
          ((string-match "^20\." emacs-version) 'emacs20)
          ((string-match "^19\." emacs-version) 'emacs19)
          ((string-match "^18\." emacs-version) 'emacs18)
          ((boundp 'epoch::version) 'epoch)
          (t
           (error
            "%s is not supported by this version of the emacs-lisp interface."
            emacs-version)))))

(defvar fi::required-ipc-version 1)
(defvar fi::load-subprocess-files t)
(defvar fi::install-acl-menubar t)
(defvar fi::build-time nil)
(defvar fi::emacs-type nil)

(defun fi::find-path (path file)
  (let ((done nil) res temp)
    (while (and (not done) path)
      ;; accommodate nil's in the exec-path (bug3159)
      (setq temp (car path))
      (if (null temp)
          (setq temp default-directory))
      (if (file-exists-p
           (setq res (concat temp
                             (unless (string-match "/$" temp) "/")
                             file)))
          (setq done t)
        (setq res nil))
      (setq path (cdr path)))
    res))

(defvar fi::library-directory)
(cond
 ((or (not (boundp 'load-file-name))
      ;; The following clause is due to Emacs 20.2, where load-file-name is
      ;; bound but `nil'.  I was told by Erik Naggum that this bug would be
      ;; fixed in Emacs 20.3.
      (null load-file-name))
  ;; In this case, load-path must be used to find fi/fi-site-init.el and
  ;; the directory where it is found is used as fi::library-directory.
  (let* ((file "fi-site-init.el")
         (path
          (or (fi::find-path load-path (format "fi/%s" file))
              (fi::find-path load-path file))))
    (when (not path)
      (error "Can't find fi/%s or %s in your load-path." file file))
    (setq fi::library-directory (file-name-directory path)))
  ;; Toss this version of fi::find-path, since it is redefined later
  ;; (compiled, too).
  (fset 'fi::find-path nil))
 (t 
  (setq fi::library-directory (file-name-directory load-file-name))))

(defun fi::locate-library (file)
  (let (p)
    (cond
     ((string-match "\\.elc?$" file)
      (if (file-exists-p (setq p (format "%s%s" fi::library-directory file)))
          p
        nil))
     ((and (setq p (format "%s%s.elc" fi::library-directory file))
           (file-exists-p p))
      p)
     ((and (setq p (format "%s%s.el" fi::library-directory file))
           (file-exists-p p))
      p)
     ((and (setq p (format "%s.elc" file)) (file-exists-p p)) p)
     ((and (setq p (format "%s.el" file)) (file-exists-p p)) p)
     (t nil))))

;;;(load (or (fi::locate-library "fi-version.el")
;;;       (error "Couldn't find fi-version.el.")))

;; It would be nice to be able to differentiate between NT and 95, but that
;; doesn't appear possible right now.  The follow variable should default
;; to nil on Windows 95, when that is possible.
;;(when (on-ms-windows) (setq fi::load-subprocess-files nil))

(when (and (or (eq fi::emacs-type 'emacs19)
               (eq fi::emacs-type 'xemacs19))
           (not (on-ms-windows)))
  ;; needed for setf expansions (on some version 19.xx) when they are
  ;; compiled with non-version 19 byte-compilers.
  (let ((debug-on-error nil))
    (condition-case nil
        (require 'cl-compat)
      (error nil))))

(defvar fi::initialization-forms nil)
(defun fi::initialize-emacs-lisp-interface ()
  (when fi::initialization-forms
    (dolist (form (nreverse fi::initialization-forms))
      (eval form))
    (setq fi::initialization-forms nil)))

(unless (fboundp 'add-hook)     ;not in 18.59
  (defun add-hook (hook function &optional append)
    "Add to the value of HOOK the function FUNCTION.
FUNCTION is not added if already present.
FUNCTION is added (if necessary) at the beginning of the hook list
unless the optional argument APPEND is non-nil, in which case
FUNCTION is added at the end.

HOOK should be a symbol, and FUNCTION may be any valid function.  If
HOOK is void, it is first set to nil.  If HOOK's value is a single
function, it is changed to a list of functions."
    (or (boundp hook) (set hook nil))
    ;; If the hook value is a single function, turn it into a list.
    (let ((old (symbol-value hook)))
      (if (or (not (listp old)) (eq (car old) 'lambda))
          (set hook (list old))))
    (or (if (consp function)
            (member function (symbol-value hook))
          (memq function (symbol-value hook)))
        (set hook
             (if append
                 (nconc (symbol-value hook) (list function))
               (cons function (symbol-value hook)))))))

;; This style of loading is more appropriate on a single-user machine, like
;; a Windows machine.  It is even more appropriate on Windows where `make'
;; does not exist except for people who pay for it.  It seems to be the
;; best way to deal with the issue of how to compile the .el files.
(defvar fi:compile-at-load-time (on-ms-windows)
  "*If non-nil, then compile and load files in the fi/ directory.
Otherwise, the .elc will be loaded in preference to the .el file, if it
exists.")

(defvar fi::load-el-files-only nil)

(defun fi::load (file &rest load-before-compile)
  (cond
   (fi::load-el-files-only
    (let ((lib-file (fi::locate-library file))
          el-lib-file)
      (unless lib-file (error "can't find file %s" file))
      (dolist (required-file load-before-compile)
        (load required-file))
      (cond ((string-match "\\.el$" lib-file)
             (load lib-file))
            ((string-match "\\.elc$" lib-file)
             (load (substring lib-file 0 (- (length lib-file) 1))))
            (t (error "not el or elc")))))
   (fi:compile-at-load-time
    (let ((lib-file (fi::locate-library file))
          el-lib-file)
      (unless lib-file (error "can't find file %s" file))
      (dolist (required-file load-before-compile)
        (load required-file))
      (cond ((string-match "\\.el$" lib-file)
             ;; this compiles and loads:
      (byte-compile-file lib-file t))
            ((and (string-match "\\.elc$" lib-file)
                  (file-newer-than-file-p
                   (setq el-lib-file
                     (substring lib-file 0 (- (length lib-file) 1)))
                   lib-file))
             (byte-compile-file el-lib-file t))
            (t (load lib-file)))))
   (t (load (or (fi::locate-library file)
                (error "Couldn't find \"%s\"" file))))))

(defun fi::load-compiled (file &rest load-before-compile)
  (let ((lib-file (fi::locate-library file)))
    (unless lib-file (error "can't find file %s" file))
    (dolist (required-file load-before-compile)
      (load required-file))
    (cond ((string-match "\\.el$" lib-file)
           ;; no .elc file
    (byte-compile-file lib-file t)
           (setq lib-file (format "%sc" lib-file)))
          (t
           (let* ((xx (string-match "\\(.*\\)\\.elc$" lib-file))
                  (base (substring lib-file (match-beginning 1)
                                   (match-end 1)))
                  (el (format "%s.el" base))
                  (elc (format "%s.elc" base)))
             (when (file-newer-than-file-p el elc)
               (byte-compile-file el t)))))
    (load lib-file)))

(fi::load "/home/local/acl5/eli/fi-vers")
(when (and (= 19 (car fi:compiled-with-version))
           (= 20 emacs-major-version)
           (eq 'xemacs20 fi::emacs-type))
  (delete-other-windows)
  (switch-to-buffer "*Help*")
  (erase-buffer)
  (insert "
You must byte-recompile the .el files for XEmacs 20.x since there are
incompatibilities between FSF GNU Emacs version 19.x and XEmacs 20.x.

You can do this by running the following commands in your eli/ directory:

  make clean
  make emacs=<xemacs20> xemacs=<xemacs20>

where <xemacs20> is the name of your XEmacs 20.x binary.")
  (beginning-of-buffer)
  (beep)
  (error "You must byte-recompile the .el files for XEmacs 20.x."))

(fi::load "/home/local/acl5/eli/fi-keys")                 ; load before fi-modes
(fi::load "/home/local/acl5/eli/fi-modes")
(when fi:lisp-do-indentation
  (fi::load "/home/local/acl5/eli/fi-indent"))
(fi::load "/home/local/acl5/eli/fi-utils")
(fi::load "/home/local/acl5/eli/fi-gnu")

(unless fi::load-subprocess-files
  (defvar fi:package nil)
  (make-variable-buffer-local 'fi:package)
  ;; used in Common Lisp edit mode:
  (setq fi::common-lisp-backdoor-main-process-name nil))

(when fi::load-subprocess-files
  (fi::load "/home/local/acl5/eli/fi-subproc")
  (fi::load "/home/local/acl5/eli/fi-sublisp")
  (fi::load "/home/local/acl5/eli/fi-basic-lep")
  (fi::load "/home/local/acl5/eli/fi-lep")
  (fi::load "/home/local/acl5/eli/fi-dmode")
  (fi::load "/home/local/acl5/eli/fi-composer")
  (fi::load "/home/local/acl5/eli/fi-lze")
  (fi::load "/home/local/acl5/eli/fi-changes")
  (fi::load "/home/local/acl5/eli/fi-db")
  (fi::load "/home/local/acl5/eli/fi-stream")

  (when (eq fi::emacs-type 'epoch)
    (fi::load "fi-leep0")
    (fi::load "fi-leep"))

  (when (or (eq fi::emacs-type 'xemacs19)
            (eq fi::emacs-type 'xemacs20))
    (fi::load "fi-leep0")
    (fi::load "fi-leep-xemacs"))

  (fi::load "/home/local/acl5/eli/fi-ring")
  (fi::load "/home/local/acl5/eli/fi-filec")

  ;; `shell' and `rlogin' modes:
  (fi::load "/home/local/acl5/eli/fi-shell")
  (fi::load "/home/local/acl5/eli/fi-rlogin")
  (fi::load "/home/local/acl5/eli/fi-telnet")
  (fi::load "/home/local/acl5/eli/fi-su"))

(condition-case nil
    (fi::load "/home/local/acl5/eli/localfidev")
  (error nil))

(setq fi:package-loaded t)

;; the test for GNU Emacs 19 has to be after that for xemacs, because
;; the version of xemacs is 19.* too!

(when fi::load-subprocess-files
  (cond ((or (eq fi::emacs-type 'xemacs19)
             (eq fi::emacs-type 'xemacs20))
         (fi::load "fi-xemacs"))
        ((or (eq fi::emacs-type 'emacs19)
             (eq fi::emacs-type 'emacs20))
         (fi::load "/home/local/acl5/eli/fi-emacs19"))
        (t (fi::load "/home/local/acl5/eli/fi-emacs18"))))

(defun fi::top-level ()
  (fi::initialize-emacs-lisp-interface)
  (eval fi::build-time))

(if fi::build-time
    (progn
      (setq fi::build-time top-level)
      (setq top-level '(fi::top-level)))
  (fi::initialize-emacs-lisp-interface))

(provide 'fi-site-init)

(setq fi:common-lisp-image-name "/home/local/acl5/lisp")
(setq fi:common-lisp-host "localhost.localdomain")

(defun run-common-lisp ()
  (interactive)
  (fi:common-lisp fi:common-lisp-buffer-name
                  fi:common-lisp-directory
                  fi:common-lisp-image-name
                  fi:common-lisp-image-arguments
                  fi:common-lisp-host))


;; Here are my customizations
(fi::load "elisp/foo.elc")
All content copyright by the contributors. Website maintained with Emacs , wsmake and html-helper-mode
Emacs community logo by Daniel Lundin Last updated on Sat Jan 22 14:49:24 2005 by Ingo Koch