;;; Filename: .emacs ;;; Description: jfulton's .emacs ;;; Supported Langauge(s): Elisp ;;; Time-stamp: <2006-06-07 22:05:26 jfulton> ;; -------------------------------------------------------- ;; Don't show me the startup message (setq inhibit-startup-message t) ;; When in Text mode, want to be in Auto-Fill mode. (defun my-auto-fill-mode nil (auto-fill-mode 1)) (add-hook 'text-mode-hook 'my-auto-fill-mode) (add-hook 'mail-mode-hook 'my-auto-fill-mode) ;; If auto-mode-alist can't determine what mode the latest file ;; needs, the default should be text-mode (not fundamental) (setq-default major-mode 'text-mode) ;; Sometimes I like the new line ; (setq c-auto-newline t) ;; Don't like backup~ files (setq make-backup-files nil) ;; I used to do this so I could C-h to backspace (bad) ;; (require 'cl) ;; (when (not window-system) ;; (setq key-translation-map (make-sparse-keymap)) ;; (define-key key-translation-map "\177" "\C-h") ;; (define-key key-translation-map "\C-h" "\177") ;; (defvar BACKSPACE "\177") ;; (defvar DELETE "\C-h") ;; (global-set-key BACKSPACE 'backward-delete-char)) ;; I used to use pico, so I had C- to M-f (bad) ;(global-unset-key "\C-\ ") ;(global-unset-key "\C-@") ;(global-set-key "\C-\ " 'forward-word) ;; Richard's maddness (for fun historical reasons) (defun lunchp (when where) "Have lunch? WHEN? WHERE?" (interactive "sWhen (blank for no lunch today): \nsWhere: ") (setq richard "kreuter@anduril.rutgers.edu") (if (string= when "") (setq subj "\"Sorry, can't today.\"") (setq subj (concat "\"Lunch? Sure! How about " when " at " where ".\""))) (setq cmd (concat "/usr/bin/mail -s " subj " " richard)) (shell-command cmd)) ;; Clock (display-time-mode t) ;; Pasted in timestamps too many times (defun insert-time () "inserts time-stamp in current buffer" (interactive) (insert-string (current-time-string))) ;; Global font lock (global-font-lock-mode 1) ;; No toolbar (tool-bar-mode nil) ;; Mouse wheel (mouse-wheel-mode 1) ;; Show parens (show-paren-mode t) ;; Change case of a region (put 'upcase-region 'disabled nil) (put 'downcase-region 'disabled nil) ;; My elisp files (for ansiterm & python/php modes) (add-to-list 'load-path "/home/jfulton/elisp") (require 'termfix) (require 'php-mode) (require 'python-mode) ;; My short-cuts file (load (expand-file-name "~/elisp/coding-standards")) ;; SLIME and other Common Lisp things (Dec 11, 2005) (push "/home/jfulton/elisp/slime" load-path) (require 'slime) (add-hook 'lisp-mode-hook (lambda () (slime-mode t))) (add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode t))) (setq inferior-lisp-program "sbcl") (setq common-lisp-hyperspec-root "/home/jfulton/lisp/hyperspec/HyperSpec/") ; (slime-setup) ;; lookup hyperspec in w3m (setq browse-url-browser-function 'w3m-browse-url) ;; w3m (autoload 'w3m "w3m" "Interface for w3m on Emacs." t) (require 'w3m) (defun w3m-browse-url-other-window (url &optional newwin) (interactive (browse-url-interactive-arg "w3m URL: ")) (let ((pop-up-frames nil)) (switch-to-buffer-other-window (w3m-get-buffer-create "*w3m*")) (w3m-browse-url url))) ;; irc (setq load-path (cons "/home/jfulton/elisp/erc" load-path)) (progn (require 'erc-pcomplete) (require 'erc-fill) (require 'erc-dcc) (require 'erc-match) (require 'erc-nickserv)) (setq erc-auto-query t) (require 'erc-list) ;; tramp (require 'tramp) (setq tramp-auto-save-directory (expand-file-name "~/.emacs.d/auto-save-list")) (setq tramp-default-method "ssh" tramp-default-user "jfulton") (setenv "nc" "/ssh:jfulton@207.210.101.182:/var/www/html/") ;; completion.el (load-library "completion.el") ; want C-x C-j to do completion (define-key ctl-x-map "\C-j" 'complete) ;; battery ;; (load (expand-file-name "~/elisp/battery-freebsd")) ;; (require 'battery-freebsd) ;; (display-battery)