1 ;;; -*- mode: emacs-lisp; coding: utf-8 -*-
3 ;;; Emacs configuration file
5 ;;; (c) 1996-1999 Mark Wooding
8 ;;;----- Licensing notice ---------------------------------------------------
10 ;;; This program is free software; you can redistribute it and/or modify
11 ;;; it under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 2 of the License, or
13 ;;; (at your option) any later version.
15 ;;; This program is distributed in the hope that it will be useful,
16 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with this program; if not, write to the Free Software
22 ;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
24 (setq load-path (nconc load-path (list "~/lib/emacs")))
27 ;;;----- Some random initialisation -----------------------------------------
29 (setq mdw-init-window (selected-window))
31 ;; --- Load some other bits of code ---
33 (maybe-autoload 'cc-mode "cc-mode" nil t)
34 (maybe-autoload 'rexx-mode "rexx-mode" nil t)
35 (maybe-autoload 'cvs-update "pcl-cvs" nil t)
36 (maybe-autoload 'debian-changelog-mode "debian-changelog-mode" nil t)
37 (maybe-autoload 'git-status "git" nil t)
38 (maybe-autoload 'git-blame-mode "git-blame" nil t)
39 (maybe-autoload 'stgit "stgit" nil t)
40 (maybe-autoload 'nc-timesheet-prepare "nc-timesheet" nil t nil)
41 (maybe-autoload 'nc-timesheet-submit "nc-timesheet" nil t nil)
43 (and (library-exists-p "debian-changelog-mode")
44 (add-to-list 'auto-mode-alist
47 "[" "[:lower:][:digit:]]"
48 "[[:lower:][:digit:].+-" "]+"
52 . debian-changelog-mode)))
54 (and (library-exists-p "vc-git")
55 (not (memq 'GIT vc-handled-backends))
56 (setq vc-handled-backends (cons 'GIT vc-handled-backends)))
57 (and (library-exists-p "quilt")
58 (not mdw-fast-startup)
61 (trap (or mdw-fast-startup (require 'tex-site)))
63 ;; --- Skeleton stuff ---
65 (trap (or mdw-fast-startup (require 'skel-init)))
67 ;; --- Window system-dependent things ---
70 (trap (show-paren-mode t))
71 (or window-system (menu-bar-mode -1))
73 ;; --- Temporary directory handling ---
75 (defun mdw-check-dir-exists (dir)
77 (file-directory-p dir)
79 (setq tmpdir (or (mdw-check-dir-exists (getenv "TMPDIR"))
80 (mdw-check-dir-exists (format "/tmp/%s" (user-login-name)))
83 ;; --- Emacs server behaviour ---
87 (setq server-temp-file-regexp (concat "^" tmpdir "\\|/draft$"))))
89 ;; --- Control backup behaviour ---
91 (setq backup-by-copying nil)
92 (setq backup-by-copying-when-linked t)
93 (setq backup-by-copying-when-mismatch t)
95 (setq mdw-backup-disable-regexps
96 '("/\\.git/COMMIT_EDITMSG$"
97 "/\\.stgit\\(-edit\\.txt\\|msg\\.txt\\|\\.msg\\)$"))
99 ;; --- Safe variables ---
101 (setq safe-local-variable-values
102 '((make-backup-files . nil)))
104 ;; --- Calculator fiddling ---
106 (setq calc-settings-file "~/.emacs-calc")
107 (load calc-settings-file)
109 ;; ---- Some mail and news configuration ---
111 (setq mail-from-style 'parens)
112 (setq mail-signature t)
113 (setq mail-yank-prefix "> ")
114 (setq mail-archive-file-name "~/Mail/sent")
116 (setq rmail-display-summary t)
117 (setq rmail-file-name "~/Mail/rmail")
119 (setq sendmail-program "~/bin/sendmail-hack")
121 (setq mail-user-agent 'message-user-agent)
123 (and (fboundp 'turn-on-gnus-dired-mode)
124 (not mdw-fast-startup)
125 (add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode))
128 (trap (bbdb-initialize 'gnus 'sendmail 'vm 'message)))
129 (setq bbdb-north-american-phone-numbers-p nil)
131 ;; --- Customization ---
133 (setq custom-file "~/.emacs-custom")
134 (trap (load custom-file))
136 (trap (load "~/.emacs-local"))
138 ;; --- Internationalization twiddling ---
141 ;; Have top-bit-set characters work properly in terminals.
142 (let ((im (current-input-mode)))
143 (apply #'set-input-mode
144 (nconc (list (nth 0 im) (nth 1 im) 0) (nthcdr 3 im)))))
146 ;; --- Don't disable any commands ---
148 (mapatoms #'(lambda (sym) (put sym 'disabled nil)))
150 ;; --- Split a wide window ---
154 ;; --- Postscript printing ---
156 (setq ps-paper-type 'a4
159 ps-number-of-columns 3
160 ps-font-family 'Courier
163 ;; --- Splash screen stuff ---
166 (setq inhibit-splash-screen t
167 inhibit-startup-message t))
169 ;; --- Other goodies ---
171 (trap (resize-minibuffer-mode 1)) ;Make minibuffer grow dynamically
172 (auto-compression-mode 1) ;Enable automatic compression
173 (setq dabbrev-case-replace nil) ;Retain case when completing
174 (setq next-line-add-newlines nil) ;Don't add weird newlines
175 (setq split-height-threshold 45) ;Reuse windows where sensible
176 (setq display-buffer-reuse-frames nil ;Don't confuse me by showing buffers
177 iswitchb-default-method 'samewindow) ;in other random frames
178 (setq dired-deletion-confirmer ;Make deletion easier in dired
179 (symbol-function 'y-or-n-p))
180 (setq read-quoted-char-radix 16) ;C-q HEX-STUFF [RET]
181 (setq dired-listing-switches "-alF") ;Do `ls -F' things in dired windows
182 (setq wdired-allow-to-change-permissions t)
183 (setq case-fold-file-names nil) ;Don't translate file names (grr...)
184 (setq scroll-step 5) ;Don't scroll too much at a time
185 (setq-default fill-column 77) ;I use rather narrow windows
186 (setq-default comment-column 40) ;Set a standard comment column
187 (setq-default truncate-partial-width-windows nil)
188 (setq woman-use-own-frame nil) ;Keep man pages somewhere sensible
189 (setq diff-switches "-u" ;I like reading unified diffs
190 cvs-diff-flags (list diff-switches))
191 (setq echo-keystrokes 10) ;Long delay before keystrokes echo
192 (setq ange-ftp-ftp-program-name "pftp") ;Use passive FTP
193 (setq find-ls-option ;Build file lists efficiently
194 '("-print0 | xargs -0r ls -ld" . "ld"))
195 (setq bookmark-save-flag 0) ;Save bookmarks automatically
196 (setq Info-fontify-maximum-menu-size 100000)
197 (setq set-mark-command-repeat-pop t)
198 (setq ispell-program-name "aspell"
199 ispell-local-dictionary "en_GB-ize-w_accents"
200 flyspell-default-dictionary "en_GB-ize-w_accents"
201 ispell-silently-savep t)
204 (setq uniquify-buffer-name-style 'post-forward-angle-brackets)
205 (setq uniquify-after-kill-buffer-p t))
206 (transient-mark-mode t)
207 (setq mark-even-if-inactive t)
211 (trap (or mdw-fast-startup (global-auto-revert-mode t)))
212 (setq psgml-html-build-new-buffer nil)
214 (defvar mdw-black-background t)
216 (eval-after-load "outline"
218 (trap (require 'foldout))
219 (define-key outline-mode-prefix-map [?\C-r] 'reveal-mode)
220 (define-key outline-mode-prefix-map [?\C--] 'mdw-outline-collapse-all)))
222 (setq cltl2-root-url (mdw-config 'cltl-url))
223 (setq common-lisp-hyperspec-root (mdw-config 'hyperspec-url))
225 ;;;----- W3 and URL fetching stuff ------------------------------------------
227 (let ((proxy (mdw-config 'http-proxy)))
228 (setq url-proxy-services
231 ("gopher" . ,proxy))))
232 (setq url-cookie-untrusted-urls '("."))
234 (setq browse-url-browser-function (mdw-good-url-browser)
235 browse-url-mozilla-program "firefox")
237 (setq w3m-default-display-inline-images t)
239 (setq w3-do-incremental-display t
240 w3-use-menus '(file edit view go bookmark options
241 buffers style search emacs nil help)
242 w3-display-inline-image t
245 ;;;----- Calendar configuration ---------------------------------------------
247 (setq diary-file "~/etc/diary")
249 ;; --- Trivial stuff for the sunrise/sunset calculations ---
251 (setq calendar-latitude 52.2)
252 (setq calendar-longitude 0.1)
253 (setq calendar-location-name "Cambridge, UK")
257 (and (not mdw-fast-startup)
260 (setq other-holidays (append english-and-welsh-bank-holidays
263 ;; --- Date format fiddling ---
265 (setq european-calendar-style t)
267 (setq diary-date-forms '((day "[-/]" month "[^-/0-9]")
268 (day " *" monthname "[ \t]*\\(\^M\\|\n\\)")
269 (backup day " *" monthname "\\W+\\<[^*0-9]")
270 (day "[-/]" month "[-/]" year "[^0-9]")
271 (day " *" monthname " *" year "[^0-9]")
272 (year "[-/]" month "[-/]" day "[^0-9]")
275 ;; --- Fancy diary handling ---
277 (add-hook 'diary-display-hook 'fancy-diary-display)
278 (setq diary-list-include-blanks t)
279 (add-hook 'list-diary-entries-hook 'sort-diary-entries t)
280 (add-hook 'list-diary-entries-hook 'include-other-diary-files)
281 (add-hook 'mark-diary-entries-hook 'mark-included-diary-files)
283 ;; --- Appointment management ---
285 (add-hook 'diary-hook 'appt-make-list)
286 (setq appt-issue-message t)
287 (setq appt-display-interval 3)
288 (setq appt-message-warning-time 10)
290 ;; --- Cosmetic stuff ---
292 (setq display-time-24hr-format t)
296 (let ((view-diary-entries-initially t))
299 ;;;----- MailCrypt ----------------------------------------------------------
301 ;; --- Define more mode hooks for MailCrypt ---
304 '((mdwmail-mode (encrypt . mdwmail-mc-encrypt)
305 (sign . mdwmail-mc-sign))))
307 ;; --- Load the MailCrypt support ---
310 (and (string-match "linux" (symbol-name system-type))
311 (not mdw-fast-startup)
312 (progn (require 'mailcrypt-init)
314 (setq mc-default-scheme 'mc-scheme-gpg)
315 (setq mc-pgp-user-id "mdw-nsict-pgp")
316 (setq mc-gpg-user-id "mdw-nsict-gpg")
317 (setq mc-modes-alist (append mc-modes-alist mdw-mc-modes))
318 (setq mc-pgp-always-sign t)
319 (setq mc-gpg-always-sign t)
320 (setq mc-always-replace 'never)
321 (setq mc-passwd-timeout 3600)
322 (setq mc-temp-directory tmpdir)
323 (setq mc-modes-alist (append mc-modes-alist mdw-mc-modes))
324 (define-key mc-write-mode-map "\C-c/S" 'mc-sign-region)
325 (define-key mc-write-mode-map "\C-c/E" 'mc-encrypt-region)
326 (add-hook 'text-mode-hook 'mc-install-write-mode))))
328 ;;;----- Other common declarations ------------------------------------------
330 ;; --- Default frame size ---
332 (setq default-frame-alist
336 (vertical-scroll-bars . right))
338 '((cursor-type . bar)
342 (scroll-bar-width . 15)))
343 '((cursor-color . "red"))
344 (if mdw-black-background
345 '((background-color . "black")
346 (foreground-color . "white")
347 (background-mode . dark))
348 '((background-mode . light)))
349 (and (eq window-system 'pm)
350 '((font . "-os2-System VIO-medium-r-normal--*-40-*-*-m-*-cp850")
351 (menu-font . "8.Helv")
352 (background-color . "lightgrey")))
353 '((transparency . t))
354 default-frame-alist))
356 ;; --- Other frame fiddling ---
358 (setq frame-title-format '("" invocation-name "@" system-name ": %b"))
360 ;; --- Global keymap changes ---
363 (windmove-default-keybindings))
364 (setq windmove-wrap-around t)
365 (trap (iswitchb-mode))
366 (global-set-key [?\C-x ?w left] 'windmove-left)
367 (global-set-key [?\C-x ?w ?h] 'windmove-left)
368 (global-set-key [?\C-x ?w up] 'windmove-up)
369 (global-set-key [?\C-x ?w ?k] 'windmove-up)
370 (global-set-key [?\C-x ?w down] 'windmove-down)
371 (global-set-key [?\C-x ?w ?j] 'windmove-down)
372 (global-set-key [?\C-x ?w right] 'windmove-right)
373 (global-set-key [?\C-x ?w ?l] 'windmove-right)
374 (global-set-key [?\C-x ?g ?l] 'org-store-link)
375 (global-set-key [?\C-x ?g ?a] 'org-agenda)
376 (global-set-key [?\C-x ?t ?i] 'timeclock-in)
377 (global-set-key [?\C-x ?t ?c] 'timeclock-change)
378 (global-set-key [?\C-x ?t ?o] 'timeclock-out)
379 (global-set-key [?\C-x ?t ?r] 'timeclock-reread-log)
380 (global-set-key [?\C-x ?t ?w] 'timeclock-workday-remaining-string)
381 (global-set-key [?\C-x ?t ?s] 'timeclock-status-string)
382 (global-set-key [?\C-x ?t ?p] 'nc-timesheet-prepare)
383 (global-set-key [?\C-x ?t ?\C-m] 'nc-timesheet-submit)
384 (global-set-key [?\M-#] 'calc-dispatch)
385 (global-set-key [?\C-x ?/] 'auto-fill-mode)
386 (global-set-key [?\C-x ?w ?d] 'mdw-divvy-window)
387 (global-set-key [insertchar] 'overwrite-mode)
388 (global-set-key [?\C-x ?\C-n] 'skel-create-file)
389 (global-set-key [?\C-x ?4 ?n] 'skel-create-file-other-window)
390 (global-set-key [?\C-x ?5 ?n] 'skel-create-file-other-frame)
391 (global-set-key [delete] 'delete-char)
392 (global-set-key [?\M-q] 'mdw-fill-paragraph)
393 (global-set-key [?\C-h ?\C-m] 'manual-entry)
394 (global-set-key [C-M-backspace] 'backward-kill-sexp)
395 (global-set-key [mode-line C-mouse-1] 'mouse-tear-off-window)
396 (global-set-key [vertical-scroll-bar C-down-mouse-1]
397 'mouse-drag-vertical-line)
398 (global-set-key [vertical-scroll-bar C-mouse-1]
399 #'(lambda () (interactive)))
401 ;; --- Recognising types of files ---
403 (setq auto-mode-alist
404 (append `(("\\.p[lm]$" . perl-mode)
405 ("\\.m$" . objc-mode)
407 ("\\.cs" . csharp-mode)
408 ("\\.org$" . org-mode)
409 ;; ("/[ch]/" . c-mode)
411 "\\.stgit\\.msg" "\\|"
412 "\\.git/COMMIT_EDITMSG" "\\|"
413 "svn-commit\\.tmp" "\\|"
414 "svk-commit[^/.]*\\.tmp"
417 (,(concat "^" tmpdir "/\\("
418 "svk-commit[^/.]*\\.tmp" "\\|"
419 "gitci\\.[^/.]*" "\\|"
420 "cvs[^/.]\\{6\\}" "\\|"
421 "quilt_header\.[^/.]\\{6\\}"
424 ("\\.calc?$" . apcalc-mode)
425 ("/src/linux/.*\\.\\(c\\|h\\|cc\\)$" . linux-c-mode)
426 ("/\\(s\\|sh\\)/" . arm-assembler-mode)
427 ("\\.\\(cmd\\|exec\\|rexx\\)$" . rexx-mode)
428 ("\\.st$" . smalltalk-mode)
429 ("\\.msgs$" . messages-mode)
430 ("/all-cmds\\.in$" . cpp-messages-mode)
431 ("\\.\\(tex\\|dtx\\)$" . latex-mode)
432 ("\\.gc$" . haskell.-mode)
433 (,(concat "^" (getenv "HOME") "/News/") . mdwmail-mode)
434 (,(concat "^" tmpdir "/\\(SLRN\\|snd\\|pico\\|mutt\\)")
438 (setq interpreter-mode-alist
439 (append `(("runlisp" . lisp-mode))
440 interpreter-mode-alist))
442 (setq completion-ignored-extensions
443 (append `(".hc" ".hi") completion-ignored-extensions))
445 ;; --- Some common local definitions ---
447 (make-variable-buffer-local 'mdw-auto-indent)
449 (mapcar (lambda (hook) (add-hook hook 'mdw-misc-mode-config))
450 '(c-mode-hook c++-mode-hook objc-mode-hook java-mode-hook
451 csharp-mode-hook perl-mode-hook cperl-mode-hook
452 python-mode-hook awk-mode-hook tcl-mode-hook
453 asm-mode-hook TeX-mode-hook LaTeX-mode-hook
454 TeXinfo-mode-hook tex-mode-hook latex-mode-hook
455 texinfo-mode-hook emacs-lisp-mode-hook scheme-mode-hook
456 lisp-mode-hook lisp-interaction-mode-hook
457 inferior-lisp-mode-hook slime-repl-mode-hook
458 sml-mode-hook haskell-mode-hook erlang-mode-hook
459 smalltalk-mode-hook rexx-mode-hook
460 arm-assembler-mode-hook))
462 (global-font-lock-mode t)
463 (defalias 'perl-mode 'cperl-mode)
465 ;;;----- Rootly editingness -------------------------------------------------
467 (eval-after-load "tramp"
472 (tramp-connection-function tramp-open-connection-su)
473 (tramp-remote-sh "/bin/sh")
474 (tramp-login-program "become")
475 (tramp-copy-program nil)
476 (tramp-copy-args nil)
477 (tramp-copy-keep-date-arg nil)
478 (tramp-login-args ("TERM=dumb" "%u")))
480 (tramp-connection-function tramp-open-connection-su)
481 (tramp-login-program "really")
482 (tramp-login-args ("-u" "%u" "--"
483 "env" "TERM=dumb" "/bin/sh"))
484 (tramp-copy-program nil)
485 (tramp-copy-args nil)
486 (tramp-copy-keep-date-arg nil)
487 (tramp-remote-sh "/bin/sh"))
489 (setq tramp-multi-connection-function-alist
491 '(("bc" tramp-multi-connect-su "become TERM=dumb %u%n"))
492 '(("r" tramp-multi-connect-su "really -u %u%n"))
493 tramp-multi-connection-function-alist))
494 (setq tramp-default-method "ssh")
495 (setq tramp-default-method-alist
496 `(("\\`localhost\\'" ""
497 ,(cond ((executable-find "become") "become")
498 ((executable-find "really") "really")
501 ;;;----- General fontification ----------------------------------------------
503 ;; --- Configure lazy fontification ---
505 (and (fboundp 'lazy-lock-mode)
506 (setq font-lock-support-mode 'lazy-lock-mode))
507 ; (setq lazy-lock-defer-contextually t)
508 (setq lazy-lock-defer-time nil)
509 (setq font-lock-maximum-decoration 3)
510 (setq lazy-lock-minimum-size 0)
511 (setq lazy-lock-stealth-time 5)
512 (setq lazy-lock-stealth-lines 100)
513 (setq lazy-lock-stealth-verbose t)
515 (add-hook 'after-make-frame-functions 'mdw-do-set-font)
516 (add-hook 'term-setup-hook (lambda () (mdw-do-set-font (selected-frame))))
517 (add-hook 'window-setup-hook (lambda () (mdw-do-set-font (selected-frame))))
519 (add-hook 'c-mode-hook 'mdw-fontify-c-and-c++ t)
520 (add-hook 'objc-mode-hook 'mdw-fontify-c-and-c++ t)
521 (add-hook 'c++-mode-hook 'mdw-fontify-c-and-c++ t)
522 (add-hook 'linux-c-mode-hook #'(lambda () (setq c-basic-offset 8)))
523 (add-hook 'asm-mode-hook 'mdw-fontify-asm t)
525 (add-hook 'apcalc-mode-hook 'mdw-misc-mode-config t)
526 (add-hook 'apcalc-mode-hook 'mdw-fontify-apcalc t)
528 (add-hook 'java-mode-hook 'mdw-fontify-java t)
529 (add-hook 'csharp-mode-hook 'mdw-fontify-csharp t)
531 (add-hook 'awk-mode-hook 'mdw-fontify-awk t)
533 (add-hook 'perl-mode-hook 'mdw-fontify-perl t)
534 (add-hook 'cperl-mode-hook 'mdw-fontify-perl t)
536 (setq-default py-indent-offset 2)
537 (add-hook 'python-mode-hook 'mdw-fontify-python t)
538 (setq py-python-command-args `("-i" "-colors" ,(if mdw-black-background
542 (setq-default tcl-indent-level 2)
543 (add-hook 'tcl-mode-hook 'mdw-fontify-tcl t)
545 (add-hook 'rexx-mode-hook 'mdw-fontify-rexx t)
547 (setq sml-nested-if-indent t)
548 (setq sml-case-indent nil)
549 (setq sml-indent-level 4)
550 (setq sml-type-of-indent nil)
551 (add-hook 'sml-mode-hook 'mdw-fontify-sml t)
553 (add-hook 'haskell-mode-hook 'mdw-fontify-haskell t)
554 (setq-default haskell-indent-offset 2)
556 (add-hook 'erlang-mode-hook 'mdw-fontify-erlang t)
558 (add-hook 'texinfo-mode-hook 'mdw-fontify-texinfo t)
559 (add-hook 'TeXinfo-mode-hook 'mdw-fontify-texinfo t)
561 (setq LaTeX-table-label "tbl:")
562 (setq TeX-auto-untabify nil)
563 (add-hook 'TeX-mode-hook 'mdw-fontify-tex t)
564 (add-hook 'tex-mode-hook 'mdw-fontify-tex t)
565 (add-hook 'LaTeX-mode-hook 'mdw-fontify-tex t)
566 (add-hook 'latex-mode-hook 'mdw-fontify-tex t)
568 (add-hook 'sh-mode-hook #'mdw-setup-sh-script-mode)
569 (add-hook 'autoconf-mode-hook #'mdw-setup-m4)
570 (add-hook 'm4-mode-hook #'mdw-setup-m4)
572 (add-hook 'smalltalk-mode-hook 'mdw-fontify-smalltalk t)
573 (add-hook 'smalltalk-mode-hook 'mdw-setup-smalltalk t)
575 (add-hook 'emacs-lisp-mode-hook 'mdw-fontify-lispy t)
576 (add-hook 'scheme-mode-hook 'mdw-fontify-lispy t)
577 (add-hook 'lisp-mode-hook 'mdw-fontify-lispy t)
578 (add-hook 'inferior-lisp-mode-hook 'mdw-fontify-lispy t)
579 (add-hook 'lisp-interaction-mode-hook 'mdw-fontify-lispy t)
580 (add-hook 'slime-repl-mode-hook 'mdw-fontify-lispy t)
581 (add-hook 'lisp-mode-hook 'mdw-common-lisp-indent t)
582 (add-hook 'inferior-lisp-mode-hook
584 (local-set-key "\C-m" 'comint-send-and-indent)) t)
586 (add-hook 'text-mode-hook 'mdw-text-mode t)
588 ;;;----- TeX stuff ----------------------------------------------------------
590 (setq TeX-output-view-style
592 ("^landscape$" "^pstricks$\\|^pst-\\|^psfrag$")
593 "%(o?)dvips -t landscape %d -o && evince %f")
594 ("^dvi$" "^pstricks$\\|^pst-\\|^psfrag$"
595 "%(o?)dvips %d -o && evince %f")
597 ("^a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4$" "^landscape$")
598 "%(o?)xdvi %dS -paper a4r -s 0 %d")
599 ("^dvi$" "^a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4$"
600 "%(o?)xdvi %dS -paper a4 %d")
602 ("^a5\\(?:comb\\|paper\\)$" "^landscape$")
603 "%(o?)xdvi %dS -paper a5r -s 0 %d")
604 ("^dvi$" "^a5\\(?:comb\\|paper\\)$" "%(o?)xdvi %dS -paper a5 %d")
605 ("^dvi$" "^b5paper$" "%(o?)xdvi %dS -paper b5 %d")
606 ("^dvi$" "^letterpaper$" "%(o?)xdvi %dS -paper us %d")
607 ("^dvi$" "^legalpaper$" "%(o?)xdvi %dS -paper legal %d")
608 ("^dvi$" "^executivepaper$" "%(o?)xdvi %dS -paper 7.25x10.5in %d")
609 ("^dvi$" "." "%(o?)xdvi %dS %d")
610 ("^pdf$" "." "evince %o")
611 ("^html?$" "." "netscape %o")))
613 (setq reftex-use-external-file-finders t
614 reftex-auto-recenter-toc t)
616 (setq reftex-label-alist
617 '(("theorem" ?T "th:" "~\\ref{%s}" t ("theorems?" "th\\.") -2)
618 ("axiom" ?A "ax:" "~\\ref{%s}" t ("axioms?" "ax\\.") -2)
619 ("definition" ?D "def:" "~\\ref{%s}" t ("definitions?" "def\\.") -2)
620 ("proposition" ?P "prop:" "~\\ref{%s}" t
621 ("propositions?" "prop\\.") -2)
622 ("lemma" ?P "lem:" "~\\ref{%s}" t ("lemmas?" "lem\\.") -2)
623 ("example" ?X "eg:" "~\\ref{%s}" t ("examples?") -2)
624 ("exercise" ?E "ex:" "~\\ref{%s}" t ("exercises?" "ex\\.") -2)
625 ("enumerate" ?i "i:" "~\\ref{%s}" item ("items?"))))
626 (setq reftex-section-prefixes
631 (setq bibtex-field-delimiters 'double-quotes
632 bibtex-entry-format '(realign opts-or-alts required-fields
633 numerical-fields last-comma delimiters
635 bibtex-include-OPTkey nil)
637 ;;;----- SLIME setup --------------------------------------------------------
640 (if (not mdw-fast-startup)
642 (require 'slime-autoloads)
643 (slime-setup '(slime-autodoc slime-c-p-c)))))
645 (let ((stuff '((cmucl ("cmucl"))
646 (sbcl ("sbcl") :coding-system utf-8-unix)
647 (clisp ("clisp") :coding-system utf-8-unix))))
648 (or (boundp 'slime-lisp-implementations)
649 (setq slime-lisp-implementations nil))
651 (let* ((head (car stuff))
652 (found (assq (car head) slime-lisp-implementations)))
653 (setq stuff (cdr stuff))
655 (rplacd found (cdr head))
656 (setq slime-lisp-implementations
657 (cons head slime-lisp-implementations))))))
658 (setq slime-default-lisp 'sbcl)
660 ;;;----- Blogging -----------------------------------------------------------
662 (setq weblogger-config-alist
665 ("server-url" . "http://vox.distorted.org.uk/admin/mt-xmlrpc.cgi")
668 ;;;----- Shell mode ---------------------------------------------------------
670 ;; --- Make the shell mode aware of my prompt ---
672 (setq shell-prompt-pattern "^[^]#$%>»}\n]*[]#$%>»}] *")
673 (setq comint-password-prompt-regexp
674 (concat "\\(\\([Oo]ld \\|[Nn]ew \\|[a-zA-Z0-9_]*'s \\|^\\)"
675 "[Pp]assword\\|pass phrase\\):\\s *\\'"))
677 ;; --- Notice passwords, and make C-a work right ---
679 (add-hook 'shell-mode-hook #'mdw-sh-mode-setup)
680 (add-hook 'shell-mode-hook #'ansi-color-for-comint-mode-on)
681 (setq shell-font-lock-keywords nil)
683 (add-hook 'term-mode-hook #'mdw-term-mode-setup)
685 ;;;----- Finishing touches --------------------------------------------------
687 (trap (select-window mdw-init-window))
688 (provide 'emacs-init)
690 ;;;----- That's all, folks --------------------------------------------------