]> git.donarmstrong.com Git - home-base.git/blob - .emacs
update debian known hosts
[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  '(font-latex-fontify-script nil)
18  '(font-latex-fontify-sectioning (quote color))
19  '(font-latex-script-display (quote (nil)))
20  '(global-auto-revert-mode t)
21  '(global-font-lock-mode t nil (font-lock))
22  '(global-set-key "\347" t)
23  '(iswitchb-mode t)
24  '(iswitchb-prompt-newbuffer nil)
25  '(log-edit-keep-buffer t)
26  '(mail-user-agent (quote sendmail-user-agent))
27  '(mutt-alias-file-list (quote ("~/.mutt/aliases" "~/.mail_aliases")))
28  '(org-agenda-files (quote ("~/projects/debbugs/notes.org" "~/projects/notes/notes.org" "~/projects/origins_of_life/paper/figure_list.org" "~/projects/origins_of_life/ool.org" "~/projects/sysadmin/sndservers/sndservers.org" "~/projects/chaim/chaim.org" "~/projects/fh/fh.org" "~/projects/notes/library_books.org")))
29  '(post-email-address "don@donarmstrong.com")
30  '(post-kill-quoted-sig nil)
31  '(post-mail-message "mutt\\(ng\\|\\)-[a-z0-9]+-[0-9]+-.*")
32  '(post-uses-fill-mode nil)
33  '(ps-footer-font-size (quote (8 . 10)))
34  '(ps-header-font-size (quote (8 . 10)))
35  '(ps-header-title-font-size (quote (10 . 10)))
36  '(ps-line-number-color "blue")
37  '(ps-print-footer t)
38  '(ps-print-footer-frame nil)
39  '(ps-print-only-one-header t)
40  '(safe-local-variable-values (quote ((auto-save-default) (make-backup-files))))
41  '(sentence-end "[.?!][]\"')]*\\($\\|   \\| \\)[        
42 ]*")
43  '(sentence-end-double-space nil)
44  '(show-paren-mode t)
45  '(tool-bar-mode nil nil (tool-bar))
46  '(user-mail-address "don@donarmstrong.com")
47  '(vc-delete-logbuf-window nil)
48  '(vc-follow-symlinks t))
49 (fset 'perl-mode 'cperl-mode)
50 ;;(load-file "cperl-mode.el")
51 (add-to-list 'load-path '"~/lib/emacs_el/")
52 (add-to-list 'load-path '"~/lib/emacs_el/tiny-tools/tiny")
53 (add-to-list 'load-path '"~/lib/emacs_el/tiny-tools/other")
54 ;;(add-to-list 'Tex-style-path '"~/lib/emacs_el/auctex/")
55
56 (require 'tiny-setup)
57 (require 'tinyprocmail)
58
59 (require 'tex-site)
60 ;;(require 'psvn)
61 (require 'cperl-mode)
62 ;;(require 'ecasound)
63 ;;(require 'emacs-wiki)
64 (require 'bibtex)
65 (require 'post)
66 ;;(require 'fixme)
67 (require 'google-weather)
68 (require 'org-google-weather)
69 (setq org-google-weather-format "%i %c, [%l,%h] %s %C")
70
71
72 (global-set-key "\C-xp" 'server-edit)
73
74 (setq auto-mode-alist (cons '("\.wml$" . 
75                               (lambda () (html-mode) (auto-fill-mode)))
76                             auto-mode-alist))
77
78 ;; Use c-mode for perl .xs files
79 (add-to-list 'auto-mode-alist '("\\.xs\\'" . c-mode))
80 (add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\)\\'" . cperl-mode))
81 (add-to-list 'interpreter-mode-alist '("perl" . cperl-mode))
82 (add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode))
83 (add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode))
84
85 (add-to-list 'auto-mode-alist '("muttng-[a-z0-9]+-[0-9]+-" . post-mode))
86 (add-to-list 'auto-mode-alist '("muttngrc" . muttrc-mode))
87
88 (add-to-list 'auto-mode-alist '("mutt-[a-z0-9]+-[0-9]+-" . post-mode))
89 (add-to-list 'auto-mode-alist '("muttrc" . muttrc-mode))
90
91 (add-to-list 'auto-mode-alist '("\\.mdwn$" . markdown-mode))
92
93
94
95 (global-unset-key "\M-g")
96 (global-set-key "\M-g" 'goto-line)
97
98 ;;(autoload 'perl-mode "cperl-mode"
99 ;;  "alternate mode for editing Perl programs" t)
100
101 ;; self-insert-command hack.
102 ;;   Without this, "if<SP>" expands to
103 ;;   if ( -!-) {
104 ;;   }
105 ;;   which really should be,
106 ;;   if (-!-) {
107 ;;   }
108 (setq cperl-hairy t
109       cperl-indent-level 4
110 ;;      cperl-auto-newline t
111 ;;      cperl-auto-newline-after-colon t
112       cperl-continued-statement-offset 4
113       cperl-brace-offset -4
114       cperl-label-offset -4
115       cperl-highlight-variables-indiscriminately t
116       cperl-electric-lbrace-space nil
117       )
118 (add-hook 'cperl-mode-hook (lambda () (cperl-set-style "PerlStyle")))
119
120
121
122 ;(load-library "php-mode")
123
124 (setq c-indent-level 8)
125 (setq c-brace-imaginary-offset 0)
126 (setq c-brace-offset -8)
127 (setq c-argdecl-indent 8)
128 (setq c-label-offset -8)
129 (setq c-continued-statement-offset 8)
130 (setq indent-tabs-mode nil)
131 (setq tab-width 8)
132
133
134 ;; (autoload 'php-mode "php-mode" "PHP editing mode" t)
135 ;; (add-to-list 'auto-mode-alist '("\\.php3?\\'" . php-mode))
136 ;; (add-to-list 'auto-mode-alist '("\\.phtml?\\'" . php-mode))
137 ;; (add-to-list 'auto-mode-alist '("\\.php?\\'" . php-mode))
138 ;; (add-to-list 'auto-mode-alist '("\\.php4?\\'" . php-mode))
139
140 ;; REFTEX (much enhanced management of cross-ref, labels, etc)
141 ;; http://www.strw.leidenuniv.nl/~dominik/Tools/reftex/
142 (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
143 (autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
144 (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
145 (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
146 (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
147 (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
148 (add-hook 'LaTeX-mode-hook 'outline-minor-mode)   ; with AUCTeX LaTeX mode
149 (add-hook 'latex-mode-hook 'outline-minor-mode)   ; with Emacs latex mode
150
151 ;; (TeX-add-style-hook
152 ;;  "latex"
153 ;;  (lambda ()
154 ;;    (TeX-add-symbols
155 ;;     '("DLA" 1))))
156 ;; (custom-set-variables
157 ;;  '(font-latex-user-keyword-classes 
158 ;;    '(("fixme" 
159 ;;       ("DLA" "RZ")
160 ;;       font-lock-function-name-face 2 (command 1 t))))
161 ;; ) 
162
163 (require 'font-latex)
164 (add-to-list 'font-latex-match-reference-keywords "fref")
165 (add-to-list 'font-latex-match-reference-keywords "Fref")
166 (add-to-list 'font-latex-match-reference-keywords "citep")
167 (add-to-list 'font-latex-match-reference-keywords "citet")
168 (font-latex-match-reference-make)
169 (add-to-list 'font-latex-match-function-keywords "DLA")
170 (add-to-list 'font-latex-match-function-keywords "RZ")
171 (add-to-list 'font-latex-match-function-keywords "OM")
172 (add-to-list 'font-latex-match-function-keywords "DL")
173 (add-to-list 'font-latex-match-function-keywords "fixme")
174 (add-to-list 'font-latex-match-function-keywords "acs")
175 (add-to-list 'font-latex-match-function-keywords "acsp")
176 (add-to-list 'font-latex-match-function-keywords "ac")
177 (add-to-list 'font-latex-match-function-keywords "acp")
178 (add-to-list 'font-latex-match-function-keywords "acl")
179 (add-to-list 'font-latex-match-function-keywords "aclp")
180 (add-to-list 'font-latex-match-function-keywords "acsu")
181 (add-to-list 'font-latex-match-function-keywords "aclu")
182 (add-to-list 'font-latex-match-function-keywords "acused")
183 (font-latex-match-function-make)
184 (setq TeX-parse-self t)
185 (setq TeX-auto-save t)
186 (setq-default TeX-master nil)
187
188 (defun insert-date ()
189   "Insert date at point."
190   (interactive)
191   (insert (format-time-string "%A, %B %e, %Y %k:%M:%S %Z")))
192 (global-set-key "\C-[d" 'insert-date)
193
194 (defun unfill-paragraph (arg)
195   "Pull this whole paragraph up onto one line."
196   (interactive "*p")
197   (let ((fill-column 10000))
198     (fill-paragraph arg))
199   )
200
201 ;(iswitchb-default-keybindings)
202
203 (column-number-mode t)
204 (setq reftex-plug-into-AUCTeX t)
205
206 (server-start)
207
208 (require 'mode-compile)
209
210 (setq reftex-default-bibliography
211       '("references.bib"))
212
213 (defadvice server-process-filter (after post-mode-message first activate)
214   "If the buffer is in post mode, overwrite the server-edit
215     message with a post-save-current-buffer-and-exit message."
216   (if (eq major-mode 'post-mode)
217       (message
218        (substitute-command-keys "Type \\[describe-mode] for help composing; \\[post-save-current-buffer-and-exit] when done."))))
219                                         ; This is also needed to see the magic message.  Set to a higher
220                                         ; number if you have a faster computer or read slower than me.
221 '(font-lock-verbose 1000)
222 ;(setq server-temp-file-regexp "mutt\(-\|ng-\)")
223 ; (add-hook 'server-switch-hook 
224 ;         (function (lambda()
225 ;                     (cond ((string-match "Post" mode-name)
226 ;                            (post-goto-body)))
227 ;                     set-buffer-file-coding-system 'utf-8
228 ;                     )))
229
230
231 (add-hook 'post-mode-hook
232           (auto-fill-mode nil)
233           )
234
235 (fset 'insert-function-documentation
236    [?\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])
237 (global-set-key "\M-f" 'insert-function-documentation)
238
239 (eval-after-load "lilypond-mode" 
240   '(progn
241      (load-library "lyqi-mode")
242      (define-key LilyPond-mode-map "\C-cq" 'lyqi-mode)))
243
244 (autoload 'spamassassin-mode "spamassassin-mode" nil t)
245
246 (desktop-load-default)
247 (desktop-read)
248 '(iswitchb-mode on)
249 (custom-set-faces
250   ;; custom-set-faces was added by Custom.
251   ;; If you edit it by hand, you could mess it up, so be careful.
252   ;; Your init file should contain only one such instance.
253   ;; If there is more than one, they won't work right.
254  '(menu ((((type x-toolkit)) (:background "black" :foreground "grey90")))))
255
256 (defun ess-change-directory (path)
257   "Set the current working directory to PATH for both *R* and Emacs."
258   (interactive "DDirectory to change to: ")
259
260   (when (file-exists-p path)
261     (ess-command (concat "setwd(\"" path "\")\n"))
262     ;; use file-name-as-directory to ensure it has trailing /
263     (setq default-directory (file-name-as-directory path))))
264
265 (put 'upcase-region 'disabled nil)
266
267 (put 'downcase-region 'disabled nil)
268
269 ;; The following lines are always needed. Choose your own keys.
270 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
271 (add-hook 'org-mode-hook 'turn-on-font-lock) ; not needed when global-font-lock-mode is on
272 (global-set-key "\C-cl" 'org-store-link)
273 (global-set-key "\C-ca" 'org-agenda)
274 (global-set-key "\C-cb" 'org-iswitchb)
275 (setq org-log-done 'time)
276 (setq org-log-done 'note)
277 (setq org-agenda-ndays 5)
278
279
280 (autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t)
281 (add-hook 'message-mode-hook 'turn-on-flyspell)
282 (add-hook 'text-mode-hook 'turn-on-flyspell)
283 (add-hook 'c-mode-common-hook 'flyspell-prog-mode)
284 (add-hook 'cperl-mode-hook 'flyspell-prog-mode)
285 (add-hook 'tcl-mode-hook 'flyspell-prog-mode)
286 (add-hook 'ess-mode-hook 'flyspell-prog-mode)
287 (defun turn-on-flyspell ()
288    "Force flyspell-mode on using a positive arg.  For use in hooks."
289    (interactive)
290    (flyspell-mode 1))
291
292 ;;; outlining support for ess modes
293 (add-hook 'ess-mode-hook
294           '(lambda ()
295              (outline-minor-mode)
296              (setq outline-regexp "\\(^#\\{4,5\\} \\)\\|\\(^[a-zA-Z0-9_\.]+ ?<- ?function(.*{\\)")
297              (defun outline-level
298                (lambda () (interactive) (cond ((looking-at "^##### ") 1)((looking-at "^#### ") 2)((looking-at "^[a-zA-Z0-9_\.]+ ?<- ?function(.*{") 3) (t 1000)))
299                )))
300
301 (defun my-org-mode-setup ()
302  (when (and (buffer-file-name)
303             (file-exists-p (buffer-file-name)))
304   (load-library "reftex")
305   (and (buffer-file-name)
306         (file-exists-p (buffer-file-name))
307         (reftex-parse-all))
308    (reftex-set-cite-format
309      '((?b . "[[bib::%l]]")
310        (?n . "[[note::%l]]"))))
311    (define-key org-mode-map "\C-c\C-g" 'reftex-citation)
312 )
313 (add-hook 'org-mode-hook 'my-org-mode-setup)