;;; -*-emacs-lisp-*- ;;; for emacs-21 ;; you should use M-x customize to set most options. (custom-set-variables ;; custom-set-variables was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. '(case-fold-search t) '(current-language-environment "English") '(debug-on-error nil) '(debug-on-signal nil t) '(debugger (quote debug) t) '(default-input-method "latin-1-prefix") '(dired-recursive-copies (quote always)) '(dired-recursive-deletes (quote top)) '(display-time-mode t nil (time)) '(global-font-lock-mode t nil (font-lock)) ;; To inhibit the annoying startup message, uncomment the following ;; lines and insert your user name. ; '(inhibit-startup-echo-area-message "wand") ; '(inhibit-startup-message t) '(mouse-wheel-mode t nil (mwheel)) ; '(save-place t nil (saveplace)) '(scroll-bar-mode (quote right)) '(show-paren-mode t nil (paren)) '(skeleton-debug nil t) '(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify))) '(time-stamp-active t) '(tool-bar-mode nil nil (tool-bar)) '(transient-mark-mode t) '(uniquify-after-kill-buffer-p t) '(uniquify-buffer-name-style (quote forward) nil (uniquify)) ) ;;; **************************************************************** ;;; load path ;;; **************************************************************** ; add any other packages you might want in ~/emacs-21. ; (add-to-list 'load-path "~/emacs-21") (add-hook 'write-file-hooks 'time-stamp) ;;; **************************************************************** ;;; useful global bindings ;;; **************************************************************** (global-set-key "\e1" 'set-mark-command) (global-set-key "\e2" 'insert-time) (global-set-key "\C-xg" 'goto-line) ; politically incorrect keybinding (global-set-key "\M-\C-w" 'copy-sexp-as-kill) (global-set-key "\M-o" 'occur) ;;; **************************************************************** ;;; Mode-specific Hooks and Settings ;;; **************************************************************** ;;; add new file patterns (defun auto-execute (pattern function-name) "Execute function named FUNCTION-NAME whenever a filename matching PATTERN is loaded by find-file" (setq auto-mode-alist (cons (cons pattern function-name) auto-mode-alist))) (defun auto-execute (pattern function-name) "Execute function named FUNCTION-NAME whenever a filename matching PATTERN is loaded by find-file" (add-to-list 'auto-mode-alist (cons pattern function-name))) (auto-execute "\\.emacs" 'emacs-lisp-mode) (auto-execute "\\.s$" 'scheme-mode) ; *.s means scheme, not assembly (auto-execute "\\.ss$" 'scheme-mode) (auto-execute "\\.pl$" 'perl-mode) ; *.pl means perl, not prolog (auto-execute "\\.perl$" 'perl-mode) (auto-execute "\\.ascii$" 'text-mode) (auto-execute "\\.blog$" 'html-helper-mode) (auto-execute "\\.html$" 'html-helper-mode) ;;; **************************************************************** ;;; Tex and Latex ;;; **************************************************************** ;;; AucTeX is the preferred mode for TeX and Latex. To activate it, ;;; uncomment the following: ; (require 'tex-site) ;;; **************************************************************** ;;; Scheme ;;; **************************************************************** ;; Here's how you add your own things to the mode-hook: (defun my-scheme-mode-hook () (progn (local-set-key "\e5" 'tex-mode) (setq indent-tabs-mode nil) (auto-fill-mode 1) )) (add-hook 'scheme-mode-hook 'my-scheme-mode-hook) (add-hook 'scheme-mode-hook 'imenu-add-menubar-index) (add-hook 'emacs-lisp-mode-hook 'imenu-add-menubar-index) ;;; **************************************************************** ;;; Handy utilities ;;; **************************************************************** (defun insert-time () (interactive) (insert-string (current-time-string))) (autoload 'copy-sexp-as-kill "scheme" "copy next sexp as if killed, but don't kill it" t)