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/ESS/lisp")
18 (add-to-list 'load-path '"~/lib/emacs_el/org-mode/lisp")
19 (add-to-list 'load-path '"~/lib/emacs_el/auctex-beamer")
20 (add-to-list 'load-path '"~/lib/emacs_el/magit-annex")
26 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
27 ;; From http://www.emacswiki.org/emacs/LoadingLispFiles
28 ;; execute conditional code when loading libraries
29 (defmacro with-library (symbol &rest body)
30 `(when (require ,symbol nil t)
32 (put 'with-library 'lisp-indent-function 1)
40 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
42 (with-library 'tinyprocmail
43 ; (setq tinyprocmail--procmail-version "v3.22")
44 (add-hook 'tinyprocmail--load-hook 'tinyprocmail-install))
48 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
49 ; don't verify where we are pushing
50 (setq magit-push-always-verify nil)
54 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
56 ;; Use c-mode for perl .xs files
57 (add-to-list 'auto-mode-alist '("\\.xs\\'" . c-mode))
58 (add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\)\\'" . cperl-mode))
59 (add-to-list 'interpreter-mode-alist '("perl" . cperl-mode))
60 (add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode))
61 (add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode))
64 cperl-auto-newline nil
65 cperl-auto-newline-after-colon nil
66 cperl-continued-statement-offset 4
68 cperl-continued-brace-offset 0
70 cperl-highlight-variables-indiscriminately t
71 cperl-electric-lbrace-space nil
72 cperl-indent-parens-as-block nil
73 cperl-close-paren-offset -1
74 cperl-tab-always-indent t)
75 ;(add-hook 'cperl-mode-hook (lambda () (cperl-set-style "PerlStyle")))
79 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
83 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
88 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
89 (add-to-list 'tramp-methods '("vcsh"
90 (tramp-login-program "vcsh")
94 (tramp-remote-shell "/bin/sh")
95 (tramp-remote-shell-args
99 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
100 ; this is in the very newest auctex; avoid for now
101 (add-to-list 'LaTeX-fill-excluded-macros
103 ;; REFTEX (much enhanced management of cross-ref, labels, etc)
104 ;; http://www.strw.leidenuniv.nl/~dominik/Tools/reftex/
105 (autoload 'reftex-mode "reftex" "RefTeX Minor Mode" t)
106 (autoload 'turn-on-reftex "reftex" "RefTeX Minor Mode" nil)
107 (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
108 (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
109 (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode
110 (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode
111 (add-hook 'LaTeX-mode-hook 'outline-minor-mode) ; with AUCTeX LaTeX mode
112 (add-hook 'latex-mode-hook 'outline-minor-mode) ; with Emacs latex mode
114 ; use smart quotes by default instead of `` and ''
115 ; taken from http://kieranhealy.org/esk/kjhealy.html
116 (setq TeX-open-quote "“")
117 (setq TeX-close-quote "”")
119 ;; (TeX-add-style-hook
124 ;; (custom-set-variables
125 ;; '(font-latex-user-keyword-classes
128 ;; font-lock-function-name-face 2 (command 1 t))))
131 (require 'font-latex)
132 (setq font-latex-match-reference-keywords
148 ; (setq font-latex-match-warning-keywords
156 (setq-default TeX-parse-self t)
157 (setq-default TeX-auto-save t)
158 (setq-default TeX-master nil)
160 ;; this doesn't seem to work; not currently sure why
161 ; (setq font-latex-user-keyword-classes
162 ; '(("my-warning-commands"
169 ; (:foreground "red" :weight bold :underline (:color foreground-color :style line)))
172 (setq-default reftex-default-bibliography
173 '("~/projects/research/references.bib"))
178 ** Override other things
179 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
180 ; apparently things like to step on C-;, so we'll use a hack from
181 ; http://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs/5340797#5340797 to fix this
183 (defvar my-keys-minor-mode-map (make-keymap) "my-keys-minor-mode keymap.")
185 ; use iedit everywhere
186 (define-key my-keys-minor-mode-map (kbd "C-;") 'iedit-mode)
187 ;; use outline mode keybindings everywhere
188 (define-key my-keys-minor-mode-map (kbd "C-;") 'my/mydra-outline/body)
190 (define-minor-mode my-keys-minor-mode
191 "A minor mode so that my key settings override annoying major modes."
192 t " my-keys" 'my-keys-minor-mode-map)
194 (my-keys-minor-mode 1)
195 (defun my-minibuffer-setup-hook ()
196 (my-keys-minor-mode 0))
198 (add-hook 'minibuffer-setup-hook 'my-minibuffer-setup-hook)
199 (defadvice load (after give-my-keybindings-priority)
200 "Try to ensure that my keybindings always have priority."
201 (if (not (eq (car (car minor-mode-map-alist)) 'my-keys-minor-mode))
202 (let ((mykeys (assq 'my-keys-minor-mode minor-mode-map-alist)))
203 (assq-delete-all 'my-keys-minor-mode minor-mode-map-alist)
204 (add-to-list 'minor-mode-map-alist mykeys))))
209 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
210 (provide 'don-configuration)