Chris Capel's Emacs file

My Emacs file, circa 11-24-04. I run GNU emacs on linux X11, text console, and Windows.

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(auto-compression-mode t nil (jka-compr))
 '(bs-configurations (quote (("all" nil nil nil nil nil)
         ("files" nil nil nil bs-visits-non-file bs-sort-buffer-interns-are-last)
         ("files-and-scratch" "^\\*scratch\\*$" nil nil bs-visits-non-file bs-sort-buffer-interns-are-last)
         ("all-intern-last" nil nil nil nil bs-sort-buffer-interns-are-last)
         ("my-files" "\\*slime-repl sbcl\\*\\|\\*eshell\\*\\|\\*scratch\\*"
                      nil nil bs-visits-non-file bs-sort-buffer-interns-are-last))))
 '(bs-default-configuration "my-files")
 '(case-fold-search t)
 '(current-language-environment "Latin-1")
 '(default-frame-alist (quote ((tool-bar-lines . 0) (foreground-color . "gray90") (background-color . "black")
     (menu-bar-lines . 1) (width . 120) (height . 60))))
 '(default-input-method "latin-1-prefix")
 '(global-font-lock-mode t nil (font-lock))
 '(gnuserv-program (concat exec-directory "/gnuserv"))
 '(load-home-init-file t t)
 '(make-backup-files nil)
 '(pc-select-meta-moves-sexps t)
 '(pc-select-selection-keys-only t)
 '(pc-selection-mode t)
 '(require-final-newline t)
 '(save-place t nil (saveplace))
 '(show-paren-mode t nil (paren))
 '(slime-conservative-indentation nil)
 '(transient-mark-mode t))

(set-default 'auto-mode-alist (append '(("\\.php$" . c-mode) ("\\.inc$" . c-mode) ("\\.asd" . lisp-mode)) auto-mode-alist))

;; I use a hacked bs-cycle-*, to keep it from getting ;; out of order (global-set-key [f7] 'bs-cycle-previous) (global-set-key [f8] 'bs-cycle-next) (global-set-key [f9] 'bs-show) (global-set-key "\M-]" 'forward-page) (global-set-key "\M-[" 'backward-page) (global-set-key "\C-c\C-k" 'bury-buffer)

(defun Ctrl-enter () "Opens a new line before the current point. Equivalent to beginning-of-line, open-line" (interactive) (beginning-of-line) (open-line 1))

(global-set-key "\C-o" 'Ctrl-enter)

(defun close-or-bury-window () "Closes the open window or buries it if it's the only open window." (interactive) (if (= (count-windows) 1) (bury-buffer) (delete-window)))

(defun dwim-delete () (interactive) "Deletes the region if there's an active one, or delete-char otherwise." (if (ensure-mark) (delete-active-region) (delete-char 1)))

;(global-set-key "\C-d" 'dwim-delete) ;(global-set-key "\C-d" 'delete-char)

(global-set-key "\C-x0" 'close-or-bury-window)

(add-to-list 'load-path "/home/chris/lisp-libs/slime") (require 'slime) (setq lisp-mode-hook nil) (add-hook 'lisp-mode-hook (lambda () ;(slime-mode) (unless (slime-connected-p) (save-selected-window (slime)))))

(setq common-lisp-hyperspec-root "file:/home/chris/lisp/HyperSpec/")

(add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode t)))

(add-hook 'slime-mode-hook (lambda () (set-variable lisp-indent-function 'common-lisp-indent-function) (slime-define-key "\r" 'newline-and-indent) (slime-define-key [tab] 'slime-indent-and-complete-symbol) (slime-define-key "\C-cdp" 'add-print-statement) (slime-define-key "\C-cdr" 'remove-print-statement)))

(add-hook 'slime-repl-mode-hook (lambda () (local-set-key [up] 'slime-repl-previous-input) (local-set-key [down] 'slime-repl-next-input)))

(setq inferior-lisp-program "sbcl --no-linedit")

(custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(default ((t (:stipple nil :background "black" :foreground "gray90" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :family "misc-fixed")))) '(tooltip ((((class color)) (:background "lightyellow" :foreground "black")))))

(defun add-print-statement () (interactive) (insert "(print ") (forward-sexp) (insert ")") (backward-sexp))

(defun remove-print-statement () (interactive) (forward-sexp) (delete-backward-char 1) (backward-sexp) (backward-kill-word 1) (delete-backward-char 1))


Emacs customizations

CLiki pages can be edited by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively