;; ;; ~/.emacs ;; ;; This file is used by GNU emacs to initialize itself ;; ;; $Author: schlake val cort$ ;; $Date: 1994/06/25 22:28:12 $ ;; $Revision: 1.1 $ ;; $Source: /usr/local/adm/lib/initial_dir_src/RCS/.emacs,v $ ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Set up a reasonable backspace at the expense of ^H (help) ;; This is acceptable because emacs under X11 provides a help ;; pull down menu, and many users are confused and frustrated ;; by the lack of backspace. ;; ;; ESC-x help-for-help gives the normal help ;; (global-set-key "\^H" 'backward-delete-char) (global-set-key "\^?" 'backward-delete-char) ;; ;; M-m is compile ;; (global-set-key "\em" 'compile) ;; ;; M-g is goto-line ;; (global-set-key "\eg" 'goto-line) ;; ;; ;; get a few neat functions to autoload ;; (autoload 'spook "spook" nil t) (autoload 'gnus "gnus.el" nil t) ;; ;; this is for debugging: ;; ;(setq debug-on-error t) ;; ;; insert newline at the end of file if needed ;; (setq require-final-newline t) ;; ;; prevent strange things from happening with symlinks or hardlinks ;; (setq backup-by-copying t) (setq backup-by-copying-when-linked t) ;; ;; look for .el files in the default place, and in ~/elisp ;; directory ;; ;; (insert (prin1-to-string (eval 'load-path))) is useful for testing ;; (setq load-path (cons (expand-file-name "~/elisp") (cons (expand-file-name "~") (cons (expand-file-name ".") load-path))) ) ;; ;; For automatic auto fill mode (setq-default text-mode-hook 'auto-fill-mode) (setq-default fill-column 70) (setq-default default-major-mode 'text-mode) ;; ;; allow ESC ESCe ;; This is incredibly useful, but utterly confusing to new users ;; ;(put 'eval-expression 'disabled nil) ;; ;; This sets the return key to indent the next line if applicable. ;; This is kinda annoying in text mode, but most of the time useful. (global-set-key "\r" 'newline-and-indent) ;; ;; Pretty COLOR stuff ;; ;; Turns on syntax color for C - only in X, though. (cond (window-system (add-hook 'c-mode-hook 'turn-on-font-lock))) ;; ;; This turns on font-lock, for python. (autoload 'python-mode "python-mode" "Python editing mode." t) (setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist)) ;; ;; ...or if you prefer... ;;(setq font-lock-maximum-decoration t) ;; ;; Ada stuff ;; I hope to god I never have to use this stuff again. ;; ; (put 'upcase-region 'disabled nil) ; (custom-set-variables ; '(ada-case-attribute (quote downcase-word)) ; '(ada-label-indent 0) ; '(ada-case-identifier (quote downcase-word)) ; '(ada-compiler-make "a.make") ; '(ada-auto-case t)) ; (custom-set-faces) ;; ; (fset 'ada-improved-fill-comment-paragraph ; [?\M-q ?\C-a ?- ?- ? tab ?\C-e return]) ;; ;; M-a is ada-improved-fill-comment-paragraph ;; Since the built-in fill-comment-paragraph SUCKS ;; ;(global-set-key "\ea" 'ada-improved-fill-comment-paragraph) ;; ;; Ah, glorious linux C-mode! ;; (defun linux-c-mode () "C mode with adjusted defaults for use with the Linux kernel." (interactive) (c-mode) (c-set-style "K&R") (setq c-basic-offset 8)) (defun mutt-mode () "Mail composing mode for mutt mailer" (interactive) (text-mode) (auto-fill-mode)) ;; ;; Set a reasonable default mode depending on filename. ;; (setq auto-mode-alist (append '(("\\.c$" . linux-c-mode) ("\\.h$" . linux-c-mode) ("\\.ld$" . linux-c-mode) ("\\.skel$" . c-mode) ("\\.cc$" . c++-mode) ("\\.cpp$" . c++-mode) ("\\.C$" . c++-mode) ("\\.a$" . ada-mode) ("\\.s$" . asm-mode) ("\\.S$" . asm-mode) ("\\Makefile" . makefile-mode) ("\\makefile" . makefile-mode) ("\\.tcl$" . tcl-mode) ("\\xds$" . tcl-mode) ("\\.yrt$" . tcl-mode) ("\\.sa$" . sather-mode) ("\\.sl$" . rsl-mode) ("\\.login$" . sh-mode) ("\\.cshrc$" . sh-mode) ("\\.html$" . html-mode) ("\\.pov$" . pov-mode) ("mutt-" . mutt-mode) ) auto-mode-alist)) (custom-set-variables '(c-comment-continuation-stars "* ") '(c-hanging-comment-ender-p nil) '(c-hanging-comment-starter-p nil)) (custom-set-faces) ;; ;; Compensate for emacs 21 ;; ;; ;; Get rid of awful toolbars ;; (tool-bar-mode 0) (menu-bar-mode 0) ;; ;; For some reason, my .Xdefaults is now being ignored ;; (set-background-color "black") (set-foreground-color "white") ;; ;; BECAUSE REDHAT IS STUPID! STUPID STUPID STUPID! ;; (setq inhibit-default-init t)