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