; ; GNU emacs startup file ; Mostly stolen from lums ; Painfully modified by Jeff Squyres ; ; (someday I gotta learn lisp...) ; (defconst emacs18 (string-match "^18\\." emacs-version) "non-nil iff Emacs 18, nil otherwise") (defconst emacs19 (string-match "^19\\." emacs-version) "non-nil iff Emacs 19, nil otherwise") (defconst xemacs (string-match "XEmacs" emacs-version) "non-nil iff XEmacs, nil otherwise") ; ; General e-mail stuff, regardless of the e-mail client used in emacs ; (defvar email-address "Your Name ") (setq mail-signature t) (add-hook 'mail-setup-hook (function (lambda nil ;; add the "From ... " to the first line of a mail, the "CC: " field (save-excursion (goto-char (dot-min)) (insert (format "From: %s <%s>\n" (user-full-name) email-address))) (mail-position-on-field "To")))) (add-hook 'mail-mode-hook (function (lambda nil (setq mail-archive-file-name "~/Private/mail/sent-mail")))) (setq original-load-path load-path) (setq load-path (append (list (expand-file-name "~/lib/emacs/lisp/")) original-load-path)) (setq backup-by-copying t) (setq kept-new-versions 4) (setq trim-versions-without-asking t) (setq line-number-mode t) (setq c-argdecl-indent 2) (setq c-indent-level 2) (setq c-continued-statement-offset 2) (setq c-label-offset -2) (setq tcl-indent-level 2) (setq display-time-day-and-date t) (setq inhibit-startup-message t) (setq kill-ring-max 200) (setq next-screen-context-lines 4) (setq require-final-newline t) (setq scroll-step 4) (setq version-control t) (setq visible-bell t) (setq truncate-lines nil) (setq insert-default-directory t) (require 'cc-mode) (setq auto-mode-alist (append '(("\\.C$" . c++-mode) ("\\.H$" . c++-mode) ("\\.cc$" . c++-mode) ("\\.cct$" . c++-mode) ("\\.hh$" . c++-mode) ("\\.c$" . c-mode) ("\\.h$" . c-mode) ("\\.m$" . objc-mode) ("\\.java$" . java-mode) ("\\.F$" . fortran-mode) ("\\.F90$" . fortran-mode) ("\\.f$" . fortran-mode) ) auto-mode-alist)) (if (not xemacs) (require 'tex-site)) (setq auto-mode-alist (cons (cons "\\.txt" 'text-mode) auto-mode-alist)) (setq text-mode-hook (function (lambda nil (auto-fill-mode 1)))) (setq LaTeX-mode-hook (function (lambda nil (setq TeX-directory ".")))) (setq TeX-mode-hook (function (lambda nil (setq TeX-directory ".")))) (setq bibtex-mode-hook (function (lambda nil (load "bibtex")))) (define-key esc-map "\g" 'goto-line) (define-key esc-map "\m" 'auto-fill-mode) (define-key esc-map "\r" 'replace-string) (define-key esc-map "\^[" 'keyboard-quit) (define-key ctl-x-map "\^v" 'find-file-other-window) (define-key ctl-x-map "\^e" 'compile) (define-key ctl-x-map "\^n" 'next-error) (define-key ctl-x-map "\^m" 'shell) (define-key ctl-x-map "\^g" 'revert-buffer) (global-unset-key "\^x\^u") ; ; Disable bell when remote ; (if (not (equal (getenv "XREMOTE") nil)) (if (equal window-system 'x) (x-set-bell t))) (if emacs19 (progn (setq pop-up-frame-alist '((width . 80) (height . 58))) (setq default-frame-alist '((width . 80) (height . 58))) (menu-bar-mode 1))) ; ; 'cause I want to see the time ; (display-time) ; ; Font lock mode ; (if xemacs (font-lock-mode) (global-font-lock-mode t)) (setq font-lock-maximum-decoration '((c-mode . 3) (c++-mode . 3))) (setq font-lock-support-mode 'lazy-lock-mode) (setq fast-lock-cache-directories '("~/lib/emacs/.emacs-flc" ".")) (if xemacs (progn (set-face-foreground font-lock-preprocessor-face "White") (set-face-foreground font-lock-doc-string-face "Cyan"))) (setq gnus-subscribe-newsgroup-method '(lambda (newsgroup) (gnus-subscribe-newsgroup newsgroup) (gnus-kill-newsgroup newsgroup))) (setq gnus-default-article-saver (function gnus-summary-save-in-file)) (setq gnus-local-distributions '("world")) (if emacs19 (autoload 'display-faces "display-faces" "Display Faces" t)) (autoload 'html-mode "html-mode" "HTML major mode." t) (or (assoc "\\.html$" auto-mode-alist) (setq auto-mode-alist (cons '("\\.html$" . html-mode) auto-mode-alist))) (setq load-path (cons (expand-file-name "/afs/nd.edu/user1/lsc/Software/SUN4U_55/usr/local/lib/emacs/site-lisp/w3") load-path)) (autoload 'w3-preview-this-buffer "w3" "WWW Previewer" t) (autoload 'w3-follow-url-at-point "w3" "Find document at pt" t) (autoload 'w3 "w3" "WWW Browser" t) (autoload 'w3-open-local "w3" "Open local file for WWW browsing" t) (autoload 'w3-fetch "w3" "Open remote file for WWW browsing" t) (autoload 'w3-use-hotlist "w3" "Use shortcuts to view WWW docs" t) (autoload 'w3-show-hotlist "w3" "Use shortcuts to view WWW docs" t) (autoload 'w3-follow-link "w3" "Follow a hypertext link." t) (autoload 'w3-batch-fetch "w3" "Batch retrieval of URLs" t) (autoload 'url-get-url-at-point "url" "Find the url under the cursor" nil) (autoload 'url-file-attributes "url" "File attributes of a URL" nil) (autoload 'url-popup-info "url" "Get info on a URL" t) (autoload 'url-retrieve "url" "Retrieve a URL" nil) (autoload 'url-buffer-visiting "url" "Find buffer visiting a URL." nil) (setq w3-default-homepage "http://www.cse.nd.edu/") (put 'eval-expression 'disabled nil) (setq LaTeX-mode-hook (function (lambda nil (define-key LaTeX-mode-map "\eg" 'goto-line)))) ; ; Doppke's hack for following the cursor in the compile window ; (defadvice compile (after put-point-at-end activate) "Puts the point at the end of the compilation buffer." (let ((win (get-buffer-window "*compilation*")) (curwindow (selected-window))) (if win (progn (select-window win) (goto-char (point-max)) (select-window curwindow))))) (if (featurep 'compile) (ad-activate 'compile) (if xemacs (eval-when (WHEN load) '(ad-activate 'compile)) (eval-after-load "compile" '(ad-activate 'compile)))) ; ; Hack to make RCS behave better ; From the vc package authors ; Shouldn't mix RCS with TrueChange ; (setq vc-consult-headers nil) ; ; Stuff for VM mail ; (setq vm-mutable-windows t) (setq vm-mutable-frames nil) (setq vm-frame-per-completion nil) (setq vm-frame-per-composition nil) (setq vm-frame-per-edit nil) (setq vm-frame-per-folder nil) (setq vm-frame-per-summary nil) (setq vm-preview-lines t) (setq vm-startup-with-summary 'neither) (setq vm-mail-window-percentage 80) (setq vm-inhibit-startup-message t) (setq vm-auto-center-summary t) ; ; Function menu from jsiek/llee1 ; (require 'func-menu) (define-key global-map 'f8 'function-menu) (add-hook 'find-file-hooks 'fume-add-menubar-entry) (define-key global-map "\C-cl" 'fume-list-functions) (define-key global-map "\C-cg" 'fume-prompt-function-goto) (define-key global-map '(shift button3) 'mouse-function-menu) ;; For descriptions of the following user-customizable variables, ;; type C-h v (setq fume-max-items 25 fume-fn-window-position 3 fume-auto-position-popup t fume-display-in-modeline-p f fume-menubar-menu-location "File" fume-buffer-name "*Function List*" fume-no-prompt-on-valid-default nil) ;; ;; Scheme Stuff ;; (autoload 'scheme-mode "xscheme" "Major mode for Scheme." t) (autoload 'run-scheme "xscheme" "Switch to interactive Scheme buffer." t) ;; Options Menu Settings ;; ===================== (cond ((and (string-match "XEmacs" emacs-version) (boundp 'emacs-major-version) (or (and (= emacs-major-version 19) (>= emacs-minor-version 14)) (= emacs-major-version 20)) (fboundp 'load-options-file)) (load-options-file "/afs/nd.edu/user21/bholinka/.xemacs-options"))) ;; ============================ ;; End of Options Menu Settings (setq minibuffer-max-depth nil)