3 # if for some reason, things get pear-shaped, we want to be able to
4 # enter the debugger by sending -USR2 to emacs
6 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
7 (setq debug-on-event 'siguser2)
11 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
12 (add-to-list 'load-path '"~/lib/emacs_el/")
13 (add-to-list 'load-path '"~/lib/emacs_el/helm")
14 (add-to-list 'load-path '"~/lib/emacs_el/tiny-tools/lisp/tiny")
15 (add-to-list 'load-path '"~/lib/emacs_el/tiny-tools/lisp/other")
16 (add-to-list 'load-path '"~/lib/emacs_el/auctex/lisp")
17 (add-to-list 'load-path '"~/lib/emacs_el/auctex")
18 (add-to-list 'load-path '"~/lib/emacs_el/ESS/lisp")
19 (add-to-list 'load-path '"~/lib/emacs_el/org-mode/lisp")
20 (add-to-list 'load-path '"~/lib/emacs_el/auctex-beamer")
21 (add-to-list 'load-path '"~/lib/emacs_el/magit-annex")
22 (add-to-list 'load-path '"~/lib/emacs_el/polymode")
28 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
29 ;; From http://www.emacswiki.org/emacs/LoadingLispFiles
30 ;; execute conditional code when loading libraries
31 (defmacro with-library (symbol &rest body)
32 `(when (require ,symbol nil t)
34 (put 'with-library 'lisp-indent-function 1)
42 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
44 (with-library 'tinyprocmail
45 ; (setq tinyprocmail--procmail-version "v3.22")
46 (add-hook 'tinyprocmail--load-hook 'tinyprocmail-install))
50 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
51 ; don't verify where we are pushing
52 (setq magit-push-always-verify nil)
56 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
58 ;; Use c-mode for perl .xs files
59 (add-to-list 'auto-mode-alist '("\\.xs\\'" . c-mode))
60 (add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\)\\'" . cperl-mode))
61 (add-to-list 'interpreter-mode-alist '("perl" . cperl-mode))
62 (add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode))
63 (add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode))
66 cperl-auto-newline nil
67 cperl-auto-newline-after-colon nil
68 cperl-continued-statement-offset 4
70 cperl-continued-brace-offset 0
72 cperl-highlight-variables-indiscriminately t
73 cperl-electric-lbrace-space nil
74 cperl-indent-parens-as-block nil
75 cperl-close-paren-offset -1
76 cperl-tab-always-indent t)
77 ;(add-hook 'cperl-mode-hook (lambda () (cperl-set-style "PerlStyle")))
81 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
85 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
90 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
91 (add-to-list 'tramp-methods '("vcsh"
92 (tramp-login-program "vcsh")
96 (tramp-remote-shell "/bin/sh")
97 (tramp-remote-shell-args
101 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
102 (load "auctex.el" nil t t)
103 (load "preview-latex.el" nil t t)
104 (load "latex.el" nil t t)
106 ;; this is in the very newest auctex; avoid for now
107 (add-to-list 'LaTeX-fill-excluded-macros
109 ;; REFTEX (much enhanced management of cross-ref, labels, etc)
110 ;; http://www.strw.leidenuniv.nl/~dominik/Tools/reftex/
111 (autoload 'reftex-mode "reftex" "RefTeX Minor Mode" t)
112 (autoload 'turn-on-reftex "reftex" "RefTeX Minor Mode" nil)
113 (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
114 (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
115 (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode
116 (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode
117 (add-hook 'LaTeX-mode-hook 'outline-minor-mode) ; with AUCTeX LaTeX mode
118 (add-hook 'latex-mode-hook 'outline-minor-mode) ; with Emacs latex mode
120 ; use smart quotes by default instead of `` and ''
121 ; taken from http://kieranhealy.org/esk/kjhealy.html
122 (setq TeX-open-quote "“")
123 (setq TeX-close-quote "”")
125 ;; (TeX-add-style-hook
130 ;; (custom-set-variables
131 ;; '(font-latex-user-keyword-classes
134 ;; font-lock-function-name-face 2 (command 1 t))))
137 (require 'font-latex)
138 (setq font-latex-match-reference-keywords
154 ; (setq font-latex-match-warning-keywords
162 (setq-default TeX-parse-self t)
163 (setq-default TeX-auto-save t)
164 (setq-default TeX-master nil)
166 ;; this doesn't seem to work; not currently sure why
167 ; (setq font-latex-user-keyword-classes
168 ; '(("my-warning-commands"
175 ; (:foreground "red" :weight bold :underline (:color foreground-color :style line)))
178 (setq-default reftex-default-bibliography
179 '("~/projects/research/references.bib"))
184 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
185 (require 'org-mode-configuration)
188 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
189 (require 'ess_configuration)
194 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
196 (append '("~/lib/emacs_el/polymode/modes")
200 (require 'poly-noweb)
201 (require 'poly-markdown)
202 (add-to-list 'auto-mode-alist '("\\.Snw" . poly-noweb+r-mode))
203 (add-to-list 'auto-mode-alist '("\\.Rnw" . poly-noweb+r-mode))
204 (add-to-list 'auto-mode-alist '("\\.Rmd" . poly-markdown+r-mode))
208 ** Override other things
209 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
210 ; apparently things like to step on C-;, so we'll use a hack from
211 ; http://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs/5340797#5340797 to fix this
213 (defvar my-keys-minor-mode-map (make-keymap) "my-keys-minor-mode keymap.")
215 ; use iedit everywhere
216 (define-key my-keys-minor-mode-map (kbd "C-;") 'iedit-mode)
217 ;; use outline mode keybindings everywhere
218 (define-key my-keys-minor-mode-map (kbd "C-;") 'my/mydra-outline/body)
220 (define-minor-mode my-keys-minor-mode
221 "A minor mode so that my key settings override annoying major modes."
222 t " my-keys" 'my-keys-minor-mode-map)
224 (my-keys-minor-mode 1)
225 (defun my-minibuffer-setup-hook ()
226 (my-keys-minor-mode 0))
228 (add-hook 'minibuffer-setup-hook 'my-minibuffer-setup-hook)
229 (defadvice load (after give-my-keybindings-priority)
230 "Try to ensure that my keybindings always have priority."
231 (if (not (eq (car (car minor-mode-map-alist)) 'my-keys-minor-mode))
232 (let ((mykeys (assq 'my-keys-minor-mode minor-mode-map-alist)))
233 (assq-delete-all 'my-keys-minor-mode minor-mode-map-alist)
234 (add-to-list 'minor-mode-map-alist mykeys))))
239 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
240 (provide 'don-configuration)