;; Mark Gerstein's .emacs file * 970314 *-----------* Global Key Bindings *--79 (global-set-key "" 'compile) (global-set-key "" 'electric-buffer-list) (global-set-key "\C-ca" 'mbg-well-mail) ; configure mail as from well (or with prefix from hyper) (global-set-key "\C-cb" 'center-line) (global-set-key "\C-cd" 'mbg-shift-block-by-arg) (global-set-key "\C-ce" 'mbg-shift-block-by-rect) (global-set-key "\C-cf" 'next-error) (global-set-key "\C-cg" 'kill-rectangle) ; saves last kill (global-set-key "\C-ch" 'yank-rectangle) ; yanks last kill (global-set-key "\C-ci" 'mbg-set-font) (global-set-key "\C-cj" 'command-history-mode) (global-set-key "\C-ck" 'goto-line) (global-set-key "\C-cl" 'arrow-indent-region) (global-set-key "\C-cm" 'mbg-mac-to-unix-eol) (global-set-key "\C-cn" 'string-rectangle) ; shifts block R and inserts prefix character (global-set-key "\C-co" 'laptop-full-size) (global-set-key "\C-cp" 'mbg-append) (global-set-key "\C-cq" 'mbg-insert-mailout) (global-set-key "\C-cr" 'mbg-truncate-lines) (global-set-key "\C-cs" 'open-rectangle) (global-set-key "\C-ct" 'hilit-sequence) (global-set-key "\C-cu" 'mbg-enlarge-window) (global-set-key "\C-cv" 'query-replace) (global-set-key "\C-cw" 'mbg-open-dot-emacs) (global-set-key "\C-cx" 'mbg-rebind-for-easy-horz-scroll) (global-set-key "\C-cy" 'mbg-colors) (global-set-key "\C-cz" 'eval-current-buffer) (global-set-key "\C-c0" 'mbg-toggle-hilit-buffer) ;(global-set-key "\C-c1" 'laptop-ext-xwin) (global-set-key "\C-c1" 'mail-it) (global-set-key "\C-c2" 'rename-uniquely) (global-set-key "\C-c3" 'sort-region) (global-set-key "\C-c4" 'hilit-column) (global-set-key "\C-c5" 'mbg-insert-line72) (global-set-key "\C-c6" 'mbg-insert-mortran-comment) (global-set-key "\C-c7" 'mbg-idea-mail-2 ) ; new "idea mail" where you type in from-field (global-set-key "\C-c8" 'mbg-fix-ctrl-m) (global-set-key "\C-c9" 'compare-windows) (global-set-key "\C-c*" 'mbg-re-read-buffer) ; kills current buffer & re-reads it (global-set-key "\M-a" 'electric-buffer-list) ; meta-a (global-set-key "\M-i" 'mbg-grap-mtmp) ; graps m.tmp from well.com (global-set-key "\M-o" 'mbg-flip-bs-del) ; flips meaning of bs and del (global-set-key "\M-p" 'mbg-restore-bs-del) ; undoes mbg-flip-bs-del (global-set-key "\M-O" 'mbg-idea-mail) ; old "idea mail" ;(global-set-key "\C-ca" 'laptop-small-size) ;(global-set-key "\C-cs" 'mbg-new-cc) ;global-set-key "\C-co" 'mbg-lookup-address) ;global-set-key "\C-ce" 'mbg-insert-mailout-old) ;; ---------------------------------------------------------* END Bindings *--- ;; ;; ;;-=============---------------------------------------------------------------------- ;; Documentation ;;-=============---------------------------------------------------------------------- ;; ;; This is Mark Gerstein's .emacs file . ;; It was last modified on 20-Apr-96 ;; ;; 1. To invoke emacs-19 from a SGI X-term: ;; emacs -fn 9x15bold -bd blue -fg green -bg black -cr red \ ;; -ms yellow -geometry 81x49+0+0 -i -f sgi-emacs19 $* & ;; 2. To invoke emacs-19 from a SGI text-terminal: ;; emacs -nw -f sgi-emacs19 $* ;; 3. To invoke emacs-18 from a text-terminal: ;; emacs -nw ;; 4. To invoke emacs-19 on linux under X ;; emacs ;; 5. To invoke emacs-19 on linux without X ;; emacs -nw ;; ;; You may obviously use this stuff, but please don't redistribute ;; in a commercial sense. ;; ;; Also, if you use the sequence alignment ;; features, you might want to cite the following paper: ;; M Gerstein, E Sonnhammer & C Chothia (1994). "Volume Changes on ;; Protein Evolution," J. Mol. Biol. 236: 1067-1078. ;; http://hyper.stanford.edu/~mbg/Align ;; ;; If you want to contact me, my e-mail address is mbg@hyper.stanford.edu ;; and my web address is http://hyper.stanford.edu/~mbg . ;; ;;============================================================================= ;; * I. My functions ;;============================================================================= (defun mbg-flip-bs-del nil "Switches the meaning the bs and delete keys at a low level." (interactive) (keyboard-translate 8 127) (keyboard-translate 127 8) (princ "switching bs and del") ) (defun mbg-restore-bs-del nil "Restores the meaning the bs and delete keys at a low level." (interactive) (keyboard-translate 8 8) (princ "restoring bs and del") (keyboard-translate 127 127) ) ;; ;; This describes the ASCII code as used by emacs and implemented by ;; by keyboard-translate ;; ;; (text-char-description 0) gives "^@", which is C-spc ;; (text-char-description 1) gives "^A" ;; next comes the standard ascii control characters (^A-^Z), including ;; (text-char-description 8) gives "^H", which is bs ;; ... ;; (text-char-description 26) gives "^Z" ;; (text-char-description 27) gives "^[", which is escape ;; (text-char-description 28) gives "^\\", which is C-\ ;; (text-char-description 29) gives "^]" ;; (text-char-description 30) gives "^^", which is C-^ ;; (text-char-description 31) gives "^_", which is C-_ (control-underscore) ;; (text-char-description 32) gives " ", which is space ;; (text-char-description 33) gives "!" ;; next comes that standard ascii printing characters, including.. ;; (text-char-description 97) "a" ;; ... ;; (text-char-description 126) gives "~" ;; (text-char-description 127) gives "^?", which is delete ;; (text-char-description 128) gives "M-^@", which is the beginning of the meta sequence ;; ... ;; (text-char-description 225) gives "M-a" ;; (text-char-description 255) gives "M-^?" ;; (text-char-description 256) gives "^@" and repeats the sequence (defun mbg-re-read-buffer nil (interactive) (setq f (buffer-file-name)) (princ (concat "Re-reading file " f)) (kill-buffer (buffer-name)) (find-file f) ) ;; Look at the function open-rectangle, which does similar things ;; ---------------------- (defun mbg-shift-block-by-arg (arg) ;; ---------------------- ;; "This command shifts the block of text right of the point to the right by arg spaces. The vertical size of the block is determined by current region." (interactive "p") (setq string (mbg-make-blanks arg "")) (mbg-shift-block2 string)) (defun mbg-shift-block2 (string) (setq save-point (point)) (setq save-mark (mark t)) (cond ((> save-point save-mark) ;(princ "This doesn't work: use C-x C-x to manually exchange point and mark") (set-mark (1+ save-point)) (goto-char save-mark) (mbg-shift-block2 string) ) (t (setq line1 (what-line)) (setq nline1 (string-to-int (substring line1 5 (length line1)))) (exchange-point-and-mark) (setq line2 (what-line)) (setq nline2 (string-to-int (substring line2 5 (length line2)))) (setq mbg-block-rows (1+ (abs (- nline2 nline1)))) (setq mbg-message (concat "mbg-shift-block-by-arg: lines in region are " (int-to-string nline1) "-" (int-to-string nline2 ) " => " (int-to-string mbg-block-rows) " rows for inserting '" string "'") ) (princ mbg-message ) (exchange-point-and-mark) (mbg-do-insert string mbg-block-rows) (goto-char save-point) ) ) ) (defun mbg-make-blanks (length string) (cond ((eq length 0) string) (t (mbg-make-blanks (- length 1) (concat " " string)) ))) (defun mbg-do-insert (ins count) (cond ((= count 0) nil) (t (insert ins) (next-line 1) (backward-char (length ins)) (mbg-do-insert ins (- count 1))))) (defun mbg-do-insert-up (ins count) (cond ((= count 0) nil) (t (insert "z") (princ count) (backward-char (length ins)) (previous-line 1) (mbg-do-insert-up ins (- count 1))))) ;------------------------------------------------------------ ;; ---------------------------------- (defun mbg-shift-block-by-arg-with-prefix (prefix) ;; ---------------------------------- ;; "This command shifts the block of text right of the point to the right by arg spaces using prefix as the fill character. The vertical size of the block is determined by current region. It is kind of a stupid function as it does the same thing that string-rectangle does" (interactive "sText: ") (setq arg 1) (setq string (mbg-make-start-string arg prefix "")) (mbg-shift-block2 string)) (defun mbg-make-start-string (length prefix string) (cond ((eq length 0) string) (t (mbg-make-blanks (- length 1) (concat prefix string)) ))) ;------------------------------------------------------------ (defun mbg-mac-to-unix-eol (arg) "Converts end-of-lines between unix (\n) and mac (^M) styles." (interactive "p") (goto-char 0) (cond ((eq arg 4) (while (search-forward "" nil t) (replace-match "\n" nil t)) ) ((eq arg 3) (toggle-read-only -1) (goto-char 0) (while (search-forward "" nil t) (replace-match "\n" nil t)) (goto-char 0) (while (search-forward "" nil t) (replace-match "" nil t)) ) (t (while (search-forward "\n" nil t) (replace-match "" nil t)) ) ) ) (defun mbg-well-mail-old (arg) "Converts normal e-mail to well-mail headers." (interactive "p") (goto-char 0) (search-forward "Reply-to: mbg@hyper.stanford.edu" nil t) (replace-match "Reply-to: mbg10@well.com" nil t) (goto-char 0) (search-forward "From: mbg@hyper.stanford.edu (Mark Gerstein)" nil t) (replace-match "From: mbg10@well.com" nil t) (goto-char 0) (search-forward "mbg@hyper.stanford.edu" nil t) (replace-match "mbg10@well.com" nil t) (goto-char 0) (search-forward "Subject:" nil t) ;(next-line 2) (end-of-line) ) (defun mbg-well-mail (arg) "Reloads smtpmail with either well or hyper settings" (interactive "p") (cond ((eq arg 4) (mbg-yale-smtpmail)) ((eq arg 3) (mbg-hyper-smtpmail)) (t (mbg-well-smtpmail)) ) ) (defun mbg-rc-info (p) (setq sp (point)) (goto-char p) (setq c (current-column)) (setq l-text (what-line)) (setq r (string-to-int (substring l-text 5 (length l-text)))) (goto-char sp) (list r c)) (defun mbg-region-info nil (interactive) (setq p (point)) (setq ps (int-to-string p)) (setq pr (int-to-string (car (mbg-rc-info p)))) (setq pc (int-to-string (car (cdr (mbg-rc-info p))))) (setq m (mark t)) (setq ms (int-to-string m)) (setq mr (int-to-string (car (mbg-rc-info m)))) (setq mc (int-to-string (car (cdr (mbg-rc-info m))))) (setq b (region-beginning)) (setq bs (int-to-string b)) (setq br (int-to-string (car (mbg-rc-info b)))) (setq bc (int-to-string (car (cdr (mbg-rc-info b))))) (setq e (region-end)) (setq es (int-to-string e)) (setq er (int-to-string (car (mbg-rc-info e)))) (setq ec (int-to-string (car (cdr (mbg-rc-info e))))) (setq mbg-message (concat "(name int row col): " "(point " ps " " pr " " pc ") " "(mark " ms " " mr " " mc ") " "(region-beginning " bs " " br " " bc ") " "(region-end " es " " er " " ec ") " ) ) (princ mbg-message ) ) (defun col-diff (b e) (setq save-point2 (point)) (goto-char b) (setq cb (current-column)) (goto-char e) (setq ce (current-column)) (goto-char save-point2) ) ;; ----------------------- (defun mbg-shift-block-by-rect (arg) ;; ----------------------- ;; "This command shifts the block of text right of the point to the right by the size of the current rectangular region." (interactive "p") (setq sp (point)) (setq b (region-beginning)) (setq bs (int-to-string b)) (setq br (int-to-string (car (mbg-rc-info b)))) (setq bc (int-to-string (car (cdr (mbg-rc-info b))))) (setq nbr (car (mbg-rc-info b))) (setq nbc (car (cdr (mbg-rc-info b)))) (setq e (region-end)) (setq es (int-to-string e)) (setq er (int-to-string (car (mbg-rc-info e)))) (setq ec (int-to-string (car (cdr (mbg-rc-info e))))) (setq ner (car (mbg-rc-info e))) (setq nec (car (cdr (mbg-rc-info e)))) (cond ((= (mark) b) (set-mark e))) (setq mbg-diff (- nec nbc)) (setq string (mbg-make-blanks mbg-diff "")) (setq mbg-block-rows (1+ (abs (- ner nbr)))) (setq mbg-message (concat "mbg-shift-block-by-rect: lines in region are " nbr "-" ner " => " (int-to-string mbg-block-rows) " rows for inserting " (int-to-string mbg-diff) " character string '" string "'") ) (princ mbg-message ) (goto-char b) (mbg-do-insert string mbg-block-rows) (goto-char b) ) ;;============================================================================= ; ------------------------------- (defun mbg-rebind-for-easy-horz-scroll (arg) ; ------------------------------- (interactive "p") (cond ((eq arg 4) (setq mbg-horz-scroll-flag nil)) ((eq arg 2) (setq mbg-horz-scroll-flag t)) ) (cond (mbg-horz-scroll-flag (global-set-key "\C-e" 'end-of-line) (global-set-key "\C-t" 'transpose-chars) (global-set-key "\C-r" 'isearch-backward) (global-set-key "\C-y" 'yank) (global-set-key "\C-o" 'open-line) (princ "Defaults: C-e=eol C-r=isearch-back C-t=transpose C-y=yank C-o=open-line" ) (setq mbg-horz-scroll-flag nil)) (t (global-set-key "\C-e" 'mbg-scroll-left-all-way) (global-set-key "\C-t" 'mbg-scroll-left) (global-set-key "\C-r" 'mbg-scroll-right) (global-set-key "\C-y" 'mbg-scroll-right-all-way) (global-set-key "\C-o" 'overwrite-mode) (princ "[C-e <--- C-t --- Rebind for Horz. Scroll --- C-r ---> C-y] (C-o=overwrite-mode)" ) (setq mbg-horz-scroll-flag t) ) ) ) (setq mbg-horz-scroll-flag nil) ; initial value (defun mbg-scroll-right (arg) (interactive "p") (scroll-right (* arg 30))) (defun mbg-scroll-right-all-way (arg) (interactive "p") (end-of-line) (hscroll-point-visible)) (defun mbg-scroll-left (arg) (interactive "p") (scroll-left (* arg 30))) (defun mbg-scroll-left-all-way (arg) (interactive "p") (beginning-of-line) (hscroll-point-visible)) (defun laptop-full-size nil (interactive) (set-background-color "light gray") (set-foreground-color "black") (set-cursor-color "red") (scroll-bar-mode -1) (menu-bar-mode -1) (set-default-font "7x13bold") ; or 7x13bold ; (set-frame-size (selected-frame) 90 36) (set-frame-size (selected-frame) 145 36) ; (set-frame-position (selected-frame) 4 4) ; 0 0 for no title bar (set-frame-position (selected-frame) 3 4) ; 0 0 for no title bar ) (defun laptop-small-size nil (interactive) (scroll-bar-mode 1 ) (menu-bar-mode 1) (set-frame-size (selected-frame) 81 25) (set-frame-position (selected-frame) 5 20) ; 0 0 for no title bar ) (defun laptop-ext-xwin nil (interactive) (scroll-bar-mode 1 ) (menu-bar-mode 1) (set-frame-size (selected-frame) 100 60) (set-frame-position (selected-frame) 5 20) ; 0 0 for no title bar (set-default-font "9x15bold") ; or 7x13bold (cond (window-system (setq hilit-mode-enable-list '(not text-mode) hilit-background-mode 'dark hilit-inhibit-hooks nil hilit-inhibit-rebinding nil) (load-library "hilit19") (set-background-color "black") (set-border-color "blue") (set-foreground-color "green") (set-cursor-color "red") (set-mouse-color "yellow") ) ) ) (defun mbg-fix-ctrl-m nil (interactive) (setq comint-output-filter-functions '(comint-postoutput-scroll-to-bottom shell-strip-ctrl-m))) (defun mac-keys nil (global-set-key "OC" 'forward-char) (global-set-key "OD" 'backward-char) (global-set-key "OA" 'previous-line) (global-set-key "OB" 'next-line) ) (setq mbg-IsGreen t) ;; ---------- (defun mbg-colors nil ;; ---------- (interactive) (cond (mbg-IsGreen (set-background-color "black") (set-foreground-color "white") (set-cursor-color "red") (set-mouse-color "yellow") (set-border-color "blue") (setq mbg-IsGreen nil)) (t (set-background-color "black") (set-foreground-color "green") (set-cursor-color "red") (set-mouse-color "yellow") (set-border-color "blue") (setq mbg-IsGreen t)) ) ) ;; ------------------ (defun mbg-enlarge-window nil ;; ------------------ (interactive) (enlarge-window 10) ) (defun mbg-set-font (arg) (interactive "p") (cond ((eq arg 4) (set-default-font "7x13")) (t (set-default-font "9x15bold")) ) ) ;; ---------------------- (defun mbg-insert-mailout-old-3 nil ;; ---------------------- (interactive) (insert-file "~/_tmp_") (arrow-indent-region) ) ;; ------------------------ (defun mbg-insert-mailout-old-2 nil ;; ------------------------ (interactive) (insert-file "~/m~") ) ;; ---------------------- (defun mbg-insert-mailout-old nil ;; ---------------------- (interactive) ; (kill-buffer "m~") ; (find-file "~/.m-o/.m.gz") (find-file "~/.elm/.m.gz") (mark-whole-buffer) (kill-region (point) (mark)) (mail) (mark-whole-buffer) (kill-region (point) (mark)) (yank 2) (auto-fill-mode) ) ;; ------------------ (defun mbg-insert-mailout nil ;; ------------------ (interactive) (cond ((get-buffer "m.tmp") (kill-buffer (get-buffer "m.tmp")))) ;(switch-to-buffer (get-buffer "m.tmp")) ;(rename-uniquely))) (find-file "/mbg10@well.com:.elm/m.tmp") (mark-whole-buffer) (copy-region-as-kill (point) (mark)) (mail) (mark-whole-buffer) (kill-region (point) (mark)) (yank 2) (auto-fill-mode) (write-file "~/.emacs-mbg-mail~") ) ;; ------------- (defun mbg-grap-mtmp nil ;; ------------- (interactive) (cond ((get-buffer "m.tmp") (kill-buffer (get-buffer "m.tmp")))) ;(switch-to-buffer (get-buffer "m.tmp")) ;(rename-uniquely))) (find-file "/mbg10@well.com:.elm/m.tmp") ) ;; ------------- (defun mbg-idea-mail (arg) ;; ------------- (interactive "p") (mail) (auto-fill-mode) (mark-whole-buffer) (kill-region (point) (mark)) (insert "To: mark.gerstein@yale.edu\n") (cond ( (eq arg 2) (insert "Subject: IDEA> \n") (insert "From: IDEA (IDEA)\n") ) ((eq arg 3) (insert "Subject: FACT> \n") (insert "From: FACT (FACT)\n") ) ((eq arg 4) (insert "Subject: UNIX> \n") (insert "From: UNIX (UNIX)\n") ) ((eq arg 5) (insert "Subject: GRANT> \n") (insert "From: GRANT (GRANT)\n") ) ((eq arg 6) (insert "Subject: ????> \n") (insert "From: QUESTION (QUESTION)\n") ) ((eq arg 7) (insert "Subject: ALIGN> \n") (insert "From: align (ALIGN)\n") ) ((eq arg 8) (insert "Subject: VOLUME> \n") (insert "From: volume (VOLUME)\n") ) ((eq arg 9) (insert "Subject: PROTMOT> \n") (insert "From: ProtMot (PROTMOT)\n") ) ((eq arg 10) (insert "Subject: GENOME> \n") (insert "From: genome (GENOME)\n") ) (t (insert "Subject: TODO> \n") (insert "From: TODO (TODO)\n") ) ) (insert "--text follows this line--\n") (previous-line 3) (end-of-line) (recenter) (princ "1.todo 2.idea 3.fact 4.unix 5.grant 6.???? 7.align 8.volume 9.protmot 10.genome") ) ;; --------------- (defun mbg-idea-mail-2-old (arg) ;; --------------- (interactive "ssubject: ") (cond ((equal arg "") (setq arg "todo"))) (mail) (auto-fill-mode) (mark-whole-buffer) (kill-region (point) (mark)) (insert "To: mark.gerstein@yale.edu\n") (setq from (upcase arg)) (insert (concat "Subject: " from "> \n")) (insert (concat "From: " from " (" from ")\n")) (insert "--text follows this line--\n") (previous-line 3) (end-of-line) (recenter) ) ;; --------------- (defun mbg-idea-mail-2 (arg) ;; --------------- (interactive "ssubject: ") (cond ((equal arg "") (setq arg "todo"))) (setq name (generate-new-buffer-name "idea-mail")) (switch-to-buffer name) (auto-fill-mode) (insert "To: mbg@csb.yale.edu\n") (setq from (upcase arg)) (insert (concat "Subject: " from "> \n")) (insert (concat "From: " from " (" from ")\n")) (cond ( (file-exists-p "Z:\\dos\\nm\\db\\idea-mail-copy") (insert "FCC: Z:\\dos\\nm\\db\\idea-mail-copy\n")) (t (insert "FCC: ~/idea-mail-copy\n")) ) (insert "--text follows this line--\n") (previous-line 4) (end-of-line) (recenter) (mail-mode) ) ;; ------------------ (defun mbg-open-dot-emacs (arg) ;; ------------------ (interactive "p") (cond ((eq arg 4) (cond ( (file-exists-p "Z:\\dos\\.emacs") (write-file "Z:\\dos\\.emacs") (message "writing Z:\\dos\\emacs") (write-file "~/.emacs") (message "writing ~/.emacs") ) (t (write-file "~/.emacs") (message "writing ~/.emacs") ))) (t (cond ( (file-exists-p "Z:\\dos\\.emacs") (find-file "Z:\\dos\\.emacs") (message "opening Z:\\dos\\.emacs") ) (t (find-file "~/.emacs") (message "opening ~/.emacs") ))) ) ) ;; ------------------ (defun mbg-truncate-lines nil ;; ------------------ (interactive) (cond ((eq truncate-lines t) (princ "truncate-lines -> nil") (set-variable 'truncate-lines nil)) (t (princ "truncate-lines -> t ") (set-variable 'truncate-lines t))) (recenter) ) ;; ------------------ (defun mbg-lookup-address nil ;; ------------------ (interactive) (setq b (buffer-name)) (mark-whole-buffer) (shell-command-on-region (point) (mark) "~/sh2/LookupAddress.sh") (set-buffer "*Shell Command Output*") (mark-whole-buffer) (kill-region (point) (mark)) (set-buffer b) (yank) ) ;; ---------------- (defun string-at-column (match-string) ;; ---------------- ;; mbg 1.III.91 ;; "This command finds match-string at the current column where the point is." (interactive "smatch-string: ") (setq pat (mbg-make-regexp match-string (current-column))) (princ pat) (re-search-forward pat)) (defun mbg-make-string (length string) (cond ((eq length 0) string) (t (mbg-make-string (- length 1) (concat "." string)) ))) (defun mbg-make-regexp (match-string column) (setq lh-string (mbg-make-string column "")) (concat "^" lh-string match-string)) ;; ------------------- (defun arrow-indent-region nil ;; ------------------- "This command indents a region with '> '" (interactive) (mail-mode) (exchange-point-and-mark) (setq m (mark)) (setq p (point)) ; (print m) ; (print p) (cond ((> p m) (exchange-point-and-mark))) (setq m (mark)) (setq p (point)) ; (print m) ; (print p) (setq mail-yank-prefix "> ") (mail-indent-citation) ) ;; ------- (defun mail-it nil ;; ------- (interactive) (setq nf (concat "~/IN/" (buffer-name) "-sent")) (mail-mode) (mail-send-and-exit 0) (write-file nf) (kill-buffer (buffer-name)) ) ;; ------------------- (defun append-whole-buffer (filename) ;; ------------------- "This command appends the buffer to a file" (interactive "sfilename: ") (mark-whole-buffer) (append-to-file (region-beginning) (region-end) filename) ) ;; ---------- (defun mbg-append nil ;; ---------- (interactive) (append-to-file (region-beginning) (region-end) "ap") ) ;; ---------- (defun mbg-new-cc nil ;; ---------- (interactive) (insert "CC: mbg, mbgmbg@leland\n") (insert "From: mbg@cb-iris.stanford.edu (Dumbo the Elephant)\n")) ; ======= (fset 'mbg-cc "CC: mbg, mbgmbg@leland\n" ) ; ======= ; ----------------- (defun mbg-insert-line72 (arg) ; ----------------- (interactive "p") (cond ( (eq arg 2) (insert " 1 2 3 4 5 6 7 \n") (insert "123456789012345678901234567890123456789012345678901234567890123456789012\n") ) ((eq arg 3) (insert "########################################################################\n") ) ((eq arg 4) (insert " 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 \n") (insert " 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 \n") (insert "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\n") ) ((eq arg 5) (insert ".'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'\n") ) ((eq arg 6) (insert "************************************************************************\n") ) ((eq arg 7) (insert "........................................................................\n") ) ((eq arg 8) (insert "______________________________ Reply Separator _________________________________\n") ) (t (insert ".. _ .. _ .. .. _ .. _ .. .. _ .. _ .. .. _ .. _ .. .. _ .. _ .. .. _ ..\n") ) ) ) (defun mbg-insert-dot-dash nil (interactive) (insert ".. _ .. _ .. .. _ .. _ .. .. _ .. _ .. .. _ .. _ .. .. _ .. _ .. .. _ ..\n") ) (defun mbg-insert-mortran-comment (arg) (interactive "p") (cond ( (eq arg 2) (insert "! *MBG* --- * --- * --- * --- * --- * --- * --- * --- * --- * --- * --- \n")) ((eq arg 3) (insert "!23456789.123456789.123456789.123456789.123456789.123456789.123456789.12")) ((eq arg 7) (insert "! *MBG* --- * --- * --- * --- * --- * --- * --- * --- * --- * --- * --- \n")) ((eq arg 5) (insert "! *MBG* ")) ((eq arg 6) (insert "! *MBG-2* ")) ((eq arg 4) (insert "! mbg3 ---------------------------------------------------------------- \n")) (t (insert "! mbg3 ")) ) ) ; ========== (fset 'mbg-ruler ; ========== " 1 2 3 4 5 6 7 8\n12345678901234567890123456789012345678901234567890123456789012345678901234567890\n") (defun sort-region () "This command sorts the current region" (interactive) (sort-lines nil (point) (mark))) ;; my-vax-mode (defun text-vax-mode nil "This command sets everything up to allow me to edit VMS text files." (interactive) (text-mode) (auto-fill-mode 1) (auto-save-mode -1) (setq fill-column 70) (setq make-backup-files nil) (princ " text-vax-mode is ON in this buffer. ")) (defun my-vax-mode nil "This command sets everything up to allow me to edit VMS files." (interactive) (auto-save-mode -1) (setq make-backup-files nil) (princ "** my-vax-mode is ON in this buffer **")) (defun find-vax-file (filename) "This command finds a vax text file." (interactive "Ffind-vax-file: ") (find-file filename) (auto-save-mode -1) (setq make-backup-files nil) (princ "** This buffer will not be backed up. **")) ;; Doesn't work ;; ;;(global-set-key "\C-c\C-x" 'my-vax-mode-helper) ;;(fset 'my-vN in this buffer **")) # " (defun find-vax-file (filename) "This command finds a vax text file." (interactive "Ffind-vax-file: ") (find-file filename) (auto-save-mode -1) (setq make-backup-files nil) (princ "** This buffer will not be backed up. **")) ;; Doesn't work ;; ;;(global-set-key "\C-c\C-x" 'my-vax-mode-helper) ;;(fset 'my-vax-mode ;; "\C-x\C-f") ;; (global-set-key "[17~" 'my-vax-mode) ; F6 ; my-list-mode (defun my-list-mode nil "This command implements mbg's list processing mode." (interactive) (text-mode) (setq indent-tabs-mode t) (auto-fill-mode 1) (setq fill-prefix ".....") ;(setq fill-prefix " ") (setq fill-column 75)) ; my-list-mode-off (defun my-list-mode-off nil "This command implements mbg's list processing mode." (interactive) (text-mode) (setq indent-tabs-mode nil) (auto-fill-mode 1) ;(setq fill-prefix ".....") (setq fill-prefix "") (setq fill-column 75)) ; my-fortran-mode (defun mfm nil "This command implements my-fortran-mode" (interactive) (fortran-mode) ;;*****$------------------------------------------------------------------*** (fset 'comment-bar "*****$\C-u65-******") (define-key fortran-mode-map "\C-c;" 'comment-bar) (setq-default indent-tabs-mode nil) (setq fortran-comment-region "*$$$") (setq fortran-comment-indent-char ? ) ; space ;(setq fortran-comment-indent-char ?- ) ; space (setq fortran-comment-indent-style 'relative) ;(setq fortran-comment-indent-style 'fixed) (setq comment-line-start "*") ;(setq fortran-comment-line-column 3) (setq fortran-comment-line-column 0) t) ;;============================================================================= ;; * IIa. From Steven Augart ;;============================================================================= ;;; on mac, map ^\ -> C-s, C-^ to C-q, and also swap C-h and DEL. (defun augart-mac () (interactive) (setq keyboard-translate-table "\000\^a\^b\^c\^d\^e\^f\^g\177\^i\^j\^k\^l\^m\^n\^o\^p\^q\^r\^s\^t\^u\^v\^w\^x\^y\^z\033\^s\035\^q\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\^h")) ;; map C-\ to C-s and C-_ to C-q (defun augart-unmac () (interactive) (setq keyboard-translate-table "\000\^a\^b\^c\^d\^e\^f\^g\^h\^i\^j\^k\^l\^m\^n\^o\^p\^q\^r\^s\^t\^u\^v\^w\^x\^y\^z\033\^s\035\^q\037")) ;; start off with translations for C-\ and C-^, since they are initially ;; unbound anyway. ;; (unmac) ;;============================================================================= ;; * IIb. clee stuff ;;============================================================================= ;(define-key c-mode-map "\C-c;" 'comment-bar ; ) ;(fset 'comment-side ; "/*\C-u63 */" ; ) ;(define-key c-mode-map "\C-cp" 'comment-side ; ) ;(fset 'comment-thin-bar ; "/*\C-u63-*/" ; ) ;(define-key c-mode-map "\C-ct" 'comment-thin-bar ; ) ;(fset 'dash-line ; "- " ; ) ;(fset 'comment-dash-line ; "/* \C-u31\M-xdash-line ;*/") ;;; make a short divider ;(fset 'comment-short-bar ; "/*\C-u20**/" ; ) ;(define-key c-mode-map "\C-cs" 'comment-short-bar ; ) ; " ;;============================================================================= ;; * III. Sequence Highlighting ;;============================================================================= ;; " ;; -------------- (defun hilit-sequence (arg) ;; -------------- ;; mbg 1.VII.95 ;; "This colours a buffer containing a sequence-alignment according to amino-acid type. The use of prolog-mode is a total hack. Use C-u arg to set the type colouring: 2=hydrophobic/charge/polar, 3=HP, anything-else=default" (interactive "p") (prolog-mode) (cond ( ; case 2 (eq arg 2) (princ "Case 2: Hydrophobic/Charge/Polar Highlighting") (hilit-set-mode-patterns 'prolog-mode '( ("[-.]" ; gap nil summary-current) ; default/skyblue-bold green/dimgrey-bold reverse-default ("[AaLlVvIiPpCcMmFf]" ; hydrophobic nil string) ; grey40 ("[DdEe]" ; negatively charged nil glob-struct) ; magenta ("[KkRrHh]" ; positively charged nil keyword) ; RoyalBlue ("[GgQqNnSsTtYyWw]" ; ~hydrophobic nil define) ; ForestGreen-bold ) ) ) ( ; case 3 (eq arg 3) (princ "Case 3: Silly HP Highlighting") (hilit-set-mode-patterns 'prolog-mode '( ("YY+" ; gap nil summary-current) ; default/skyblue-bold green/dimgrey-bold reverse-default ("GG+" ; nil define) ; ForestGreen-bold ("[ILVA][ILVA]+" ; nil glob-struct) ; magenta ) ) ) ( ; case 4 (eq arg 4) (princ "Case 4: HP Highlighting") (hilit-set-mode-patterns 'prolog-mode '( ("[-.]" ; gap nil summary-current) ; default/skyblue-bold green/dimgrey-bold reverse-default ("[AaLlVvIiPpCcMmFf]" ; H nil string) ; grey40 ("[DdEeKkRrHhGgQqNnSsTtYyWw]" ; ~H = P nil define) ; ForestGreen-bold ) ) ) ( ; case 5 (eq arg 5) (princ "Case 5: ML color schemeg") (hilit-set-mode-patterns 'prolog-mode '( ("[DE]" ; gap nil gnus-group-overflowing ); firebrick red bold-italic ("[KHR]" ; nil dired-directory ); blue-bold cyan bold ("C" ; nil summary-new ); blue-bold yellow-bold bold-italic ("[FILMVWY]" ; nil define ); ForestGreen-bold green bold ("[QNST]" ; nil msg-quote ); ForestGreen pink italic ("[A]" ; # "" nil summary-seen ); grey40 white nil ("[PG]" ; nil struct ); black-bold white-bold bold ("[^ACDEFGHIKLMNPQRSTVWY]" ; nil summary-seen ); grey40 white nil ) ) ) ( ; case 6 (eq arg 6) (princ "Case 4: Ig Highlighting") (hilit-set-mode-patterns 'prolog-mode '( ("[CW]" ; CW nil summary-current) ; default/skyblue-bold green/dimgrey-bold reverse-default ("[AaLlVvIiPpMmFf]" ; H nil string) ; grey40 ("[DdEeKkRrHhGgQqNnSsTtYy]" ; ~H = P nil define) ; ForestGreen-bold ) ) ) ( ; case 7 (eq arg 7) (princ "Case 7: GOR secondary struc. highlighting") (hilit-set-mode-patterns 'prolog-mode '( ("[Cc]" ; Coil nil summary-current) ; default/skyblue-bold green/dimgrey-bold reverse-default ("[Hh]" ; Helix nil gnus-group-overflowing ); firebrick red bold-italic ("[Ee]" ; Sheet nil define) ; ForestGreen-bold ) ) ) ( ; case default (eq t t) (princ "Default Highlighting") (hilit-set-mode-patterns 'prolog-mode '( ("[-.]" ; gap nil summary-current) ; default/skyblue-bold green/dimgrey-bold reverse-default ("[Pp]" nil include) ; purple ("[AaLlVvIi]" nil keyword) ; RoyalBlue ("[CcMm]" nil defun) ; blue-bold ("[DdEe]" nil define) ; ForestGreen-bold ("[QqNn]" nil decl) ; RoyalBlue ("[Gg]" nil formula) ; GoldenRod ("[FfYyWw]" nil label) ; red-underline ("[KkRr]" nil glob-struct) ; magenta ("[SsTt]" nil string) ; grey40 ("[Hh]" nil crossref) ; DarkGoldenRod ) ) ) ) (hilit-highlight-buffer) ) ; Name color-light-bg color-dark-bg face-with-no-color ; ~~~~ ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ;nil crossref ); DarkGoldenrod Goldenrod underline ;nil named-param ); DarkGoldenrod Goldenrod underline ;nil gnus-group-full ); ForestGreen green italic ;nil dired-ignored ); ForestGreen moccasin nil ;nil msg-quote ); ForestGreen pink italic ;nil define ); ForestGreen-bold green bold ;nil formula ); Goldenrod DarkGoldenrod underline ;nil summary-Xed ); OliveDrab2 green nil ;nil decl ); RoyalBlue cyan bold ;nil keyword ); RoyalBlue cyan bold-italic ;nil summary-unread ); RoyalBlue yellow bold ;nil struct ); black-bold white-bold bold ;nil msg-separator ); black/tan-bold black/lightblue nil ;nil dired-directory ); blue-bold cyan bold ;nil jargon-entry ); blue-bold cyan bold ;nil defun ); blue-bold cyan-bold bold-italic ;nil msg-subject ); blue-bold yellow bold ;nil summary-new ); blue-bold yellow-bold bold-italic ;nil rule ); blue-bold-underline cyan-underline default-bold-underline ;nil warning ); blue-italic green italic ;nil active-error ); default/pink-bold default/DeepPink-bold default-underline ;nil summary-current ); default/skyblue-bold green/dimgrey-bold reverse-default ;nil gnus-group-overflowing ); firebrick red bold-italic ;nil summary-deleted ); firebrick white italic ;nil msg-header ); firebrick-bold cyan italic ;nil dired-link ); firebrick-italic green italic ;nil comment ); firebrick-italic moccasin italic ;nil jargon-keyword ); firebrick-underline yellow underline ;nil string ); grey40 orange underline ;nil summary-seen ); grey40 white nil ;nil gnus-group-unsubscribed ); grey50 white nil ;nil summary-killed ); grey50 white nil ;nil glob-struct ); magenta Plum1 default-bold-underline ;nil gnus-group-empty ); nil nil nil ;nil type ); nil yellow nil ;nil include ); purple Plum1 bold-italic ;nil dired-marked ); purple Plum1 nil ;nil jargon-xref ); purple-bold Plum1 italic ;nil msg-from ); purple-bold green bold ;nil error ); red-bold yellow bold ;nil dired-deleted ); red-bold-italic orange bold-italic ;nil label ); red-underline orange-underlined underline (defun mbg-make-regexp2 (column) (setq lh-string (mbg-make-string column ".")) ;; (concat "^" lh-string ) ; ) ;; ------------ (defun hilit-column nil ;; ------------ ;; "This colors a buffer according to what column the point is on. Everything to the right of the point is one color, and everything to the left, another." (interactive) (prolog-mode) (setq pat (mbg-make-regexp2 (current-column))) (setq l1 (list pat nil 'decl)) (setq l2 (list l1)) (princ l2) (hilit-set-mode-patterns 'prolog-mode l2) (hilit-highlight-buffer) ) (defun mbg-toggle-hilit-buffer (arg) (interactive "p") (setq mbg-save-point (point)) (cond ((eq arg 4) (beginning-of-buffer) (setq b (point)) (end-of-buffer) (setq e (point)) (hilit-highlight-region b e)) ((eq arg 2) (hilit-highlight-region (region-beginning) (region-end))) (t (beginning-of-buffer) (setq b (point)) (end-of-buffer) (setq e (point)) (hilit-unhighlight-region b e)) ) (goto-char mbg-save-point)) ;;============================================================================= ;; * IV. Set Variables & Rebind keys ;;============================================================================= (defun mbg-hyper-smtpmail nil (cond ((file-exists-p "~/etc/emacs/smtpmail.el") (setq mail-default-reply-to "mbg@hyper.stanford.edu") (setq mail-default-headers "From: mbg@hyper.stanford.edu (Mark Gerstein) BCC: mbg10, mbg@hyper.stanford.edu ") ;; from smtpmail.el ;; Please add these lines in your .emacs(_emacs). ;; (setq send-mail-function 'smtpmail-send-it) (setq smtpmail-default-smtp-server "hyper.stanford.edu") (setq smtpmail-smtp-service "smtp") (setq smtpmail-local-domain "hyper.stanford.edu") (setq smtpmail-debug-info t) (load-library "~/etc/emacs/smtpmail.el") (setq smtpmail-code-conv-from nil) (setq user-full-name "Mark Gerstein") (setq user-mail-address "mbg@hyper.stanford.edu") (princ "smtpmail loaded with hyper settings") ) (t (princ "~/etc/emacs/smtpmail.el doesn't exist") nil) ) ) (defun mbg-yale-smtpmail nil (cond ((file-exists-p "~/etc/emacs/smtpmail.el") ;; (setq mail-default-reply-to "mbg@csb.yale.edu") ;; (setq mail-default-headers ;; "From: mbg@csb.yale.edu (Mark Gerstein) ;; BCC: mbg, mbg10@well.com ;; ") (setq mail-default-reply-to "Mark.Gerstein@Yale.edu") (setq mail-default-headers "From: Mark.Gerstein@Yale.edu BCC: Mark.Gerstein@Yale.edu ") ; mbg@pobox.com ;; from smtpmail.el ;; Please add these lines in your .emacs(_emacs). ;; (setq send-mail-function 'smtpmail-send-it) (setq smtpmail-default-smtp-server "csbmet.csb.yale.edu") (setq smtpmail-smtp-service "smtp") (setq smtpmail-local-domain "csb.yale.edu") (setq smtpmail-debug-info t) (load-library "~/etc/emacs/smtpmail.el") (setq smtpmail-code-conv-from nil) (setq user-full-name "Mark Gerstein") ; (setq user-mail-address "mbg@csb.yale.edu") (setq user-mail-address "mark.gerstein@yale.edu") (princ "smtpmail loaded with yale settings") ) (t (princ "~/etc/emacs/smtpmail.el doesn't exist") nil) ) ) (defun mbg-well-smtpmail nil (cond ((file-exists-p "~/etc/emacs/smtpmail.el") (setq mail-default-reply-to "mbg10@well.com") (setq mail-default-headers "From: mbg10@well.com BCC: mbg10, mbg@hyper.stanford.edu ") ;; from smtpmail.el ;; Please add these lines in your .emacs(_emacs). ;; (setq send-mail-function 'smtpmail-send-it) (setq smtpmail-default-smtp-server "camis.stanford.edu") (setq smtpmail-smtp-service "smtp") (setq smtpmail-local-domain nil) (setq smtpmail-debug-info t) (load-library "~/etc/emacs/smtpmail.el") (setq smtpmail-code-conv-from nil) (setq user-full-name "Mark Gerstein") (setq user-mail-address "mbg10@well.com") (princ "smtpmail loaded with well settings") ) (t (princ "~/etc/emacs/smtpmail.el doesn't exist") ; nil) ) ) (defun mbg-load-cperl nil (cond ((file-exists-p "~/etc/emacs/cperl-mode.elc") (load "~/etc/emacs/cperl-mode.elc") ;;; To use this mode put the following into your .emacs file: (autoload 'perl-mode "cperl-mode" "alternate mode for editing Perl programs" t) ;;; You can either fine-tune the bells and whistles of this mode or ;;; bulk enable them by putting ;; (setq cperl-hairy t) ;;; in your .emacs file. (Emacs rulers do not consider it politically ;;; correct to make whistles enabled by default.) ;;; Additional useful commands to put into your .emacs file: (setq auto-mode-alist (append '(("\\.[pP][Llm]$" . perl-mode)) auto-mode-alist )) (setq interpreter-mode-alist (append interpreter-mode-alist '(("miniperl" . perl-mode)))) t ) (t (princ "~/etc/emacs/cperl-mode.el doesn't exist") nil) ) ) (defun do-for-all nil ; (setq auto-mode-alist (cons '("\.pl$" . perl-mode) auto-mode-alist)) (setq default-truncate-lines t) ; doesn't wrap with \ (setq visible-bell t) (setq auto-save-list-file-prefix "~/etc/emacs/save/S-") ; (setq mail-default-reply-to "mbg@hyper.stanford.edu") ; (setq mail-default-headers ; "From: mbg@hyper.stanford.edu (Mark Gerstein) ; BCC: mbg10, mbg@hyper.stanford.edu ; ") ; (setq mail-self-blind t) ; BCCs mail back to me (setq c-macro-default-cppflags "-I/hosts/cb-iris/usr2/people/mbg/util") (put 'downcase-region 'disabled nil) (put 'upcase-region 'disabled nil) (put 'eval-expression 'disabled nil) (put 'narrow-to-region 'disabled nil) (line-number-mode 1) (require 'uncompress) ) (defun config-nt nil (setq exec-path (cons (expand-file-name "d:/emacs/bin") exec-path )) (setq load-path (cons (expand-file-name "d:/emacs/elisp") load-path )) ;; from smtpmail.el ;; Please add these lines in your .emacs(_emacs). ;; (setq send-mail-function 'smtpmail-send-it) (setq smtpmail-default-smtp-server "hyper.stanford.edu") (setq smtpmail-smtp-service "smtp") (setq smtpmail-local-domain nil) (setq smtpmail-debug-info t) (load-library "smtpmail") (setq smtpmail-code-conv-from nil) (setq user-full-name "Mark Gerstein") (setq user-mail-address "mbg@hyper.stanford.edu") ) ;;; (2) Save this file as feedmail.el somewhere on your elisp ;;; loadpath; byte-compile it. Put the following lines somewhere in ;;; your ~/.emacs stuff: ;;; ;;; (setq send-mail-function 'feedmail-send-it) ;;; (autoload 'feedmail-send-it "feedmail") ;;; (autoload 'feedmail-run-the-queue "feedmail") ;;; (defun setup-feedmail nil "sets up feedmail" (interactive) (setq load-path (cons (expand-file-name "c:/etc/emacs") load-path )) (setq send-mail-function 'feedmail-send-it) (autoload 'feedmail-send-it "feedmail") (autoload 'feedmail-run-the-queue "feedmail") (setq feedmail-buffer-eating-function 'feedmail-buffer-to-smtpmail) ; "*Function used to send the prepped buffer to a subprocess. The function's three (mandatory) arguments are: (1) the buffer containing the prepped message; (2) a buffer where errors should be directed; and (3) a string containing the space-separated list of simplified addresses. Two popular choices for this are 'feedmail-buffer-to-binmail and 'feedmail-buffer-to-sendmail. If you use the sendmail form, you probably want to set feedmail-nuke-bcc to nil. If you use the binmail form, check the value of feedmail-binmail-template.") (setq feedmail-queue-chatty t) ; optional (setq feedmail-confirm-outgoing t) ; "*If non-nil, gives a y-or-n confirmation prompt after prepping, before sending mail.") (setq feedmail-from-line "Mark.Gerstein@Yale.edu") ; "*If non-nil and the email has no FROM: header, one will be forced with this as its contents. A good value would be a fully-qualified domain name form of your address. For example, bill@att.com. (The default value of this variable is probably not very good, since it doesn't have a domain part.) Don't include a trailing newline or the keyword FROM:. They're automatically provided.") (setq feedmail-enable-queue t) ; "*If non-nil, provides for stashing outgoing messages in a disk-based queue for later transmission. The messages are queued in their raw state as they appear in the mail-mode buffer and can be arbitrarily edited before sending by visiting the appropriate file in the queue directory (and setting the buffer to mail-mode or whatever). If you visit a file in the queue directory and try to queue it again, it will just get saved in its existing file name. Queuing is quite handy for laptop-based users. It's also handy if you get a lot of mail and process it more or less sequentially (you might change your mind about contents of a reply based on a message you see a bit later). To transmit all the messages in the queue, invoke command feedmail-run-the-queue.") (setq feedmail-nuke-bcc nil) ; "*Non-nil means get rid of the BCC: lines from the message header text before sending the mail. In any case, the BCC: lines do participate in the composed address list. You probably want to keep them if you're using sendmail (see feedmail-buffer-eating-function).") (cond ( (file-exists-p "z:\\dos\\etc\\q") (setq feedmail-queue-directory "z:\\dos\\etc\\q")) ; "*Name of an directory where messages will be queued. Directory will be created if necessary. Should be a string that doesn't end with a slash. Default is \"$HOME/mail/q\".") ( (file-exists-p "~/etc/q") (setq feedmail-queue-directory "~/etc/q")) ; "*Name of an directory where messages will be queued. Directory will be created if necessary. Should be a string that doesn't end with a slash. Default is \"$HOME/mail/q\".") (t (setq feedmail-queue-directory "~/")) ; "*Name of an directory where messages will be queued. Directory will be created if necessary. Should be a string that doesn't end with a slash. Default is \"$HOME/mail/q\".") ) ;; use the message function as opposed to princ to show a message ;; on the bottom of the screen and in the message buffer (message (concat "feedmail-queue-directory = " feedmail-queue-directory)) ;; ;; The following function is only defined if setup-feedmail is called ;; (defun make-auto-save-file-name () "Return file name to use for auto-saves of current buffer. Does not consider `auto-save-visited-file-name' as that variable is checked before calling this function. This version stores all auto-save files in the same local directory. This is to avoid trying to save files over a dial-up connection (which may not be active). See also `auto-save-file-name-p'." (if buffer-file-name (if (and (eq system-type 'ms-dos) (not (msdos-long-file-names))) (let ((fn (file-name-nondirectory buffer-file-name))) (string-match "\\`\\([^.]+\\)\\(\\.\\(..?\\)?.?\\|\\)\\'" fn) (concat (expand-file-name "~/etc/emacs/save/") "#" (match-string 1 fn) "." (match-string 3 fn) "#")) (concat (expand-file-name "~/etc/emacs/save/") "#" (file-name-nondirectory buffer-file-name) "#" (make-temp-name ""))) ;; Deal with buffers that don't have any associated files. (Mail ;; mode tends to create a good number of these.) (let ((buf-name (buffer-name)) (limit 0)) ;; Use technique from Sebastian Kremer's auto-save ;; package to turn slashes into \\!. This ensures that ;; the auto-save buffer name is unique. (while (string-match "[/\\*?':]" buf-name limit) (message "%s" buf-name) (setq buf-name (concat (substring buf-name 0 (match-beginning 0)) (if (string= (substring buf-name (match-beginning 0) (match-end 0)) "/") "\\!" (if (string= (substring buf-name (match-beginning 0) (match-end 0)) "\\\\") "\\\\" "__")) (substring buf-name (match-end 0)))) (setq limit (1+ (match-end 0)))) (expand-file-name (format "~/etc/emacs/save/#%s#%s#" buf-name (make-temp-name "")))))) ) (defun mbg-default-colors nil (cond (window-system (setq hilit-mode-enable-list '(not text-mode) hilit-background-mode 'dark hilit-inhibit-hooks nil hilit-inhibit-rebinding nil) (require 'hilit19) (set-background-color "black") (set-foreground-color "green") (set-cursor-color "red") (set-mouse-color "yellow")))) (defun mbg-light-colors nil (cond (window-system (setq hilit-mode-enable-list '(not text-mode) hilit-background-mode 'light hilit-inhibit-hooks nil hilit-inhibit-rebinding nil) (require 'hilit19) (set-background-color "light gray") ; ;; (set-background-color "white") (set-foreground-color "black") (set-cursor-color "red") (set-mouse-color "red")))) (defun config-win95 nil (mbg-default-colors) (mbg-load-cperl) ;(mbg-hyper-smtpmail) (mbg-yale-smtpmail) (setup-feedmail) (global-set-key [f1] 'compile) ; doesn't work!! (message "emacs configuration is win95/NT" ) ;; ;; specific to win95 ;; (load "~/etc/emacs/ange-ftp.el") (setq ange-ftp-ftp-program-name "c:/freeware/bin/nftp.exe") (setq ange-ftp-tmp-name-template (concat (expand-file-name (getenv "TEMP")) "/ange-ftp")) (setq ange-ftp-gateway-tmp-name-template (concat (expand-file-name (getenv "TEMP")) "/ange-ftp")) (cd "~/") ) (defun config-i386-linux nil (mbg-light-colors) (set-frame-size (selected-frame) 100 60) (set-frame-position (selected-frame) 5 20) ; 0 0 for no title bar (set-default-font "9x15bold") ; or 7x13bold ;;; (load-library "~/el/rmail.el") (mbg-load-cperl) (mbg-hyper-smtpmail) (global-set-key [f1] 'compile) ; doesn't work!! (princ "i386-linux" ) ) (defun sgi-emacs19 nil (cond (window-system (setq hilit-mode-enable-list '(not text-mode) hilit-background-mode 'dark hilit-inhibit-hooks nil hilit-inhibit-rebinding nil) (require 'hilit19) (mbg-load-cperl) ;;(load-library "~/el/rmail.el") (global-set-key [f1] 'compile) (global-set-key [f2] 'next-error) (global-set-key [f3] 'kill-rectangle) ; saves last kill (global-set-key [f4] 'yank-rectangle) ; yanks last kill (global-set-key [f5] 'append-whole-buffer) (global-set-key [f6] 'mbg-enlarge-window) (global-set-key [f7] 'mbg-set-font) (global-set-key [f8] 'electric-buffer-list) (global-set-key [f9] 'command-history-mode) (global-set-key [f10] 'goto-line) (global-set-key [f11] 'arrow-indent-region) ) )) (do-for-all) (cond ((equal (getenv "HOSTTYPE") "i386-linux") (config-i386-linux)) ((equal (getenv "HOSTTYPE") "i486-linux") (config-i386-linux)) ((equal (getenv "CONFIG") "MOBILE") (config-win95)) ;; ((equal (getenv "HOSTTYPE") "NT") ;; (config-nt))) ((equal (getenv "OS") "Windows_NT") (config-win95)) ) ;; (yow) ;; (server-start)