]> git.donarmstrong.com Git - home-base.git/blob - .emacs
* add /var/list/.bin if we're running on liszt
[home-base.git] / .emacs
1 (custom-set-variables
2   ;; custom-set-variables was added by Custom.
3   ;; If you edit it by hand, you could mess it up, so be careful.
4   ;; Your init file should contain only one such instance.
5   ;; If there is more than one, they won't work right.
6  '(bibtex-user-optional-fields (quote (("annote" "Personal annotation (ignored)") ("abstract" "") ("pmid" "") ("doi" ""))))
7  '(calendar-latitude [33 57 north])
8  '(calendar-longitude [117 24 west])
9  '(case-fold-search t)
10  '(confirm-kill-emacs (quote y-or-n-p))
11  '(cperl-lazy-help-time nil)
12  '(debian-changelog-mailing-address "don@debian.org")
13  '(display-time t)
14  '(display-time-24hr-format t)
15  '(display-time-day-and-date t)
16  '(display-time-mode t)
17  '(global-auto-revert-mode t)
18  '(global-font-lock-mode t nil (font-lock))
19  '(global-set-key "\347" t)
20  '(iswitchb-mode t)
21  '(iswitchb-prompt-newbuffer nil)
22  '(mail-user-agent (quote sendmail-user-agent))
23  '(mutt-alias-file-list (quote ("~/.mutt/aliases" "~/.mail_aliases")))
24  '(post-email-address "don@donarmstrong.com")
25  '(post-kill-quoted-sig nil)
26  '(post-mail-message "mutt\\(ng\\|\\)-[a-z0-9]+-[0-9]+-.*")
27  '(post-uses-fill-mode nil)
28  '(ps-footer-font-size (quote (8 . 10)))
29  '(ps-header-font-size (quote (8 . 10)))
30  '(ps-header-title-font-size (quote (10 . 10)))
31  '(ps-line-number-color "blue")
32  '(ps-print-footer t)
33  '(ps-print-footer-frame nil)
34  '(ps-print-only-one-header t)
35  '(sentence-end "[.?!][]\"')]*\\($\\|   \\| \\)[        
36 ]*")
37  '(sentence-end-double-space nil)
38  '(show-paren-mode t)
39  '(tool-bar-mode nil nil (tool-bar))
40  '(user-mail-address "don@donarmstrong.com"))
41 (fset 'perl-mode 'cperl-mode)
42 ;;(load-file "cperl-mode.el")
43 (add-to-list 'load-path '"~/lib/emacs_el/")
44 (add-to-list 'load-path '"~/lib/emacs_el/tiny-tools/tiny")
45 (add-to-list 'load-path '"~/lib/emacs_el/tiny-tools/other")
46 ;;(add-to-list 'Tex-style-path '"~/lib/emacs_el/auctex/")
47
48 (require 'tiny-setup)
49 (require 'tinyprocmail)
50
51 (require 'tex-site)
52 (require 'psvn)
53 (require 'cperl-mode)
54 ;;(require 'ecasound)
55 ;;(require 'emacs-wiki)
56 (require 'bibtex)
57 (require 'post)
58 ;;(require 'fixme)
59
60 (global-set-key "\C-xp" 'gnuserv-edit)
61
62 (setq auto-mode-alist (cons '("\.wml$" . 
63                               (lambda () (html-mode) (auto-fill-mode)))
64                             auto-mode-alist))
65
66 ;; Use c-mode for perl .xs files
67 (add-to-list 'auto-mode-alist '("\\.xs\\'" . c-mode))
68 (add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\)\\'" . cperl-mode))
69 (add-to-list 'interpreter-mode-alist '("perl" . cperl-mode))
70 (add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode))
71 (add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode))
72
73 (add-to-list 'auto-mode-alist '("muttng-[a-z0-9]+-[0-9]+-" . post-mode))
74 (add-to-list 'auto-mode-alist '("muttngrc" . muttrc-mode))
75
76 (add-to-list 'auto-mode-alist '("mutt-[a-z0-9]+-[0-9]+-" . post-mode))
77 (add-to-list 'auto-mode-alist '("muttrc" . muttrc-mode))
78
79
80 (global-unset-key "\M-g")
81 (global-set-key "\M-g" 'goto-line)
82
83 ;;(autoload 'perl-mode "cperl-mode"
84 ;;  "alternate mode for editing Perl programs" t)
85
86 ;; self-insert-command hack.
87 ;;   Without this, "if<SP>" expands to
88 ;;   if ( -!-) {
89 ;;   }
90 ;;   which really should be,
91 ;;   if (-!-) {
92 ;;   }
93 (setq cperl-hairy t
94       cperl-indent-level 4
95 ;;      cperl-auto-newline t
96 ;;      cperl-auto-newline-after-colon t
97       cperl-continued-statement-offset 4
98       cperl-brace-offset -4
99       cperl-label-offset -4
100       cperl-highlight-variables-indiscriminately t
101       cperl-electric-lbrace-space nil
102       )
103 (add-hook 'cperl-mode-hook (lambda () (cperl-set-style "PerlStyle")))
104
105
106
107 ;(load-library "php-mode")
108
109 (setq c-indent-level 8)
110 (setq c-brace-imaginary-offset 0)
111 (setq c-brace-offset -8)
112 (setq c-argdecl-indent 8)
113 (setq c-label-offset -8)
114 (setq c-continued-statement-offset 8)
115 (setq indent-tabs-mode nil)
116 (setq tab-width 8)
117
118
119 ;; (autoload 'php-mode "php-mode" "PHP editing mode" t)
120 ;; (add-to-list 'auto-mode-alist '("\\.php3?\\'" . php-mode))
121 ;; (add-to-list 'auto-mode-alist '("\\.phtml?\\'" . php-mode))
122 ;; (add-to-list 'auto-mode-alist '("\\.php?\\'" . php-mode))
123 ;; (add-to-list 'auto-mode-alist '("\\.php4?\\'" . php-mode))
124
125 ;; REFTEX (much enhanced management of cross-ref, labels, etc)
126 ;; http://www.strw.leidenuniv.nl/~dominik/Tools/reftex/
127 (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
128 (autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
129 (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
130 (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
131 (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
132 (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
133 (add-hook 'LaTeX-mode-hook 'outline-minor-mode)   ; with AUCTeX LaTeX mode
134 (add-hook 'latex-mode-hook 'outline-minor-mode)   ; with Emacs latex mode
135
136 ;; (TeX-add-style-hook
137 ;;  "latex"
138 ;;  (lambda ()
139 ;;    (TeX-add-symbols
140 ;;     '("DLA" 1))))
141 ;; (custom-set-variables
142 ;;  '(font-latex-user-keyword-classes 
143 ;;    '(("fixme" 
144 ;;       ("DLA" "RZ")
145 ;;       font-lock-function-name-face 2 (command 1 t))))
146 ;; ) 
147
148 (require 'font-latex)
149 (add-to-list 'font-latex-match-reference-keywords "fref")
150 (add-to-list 'font-latex-match-reference-keywords "Fref")
151 (add-to-list 'font-latex-match-reference-keywords "citep")
152 (add-to-list 'font-latex-match-reference-keywords "citet")
153 (font-latex-match-reference-make)
154 (add-to-list 'font-latex-match-function-keywords "DLA")
155 (add-to-list 'font-latex-match-function-keywords "RZ")
156 (add-to-list 'font-latex-match-function-keywords "fixme")
157 (add-to-list 'font-latex-match-function-keywords "acs")
158 (add-to-list 'font-latex-match-function-keywords "acsp")
159 (add-to-list 'font-latex-match-function-keywords "ac")
160 (add-to-list 'font-latex-match-function-keywords "acp")
161 (add-to-list 'font-latex-match-function-keywords "acl")
162 (add-to-list 'font-latex-match-function-keywords "aclp")
163 (add-to-list 'font-latex-match-function-keywords "acsu")
164 (add-to-list 'font-latex-match-function-keywords "aclu")
165 (add-to-list 'font-latex-match-function-keywords "acused")
166 (font-latex-match-function-make)
167 (setq TeX-parse-self t)
168 (setq TeX-auto-save t)
169 (setq-default TeX-master nil)
170
171 (defun insert-date ()
172   "Insert date at point."
173   (interactive)
174   (insert (format-time-string "%A, %B %e, %Y %k:%M:%S %Z")))
175 (global-set-key "\C-[d" 'insert-date)
176
177 (defun unfill-paragraph (arg)
178   "Pull this whole paragraph up onto one line."
179   (interactive "*p")
180   (let ((fill-column 10000))
181     (fill-paragraph arg))
182   )
183
184 ;(iswitchb-default-keybindings)
185
186 (column-number-mode t)
187 (setq reftex-plug-into-AUCTeX t)
188
189 (gnuserv-start)
190
191 (require 'mode-compile)
192
193 (defadvice server-process-filter (after post-mode-message first activate)
194   "If the buffer is in post mode, overwrite the server-edit
195     message with a post-save-current-buffer-and-exit message."
196   (if (eq major-mode 'post-mode)
197       (message
198        (substitute-command-keys "Type \\[describe-mode] for help composing; \\[post-save-current-buffer-and-exit] when done."))))
199                                         ; This is also needed to see the magic message.  Set to a higher
200                                         ; number if you have a faster computer or read slower than me.
201 '(font-lock-verbose 1000)
202 ;(setq server-temp-file-regexp "mutt\(-\|ng-\)")
203 (add-hook 'server-switch-hook 
204           (function (lambda()
205                       (cond ((string-match "Post" mode-name)
206                              (post-goto-body)))
207                       set-buffer-file-coding-system 'utf-8
208                       )))
209
210
211 (add-hook 'post-mode-hook
212           (auto-fill-mode nil)
213           )
214
215 (fset 'insert-function-documentation
216    [?\C-x ?i home ?\C-k ?/ ?h ?o ?m ?e ?/ ?d ?o ?n ?/ ?l ?i ?b ?/ ?t ?e ?m ?p ?l ?a ?t ?e ?s ?/ ?p ?e ?r ?l ?_ ?f ?u ?n ?c ?t ?i ?o ?n ?_ ?d ?o ?c ?u ?m ?e ?n ?t ?a ?t ?i ?o ?n return])
217 (global-set-key "\M-f" 'insert-function-documentation)
218
219 (eval-after-load "lilypond-mode" 
220   '(progn
221      (load-library "lyqi-mode")
222      (define-key LilyPond-mode-map "\C-cq" 'lyqi-mode)))
223
224 (desktop-load-default)
225 (desktop-read)
226 '(iswitchb-mode on)
227 (custom-set-faces
228   ;; custom-set-faces was added by Custom.
229   ;; If you edit it by hand, you could mess it up, so be careful.
230   ;; Your init file should contain only one such instance.
231   ;; If there is more than one, they won't work right.
232  )
233
234 (defun ess-change-directory (path)
235   "Set the current working directory to PATH for both *R* and Emacs."
236   (interactive "DDirectory to change to: ")
237
238   (when (file-exists-p path)
239     (ess-command (concat "setwd(\"" path "\")\n"))
240     ;; use file-name-as-directory to ensure it has trailing /
241     (setq default-directory (file-name-as-directory path))))
242
243 (put 'upcase-region 'disabled nil)
244
245 (put 'downcase-region 'disabled nil)