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")
27 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
28 ;; From http://www.emacswiki.org/emacs/LoadingLispFiles
29 ;; execute conditional code when loading libraries
30 (defmacro with-library (symbol &rest body)
31 `(when (require ,symbol nil t)
33 (put 'with-library 'lisp-indent-function 1)
41 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
43 (with-library 'tinyprocmail
44 ; (setq tinyprocmail--procmail-version "v3.22")
45 (add-hook 'tinyprocmail--load-hook 'tinyprocmail-install))
49 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
50 ; don't verify where we are pushing
51 (setq magit-push-always-verify nil)
55 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
57 ;; Use c-mode for perl .xs files
58 (add-to-list 'auto-mode-alist '("\\.xs\\'" . c-mode))
59 (add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\)\\'" . cperl-mode))
60 (add-to-list 'interpreter-mode-alist '("perl" . cperl-mode))
61 (add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode))
62 (add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode))
65 cperl-auto-newline nil
66 cperl-auto-newline-after-colon nil
67 cperl-continued-statement-offset 4
69 cperl-continued-brace-offset 0
71 cperl-highlight-variables-indiscriminately t
72 cperl-electric-lbrace-space nil
73 cperl-indent-parens-as-block nil
74 cperl-close-paren-offset -1
75 cperl-tab-always-indent t)
76 ;(add-hook 'cperl-mode-hook (lambda () (cperl-set-style "PerlStyle")))
80 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
84 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
89 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
90 (add-to-list 'tramp-methods '("vcsh"
91 (tramp-login-program "vcsh")
95 (tramp-remote-shell "/bin/sh")
96 (tramp-remote-shell-args
100 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
101 (load "auctex.el" nil t t)
102 (load "preview-latex.el" nil t t)
103 (load "latex.el" nil t t)
105 ;; this is in the very newest auctex; avoid for now
106 (add-to-list 'LaTeX-fill-excluded-macros
108 ;; REFTEX (much enhanced management of cross-ref, labels, etc)
109 ;; http://www.strw.leidenuniv.nl/~dominik/Tools/reftex/
110 (autoload 'reftex-mode "reftex" "RefTeX Minor Mode" t)
111 (autoload 'turn-on-reftex "reftex" "RefTeX Minor Mode" nil)
112 (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
113 (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
114 (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode
115 (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode
116 (add-hook 'LaTeX-mode-hook 'outline-minor-mode) ; with AUCTeX LaTeX mode
117 (add-hook 'latex-mode-hook 'outline-minor-mode) ; with Emacs latex mode
119 ; use smart quotes by default instead of `` and ''
120 ; taken from http://kieranhealy.org/esk/kjhealy.html
121 (setq TeX-open-quote "“")
122 (setq TeX-close-quote "”")
124 ;; (TeX-add-style-hook
129 ;; (custom-set-variables
130 ;; '(font-latex-user-keyword-classes
133 ;; font-lock-function-name-face 2 (command 1 t))))
136 (require 'font-latex)
137 (setq font-latex-match-reference-keywords
153 ; (setq font-latex-match-warning-keywords
161 (setq-default TeX-parse-self t)
162 (setq-default TeX-auto-save t)
163 (setq-default TeX-master nil)
165 ;; this doesn't seem to work; not currently sure why
166 ; (setq font-latex-user-keyword-classes
167 ; '(("my-warning-commands"
174 ; (:foreground "red" :weight bold :underline (:color foreground-color :style line)))
177 (setq-default reftex-default-bibliography
178 '("~/projects/research/references.bib"))
183 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
184 (require 'org-mode-configuration)
188 ** Override other things
189 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
190 ; apparently things like to step on C-;, so we'll use a hack from
191 ; http://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs/5340797#5340797 to fix this
193 (defvar my-keys-minor-mode-map (make-keymap) "my-keys-minor-mode keymap.")
195 ; use iedit everywhere
196 (define-key my-keys-minor-mode-map (kbd "C-;") 'iedit-mode)
197 ;; use outline mode keybindings everywhere
198 (define-key my-keys-minor-mode-map (kbd "C-;") 'my/mydra-outline/body)
200 (define-minor-mode my-keys-minor-mode
201 "A minor mode so that my key settings override annoying major modes."
202 t " my-keys" 'my-keys-minor-mode-map)
204 (my-keys-minor-mode 1)
205 (defun my-minibuffer-setup-hook ()
206 (my-keys-minor-mode 0))
208 (add-hook 'minibuffer-setup-hook 'my-minibuffer-setup-hook)
209 (defadvice load (after give-my-keybindings-priority)
210 "Try to ensure that my keybindings always have priority."
211 (if (not (eq (car (car minor-mode-map-alist)) 'my-keys-minor-mode))
212 (let ((mykeys (assq 'my-keys-minor-mode minor-mode-map-alist)))
213 (assq-delete-all 'my-keys-minor-mode minor-mode-map-alist)
214 (add-to-list 'minor-mode-map-alist mykeys))))
219 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
220 (provide 'don-configuration)