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