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