;;; ;;; .emacs ;;; (setq load-path (cons (expand-file-name "~/sss-emacs/custom") load-path)) ;(setq load-path (cons (expand-file-name "~/lisp") load-path)) (load "sssbindings") (set-my-bindings) (setq help-char '?') (load "emacs-options") (load "emacs-patches") (load "local-c-style") (load "my-auto-insert") ;(defvar hyperb:dir ; (if (file-exists-p "/work/upton-clued0/snyder/oobr/hyperbole") ; "/work/upton-clued0/snyder/oobr/hyperbole/" ; "~/lisp/hyperbole/") ; "Directory where the Hyperbole executable code is kept. ;It must end with a directory separator character.") ;(load (expand-file-name "hversion" hyperb:dir)) ;(load (expand-file-name "hyperbole" hyperb:dir)) (when (file-exists-p "/work/upton-clued0/snyder/oobr/oo-browser/br-lib.el") (defvar br-directory "/work/upton-clued0/snyder/oobr/oo-browser/" "Directory where the OO-Browser executable code is kept. It must end with a directory separator character.") (autoload 'oo-browser (expand-file-name "br-start" br-directory) "Invoke the OO-Browser" t) (autoload 'br-env-browse (expand-file-name "br-start" br-directory) "Browse an existing OO-Browser Environment" t) (global-set-key "\C-c\C-o" 'oo-browser) ) ;;; ;;; option settings ;;; ;; the krb version confuses efs... (setq efs-ftp-program-name "/usr/bsd/ftp") (fset 'string-lessp* 'string<) (defun bigfont nil (interactive) (font "-*-ITC Souvenir-Demi-R-Normal--14-**-1")) (defun bump-register (reg) (interactive "cBump register:") (let ((old (get-register reg))) (set-register reg (format (format "%%00%dd" (length old)) (1+ (string-to-int old)))))) ;;; ;;; terminal initialization ;;; ;; keypad handling for epoch ;; should integrate this with keypad.el somehow ;(defun keypad-function nil ; (interactive) ; (epoch::rebind-key "KP_1" nil "\033b") ; (epoch::rebind-key "KP_3" nil "\033f")) ;(defun keypad-numeric nil ; (interactive) ; (epoch::rebind-key "KP_1" nil "1") ; (epoch::rebind-key "KP_3" nil "3")) ;; HDS stuff (defun term-xon nil "Turn on flow control on the HDS terminal" (send-string-to-terminal "\e[1;1;0;0/r")) (defun term-xoff nil "Turn off flow control on the HDS terminal" (send-string-to-terminal "\e[0;0;0;0/r")) (setq term-setup-hook '(lambda nil ;; (term-xoff) (let ((term (getenv "TERM"))) ;; DEC-type terminals (cond ((and (equal (downcase (substring term 0 2)) "vt") (not (eq window-system 'x))) (progn (enable-arrow-keys) (setup-terminal-keymap CSI-map '(("2~" . ?\C-a) ; insert key -> BOL ("3~" . ?P) ; remove key -> prev. page ("4~" . ?D) ; select key -> del char ("5~" . ?\C-b) ; prev key -> EOL ("6~" . ?N))) ; next key -> next page )) ;; Iris console under wsh ((and (equal term "iris-ansi") (not (eq window-system 'x))) (enable-arrow-keys) (wsh-fix-delete)))))) (setq visible-bell t) (setq edit-picture-hook '(lambda () (local-set-key "\e[A" 'picture-move-up) (local-set-key "\e[B" 'picture-move-down) (local-set-key "\e[C" 'picture-forward-column) (local-set-key "\e[D" 'picture-backward-column) (local-set-key "\eOA" 'picture-move-up) (local-set-key "\eOB" 'picture-move-down) (local-set-key "\eOC" 'picture-forward-column) (local-set-key "\eOD" 'picture-backward-column))) ;;; ;;; i want to change the info-mode keymap, but info doesn't provide a hook! ;;; so - insert a hook for my code after loading the info lib. ;;; (defun set-my-info-bindings () (define-key Info-mode-map "b" 'scroll-down)) (if (boundp 'Info-mode-map) (set-my-info-bindings) (if (or (not (fboundp 'info)) (not (eq (car (symbol-function 'info)) 'autoload))) (error "'info is defined strangely...") (let ((info-body (symbol-function 'info))) (fset 'info (`(lambda nil (, (nth 2 info-body)) (interactive) (load-library (, (nth 1 info-body))) (set-my-info-bindings) (info))))))) ;; ;; i also want `b' to scroll backwards in view mode. fortunately, there's ;; a hook for that. ;; (setq view-hook '(lambda nil (define-key view-mode-map "b" 'View-scroll-lines-backward))) (setq dired-mode-hook '(lambda nil (setq truncate-lines t))) ;;; ;;; Some additional key bindings. ;;; (if (fboundp 'iconify-frame) (global-set-key "\C-x5i" 'iconify-frame)) ;;; ;;; emacs's default record format for new files is varying, with a maxrecl ;;; of 512. some packages, however, expect to be able to write arbitrarily ;;; long lines. so use stream_lf format as the default. ;;; (setq vms-stmlf-recfm t) ;;; ;;; load libraries, etc. ;;; (autoload 'flame "flame" "Generate ARG (default 1) sentences of half-crazed gibberish." t nil) (if (string= (substring (emacs-version) 0 6) "XEmacs") (load "completer") (load "complete") (setq PC-meta-flag t)) (if (string= (substring (emacs-version) 0 6) "XEmacs") (set-specifier default-toolbar-visible-p nil)) ; turn off toolbar (setq gutter-buffers-tab-visible-p nil) (setq gutter-buffers-tab-enabled nil) (if (string= (substring (emacs-version) 0 6) "XEmacs") (defun switch-to-buffer-other-window (buffer) "Select buffer BUFFER in another window." (interactive "BSwitch to buffer in other window: ") (let ((pop-up-windows t)) ;; XEmacs: this used to have (selected-frame) as the third argument, ;; but this is obnoxious. If the user wants the buffer in a ;; different frame, then it should be this way. ;; sss: Changed it back... (pop-to-buffer buffer t (selected-frame))))) (setq change-log-mode-hook '(lambda nil (auto-fill-mode))) ;(load "ud0") (setq D0-author-name "scott snyder") ;;; gnus (setq gnus-select-method '(nntp "news3.es.net")) ; nntp-server-function is the old way, nntp-open-connection-function is the new way. (setq gnus-secondary-select-methods '((nnmh "") (nntp "d0mino03.fnal.gov" (nntp-open-connection-function nntp-open-slogin) (nntp-open-server-function nntp-open-slogin) (nntp-rlogin-parameters ("d0news/d0news.py"))) (nntp "d0ol86.fnal.gov" (nntp-open-connection-function nntp-open-slogin) (nntp-open-server-function nntp-open-slogin) (nntp-rlogin-parameters ("crl/crl.py"))) )) (setq gnus-default-article-saver 'gnus-summary-save-in-file) (setq gnus-startup-file "~/news/.newsrc") (setq gnus-article-save-directory "~/news") (setq gnus-user-full-name "scott snyder") (setq gnus-novice-user nil) (setq gnus-secondary-servers '(("news3.es.net") ("d0bnl3"))) (setq gnus-local-organization "ha!") (setq gnus-mail-reply-method 'gnus-mail-reply-using-mhe) (setq gnus-mail-forward-method 'gnus-mail-forward-using-mhe) (setq gnus-mail-other-window-method 'gnus-mail-other-window-using-mhe) (setq nnmail-spool-file nil) (setq nnmail-delete-incoming nil) (setq nnmh-get-new-mail nil) (setq gnus-auto-expirable-newsgroups "nnmh:linux-kernel\\|nnmh:egcs\\|nnmh:darb\\|nnmh:swig\\|nnmh:bugtraq\\|nnmh:gdb\\|nnmh:boost\\|nnmh:xml") ;;(setq gnus-fetch-old-headers 'some) (defvar installation-directory "") ; needed for gnus 5 (defun nntp-open-slogin (buffer) "Open a connection to SERVER using rsh." (setq barbar t) (let ((proc (if nntp-rlogin-user-name (start-process "nntpd" buffer "ssh" nntp-address "-l" nntp-rlogin-user-name (mapconcat 'identity nntp-rlogin-parameters " ")) (start-process "nntpd" buffer "ssh" nntp-address (mapconcat 'identity nntp-rlogin-parameters " "))))) (set-buffer buffer) (nntp-wait-for-string "^\r*20[01]") (beginning-of-line) (delete-region (point-min) (point)) proc)) ;(if (library-exists "file-detect") ; (progn ; (setq xyzzy (library-exists "file-detect")) ; (require 'tm-view) ; (fset 'mime/viewer-mode-save (symbol-function 'mime/viewer-mode)) ; (defun mime/viewer-mode (&optional mother ctl encoding ibuf obuf ; mother-keymap) ; ; ; "Major mode for viewing MIME message. ; ;Here is a list of the standard keys for mime/viewer-mode. ; ;key feature ;--- ------- ; ;u Move to upper content ;p or M-TAB Move to previous content ;n or TAB Move to next content ;SPC Scroll up or move to next content ;M-SPC or DEL Scroll down or move to previous content ;RET Move to next line ;M-RET Move to previous line ;v Decode current content as `play mode' ;e Decode current content as `extract mode' ;C-c C-p Decode current content as `print mode' ;a Followup to current content. ;x Display X-Face ;q Quit ;button-2 Move to point under the mouse cursor ; and decode current content as `play mode' ;" ; (interactive) ; (if (not encoding) ; (setq encoding "8bit")) ; (mime/viewer-mode-save mother ctl encoding ibuf obuf mother-keymap)) ; )) ;;; appt (setq list-diary-entries-hook (list 'appt-make-list)) ;;; bbdb (if (string= system-type "linux") (setq load-path (cons (expand-file-name "~/lisp/bbdb") load-path))) (require 'bbdb) (bbdb-initialize 'mh-e 'gnus 'sendmail 'message 'sc) ;;; gopher (setq gopher-support-bookmarks t) ;;; mh-e (global-set-key "\C-xm" 'mh-smail) (global-set-key "\C-x4m" 'mh-smail-other-window) (if (string= system-type "linux") (progn (setq mh-progs "~/mh-linux/bin") (setq mh-lib "~/mh-linux/lib") ) (setq mh-progs "/local/data0/snyder/products/mh/v6_8_3c/bin") (setq mh-lib "/local/data0/snyder/products/mh/v6_8_3c/lib")) (setq mh-scan-prog "~/bin/widescan") (setq mh-inc-prog "~/bin/wideinc") (setq mh-cmd-note 6) (setq mime-editor/message-default-max-lines 100000) (setq mh-good-msg-regexp "^......[^D^]") (setq mh-deleted-msg-regexp "^......D") (setq mh-refiled-msg-regexp "^......\\^") (setq mh-cur-scan-msg-regexp "^......\\+") (fset 'old-user-full-name (symbol-function 'user-full-name)) (defun user-full-name () (downcase (old-user-full-name))) ;;; must defer this since user-mail-address now doesn't get set (by startup.el) ;;; until after .emacs has been read. ;(add-hook 'after-init-hook ; (function (lambda () ; (setq add-log-mailing-address ; (let ((i (string-match " " user-mail-address))) ; (if i ; (substring user-mail-address 0 i) ; user-mail-address))) ; ))) ;;; lpr (setq lpr-command "flpr") (setq lpr-switches '("-qoutback_hp8000_d")) (setq ps-lpr-switches '("-qoutback_post_d")) (setq ps-spool-duplex t) ;;; Commands added by calc-private-autoloads on Tue Feb 13 14:31:33 1996. (autoload 'calc-dispatch "calc" "Calculator Options" t) (autoload 'full-calc "calc" "Full-screen Calculator" t) (autoload 'full-calc-keypad "calc" "Full-screen X Calculator" t) (autoload 'calc-eval "calc" "Use Calculator from Lisp") (autoload 'defmath "calc" nil t t) (autoload 'calc "calc" "Calculator Mode" t) (autoload 'quick-calc "calc" "Quick Calculator" t) (autoload 'calc-keypad "calc" "X windows Calculator" t) (autoload 'calc-embedded "calc" "Use Calc inside any buffer" t) (autoload 'calc-embedded-activate "calc" "Activate =>'s in buffer" t) (autoload 'calc-grab-region "calc" "Grab region of Calc data" t) (autoload 'calc-grab-rectangle "calc" "Grab rectangle of data" t) (autoload 'edit-kbd-macro "macedit" "Edit Keyboard Macro" t) (autoload 'edit-last-kbd-macro "macedit" "Edit Keyboard Macro" t) (autoload 'read-kbd-macro "macedit" "Read Keyboard Macro" t) (setq load-path (append load-path (list "/exports/data0/snyder/local/lisp/calc-2.02c"))) (global-set-key "\e#" 'calc-dispatch) ;;; End of Calc autoloads. ;; ;; pcl-cvs ;; (setq cvs-program "/usr/products/cvs/v1_6/bin/cvs") (setq cvs-diff-program "/usr/products/cvs/v1_6/bin/diff") (setq cvs-rmdir-program "/bin/rmdir") ;; ;; compilation ;; (setq compile-command "/usr/products/gtools/v2_1/bin/gmake") (require 'compile) (defun compilation-mode-motion-hook (event) (mode-motion-highlight-internal event #'beginning-of-line #'(lambda () (let* ((p (point)) (e (progn (end-of-line) (point))) (l (progn ;;(if (or (eq compilation-error-list 't) ;; (>= p compilation-parsing-end)) ;; ;; #### Does it suck too badly to have mouse-movement ;; ;; #### over a buffer parse errors in that buffer?? ;; (save-window-excursion ;; (compile-reinitialize-errors nil p))) ;; yes it does! - sss (if (and compilation-error-list (<= (car (car compilation-error-list)) p)) ;; Perhaps save time by only searching tail compilation-error-list compilation-old-error-list)))) (if (catch 'found (while l (let ((x (marker-position (car (car l))))) (cond ((< x p) (setq l (cdr l))) ((<= x e) (throw 'found t)) (t (throw 'found nil))))) nil) (goto-char e) (goto-char p)))))) ;; ;; info ;; (setq Info-default-directory-list (cons "/d0sgif/data0/snyder/local/info/" Info-default-directory-list)) ;; ;; ispell ;; ;(setq ispell-program-name "/usr/products/ispell/v3_1a/bin/ispell") (setq ispell-program-name "/home/snyder/ispell/ispell") (setq process-environment (cons "ISPELL_TEXSKIPS=psfig:epsfig:figref:Figref:tabref:Tabref:secref:Secref:eqref:Eqref:eqsref:figsref:Figsref:tabsref:Tabsref:mcite:mynocite:Secsref:secsref:onlinecite" process-environment)) ;; ;; hyperbole ;; (setq smart-c-use-lib-man t) (defvar smart-c-include-dirs nil) (setq smart-c-include-dirs (cons "/d0sgif/data1/snyder/rel/test/include/" smart-c-include-dirs)) (setq smail:comment nil) ; load hyperbole (setq action-key-read-only nil) (setq assist-key-read-only nil) (require 'hsite) ;; The hypb mh stuff doesn't work with xemacs >= 20.3. ;; Disable it for now. (defun Mh-init () nil) ;;;;;;;;;;;;;;;; ;; add-log customization. (load "my-add-log") ;;;;;;;;;;;;;;;;;;;;;; ;; compilation ;; SRT can construct pathnames containing doubled slashes //. ;; however, when emacs sees a double slash, it goes back to the root. ;; so filter those out. (require 'compile) (fset 'compilation-find-file-save (symbol-function 'compilation-find-file)) (defun compilation-find-file (marker filename dir &rest formats) (while (string-match "//" filename) (setq filename (concat (substring filename 0 (1+ (match-beginning 0))) (substring filename (match-end 0))))) (apply 'compilation-find-file-save marker filename dir formats)) ;;;;;;;;;;;;;;;; ;; vc-related stuff. (setq diff-switches "-u") (setq cvs-program "/usr/products/cvs/v1_9/bin/cvs") (autoload 'pcl-cvs-fontify "pcl-cvs-xemacs" nil nil nil) ; somehow this was set wrong. ;;;;;;;;;;;;;;;;;;;;;; (setq auto-mode-alist (cons '("\\.zebinc$" . fortran-mode) auto-mode-alist)) (if (fboundp 'custom-set-variables) (progn (custom-set-variables '(display-time-24hr-format t)) (custom-set-faces))) ;;; Enable TM with MH-E. ;(if (library-exists "file-detect") ; (require 'tm-mh-e)) ;; Use AUCTeX? (condition-case nil (require 'tex-site) (t t)) (setq TeX-master nil) (setq TeX-insert-braces nil) ;; supercite ;(autoload 'sc-cite-original "supercite" "Supercite 3.1" t) (add-hook 'mail-citation-hook 'sc-cite-original) (setq add-log-full-name "scott snyder") (display-time) (setq display-time-24hr-format t) (setq user-mail-address "snyder@fnal.gov") (setq smiley-regexp-alist nil) (setq query-user-mail-address nil) ;; Doing this right makes cuts too slow. (setq x-selection-strict-motif-ownership nil) (custom-set-variables '(load-home-init-file t t)) (custom-set-faces)