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")
23 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
24 ;; From http://www.emacswiki.org/emacs/LoadingLispFiles
25 ;; execute conditional code when loading libraries
26 (defmacro with-library (symbol &rest body)
27 `(when (require ,symbol nil t)
29 (put 'with-library 'lisp-indent-function 1)
37 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
39 (with-library 'tinyprocmail
40 ; (setq tinyprocmail--procmail-version "v3.22")
41 (add-hook 'tinyprocmail--load-hook 'tinyprocmail-install))
45 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
46 ; don't verify where we are pushing
47 (setq magit-push-always-verify nil)
51 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
53 ;; Use c-mode for perl .xs files
54 (add-to-list 'auto-mode-alist '("\\.xs\\'" . c-mode))
55 (add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\)\\'" . cperl-mode))
56 (add-to-list 'interpreter-mode-alist '("perl" . cperl-mode))
57 (add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode))
58 (add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode))
61 cperl-auto-newline nil
62 cperl-auto-newline-after-colon nil
63 cperl-continued-statement-offset 4
65 cperl-continued-brace-offset 0
67 cperl-highlight-variables-indiscriminately t
68 cperl-electric-lbrace-space nil
69 cperl-indent-parens-as-block nil
70 cperl-close-paren-offset -1
71 cperl-tab-always-indent t)
72 ;(add-hook 'cperl-mode-hook (lambda () (cperl-set-style "PerlStyle")))
76 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
80 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
85 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
86 (add-to-list 'tramp-methods '("vcsh"
87 (tramp-login-program "vcsh")
91 (tramp-remote-shell "/bin/sh")
92 (tramp-remote-shell-args
96 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
97 ; this is in the very newest auctex; avoid for now
98 (add-to-list 'LaTeX-fill-excluded-macros
100 ;; REFTEX (much enhanced management of cross-ref, labels, etc)
101 ;; http://www.strw.leidenuniv.nl/~dominik/Tools/reftex/
102 (autoload 'reftex-mode "reftex" "RefTeX Minor Mode" t)
103 (autoload 'turn-on-reftex "reftex" "RefTeX Minor Mode" nil)
104 (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
105 (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
106 (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode
107 (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode
108 (add-hook 'LaTeX-mode-hook 'outline-minor-mode) ; with AUCTeX LaTeX mode
109 (add-hook 'latex-mode-hook 'outline-minor-mode) ; with Emacs latex mode
111 ; use smart quotes by default instead of `` and ''
112 ; taken from http://kieranhealy.org/esk/kjhealy.html
113 (setq TeX-open-quote "“")
114 (setq TeX-close-quote "”")
116 ;; (TeX-add-style-hook
121 ;; (custom-set-variables
122 ;; '(font-latex-user-keyword-classes
125 ;; font-lock-function-name-face 2 (command 1 t))))
128 (require 'font-latex)
129 (setq font-latex-match-reference-keywords
145 ; (setq font-latex-match-warning-keywords
153 (setq-default TeX-parse-self t)
154 (setq-default TeX-auto-save t)
155 (setq-default TeX-master nil)
157 ;; this doesn't seem to work; not currently sure why
158 ; (setq font-latex-user-keyword-classes
159 ; '(("my-warning-commands"
166 ; (:foreground "red" :weight bold :underline (:color foreground-color :style line)))
169 (setq-default reftex-default-bibliography
170 '("~/projects/research/references.bib"))
175 ** Override other things
176 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
177 ; apparently things like to step on C-;, so we'll use a hack from
178 ; http://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs/5340797#5340797 to fix this
180 (defvar my-keys-minor-mode-map (make-keymap) "my-keys-minor-mode keymap.")
182 ; use iedit everywhere
183 (define-key my-keys-minor-mode-map (kbd "C-;") 'iedit-mode)
184 ;; use outline mode keybindings everywhere
185 (define-key my-keys-minor-mode-map (kbd "C-;") 'my/mydra-outline/body)
187 (define-minor-mode my-keys-minor-mode
188 "A minor mode so that my key settings override annoying major modes."
189 t " my-keys" 'my-keys-minor-mode-map)
191 (my-keys-minor-mode 1)
192 (defun my-minibuffer-setup-hook ()
193 (my-keys-minor-mode 0))
195 (add-hook 'minibuffer-setup-hook 'my-minibuffer-setup-hook)
196 (defadvice load (after give-my-keybindings-priority)
197 "Try to ensure that my keybindings always have priority."
198 (if (not (eq (car (car minor-mode-map-alist)) 'my-keys-minor-mode))
199 (let ((mykeys (assq 'my-keys-minor-mode minor-mode-map-alist)))
200 (assq-delete-all 'my-keys-minor-mode minor-mode-map-alist)
201 (add-to-list 'minor-mode-map-alist mykeys))))
206 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
207 (provide 'don-configuration)