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 ;; --- Customization ---
121 (setq custom-file "~/.emacs-custom")
122 (trap (load custom-file))
124 (trap (load "~/.emacs-local"))
126 ;; --- Internationalization twiddling ---
129 ;; Have top-bit-set characters work properly in terminals.
130 (let ((im (current-input-mode)))
131 (apply #'set-input-mode
132 (nconc (list (nth 0 im) (nth 1 im) 0) (nthcdr 3 im)))))
134 ;; --- Don't disable any commands ---
136 (mapatoms #'(lambda (sym) (put sym 'disabled nil)))
138 ;; --- Split a wide window ---
142 ;; --- Postscript printing ---
144 (setq ps-paper-type 'a4
147 ps-number-of-columns 3
148 ps-font-family 'Courier
151 ;; --- Splash screen stuff ---
154 (setq inhibit-splash-screen t
155 inhibit-startup-message t))
157 ;; --- Other goodies ---
159 (trap (resize-minibuffer-mode 1)) ;Make minibuffer grow dynamically
160 (auto-compression-mode 1) ;Enable automatic compression
161 (setq dabbrev-case-replace nil) ;Retain case when completing
162 (setq next-line-add-newlines nil) ;Don't add weird newlines
163 (setq split-height-threshold 45) ;Reuse windows where sensible
164 (setq display-buffer-reuse-frames nil ;Don't confuse me by showing buffers
165 iswitchb-default-method 'samewindow) ;in other random frames
166 (setq dired-deletion-confirmer ;Make deletion easier in dired
167 (symbol-function 'y-or-n-p))
168 (setq dired-listing-switches "-alF") ;Do `ls -F' things in dired windows
169 (setq wdired-allow-to-change-permissions t)
170 (setq case-fold-file-names nil) ;Don't translate file names (grr...)
171 (setq scroll-step 5) ;Don't scroll too much at a time
172 (setq-default fill-column 77) ;I use rather narrow windows
173 (setq-default comment-column 40) ;Set a standard comment column
174 (setq-default truncate-partial-width-windows nil)
175 (setq woman-use-own-frame nil) ;Keep man pages somewhere sensible
176 (setq diff-switches "-u" ;I like reading unified diffs
177 cvs-diff-flags (list diff-switches))
178 (setq echo-keystrokes 10) ;Long delay before keystrokes echo
179 (setq ange-ftp-ftp-program-name "pftp") ;Use passive FTP
180 (setq find-ls-option ;Build file lists efficiently
181 '("-print0 | xargs -0r ls -ld" . "ld"))
182 (setq bookmark-save-flag 0) ;Save bookmarks automatically
183 (setq Info-fontify-maximum-menu-size 100000)
184 (setq set-mark-command-repeat-pop t)
185 (setq ispell-program-name "aspell"
186 ispell-local-dictionary "en_GB-ize-w_accents"
187 flyspell-default-dictionary "en_GB-ize-w_accents"
188 ispell-silently-savep t)
191 (setq uniquify-buffer-name-style 'post-forward-angle-brackets)
192 (setq uniquify-after-kill-buffer-p t))
193 (transient-mark-mode t)
194 (setq mark-even-if-inactive t)
198 (trap (or mdw-fast-startup (global-auto-revert-mode t)))
199 (setq psgml-html-build-new-buffer nil)
201 (defvar mdw-black-background t)
203 (eval-after-load "outline"
205 (trap (require 'foldout))
206 (define-key outline-mode-prefix-map [?\C-r] 'reveal-mode)
207 (define-key outline-mode-prefix-map [?\C--] 'mdw-outline-collapse-all)))
209 (setq cltl2-root-url (mdw-config 'cltl-url))
210 (setq common-lisp-hyperspec-root (mdw-config 'hyperspec-url))
212 ;;;----- W3 and URL fetching stuff ------------------------------------------
214 (let ((proxy (mdw-config 'http-proxy)))
215 (setq url-proxy-services
218 ("gopher" . ,proxy))))
219 (setq url-cookie-untrusted-urls '("."))
221 (setq browse-url-browser-function (mdw-good-url-browser)
222 browse-url-mozilla-program "firefox")
224 (setq w3m-default-display-inline-images t)
226 (setq w3-do-incremental-display t
227 w3-use-menus '(file edit view go bookmark options
228 buffers style search emacs nil help)
229 w3-display-inline-image t
232 ;;;----- Calendar configuration ---------------------------------------------
234 (setq diary-file "~/etc/diary")
236 ;; --- Trivial stuff for the sunrise/sunset calculations ---
238 (setq calendar-latitude 52.2)
239 (setq calendar-longitude 0.1)
240 (setq calendar-location-name "Cambridge, UK")
244 (and (not mdw-fast-startup)
247 (setq other-holidays (append english-and-welsh-bank-holidays
250 ;; --- Date format fiddling ---
252 (setq european-calendar-style t)
254 (setq diary-date-forms '((day "[-/]" month "[^-/0-9]")
255 (day " *" monthname "[ \t]*\\(\^M\\|\n\\)")
256 (backup day " *" monthname "\\W+\\<[^*0-9]")
257 (day "[-/]" month "[-/]" year "[^0-9]")
258 (day " *" monthname " *" year "[^0-9]")
259 (year "[-/]" month "[-/]" day "[^0-9]")
262 ;; --- Fancy diary handling ---
264 (add-hook 'diary-display-hook 'fancy-diary-display)
265 (setq diary-list-include-blanks t)
266 (add-hook 'list-diary-entries-hook 'sort-diary-entries t)
267 (add-hook 'list-diary-entries-hook 'include-other-diary-files)
268 (add-hook 'mark-diary-entries-hook 'mark-included-diary-files)
270 ;; --- Appointment management ---
272 (add-hook 'diary-hook 'appt-make-list)
273 (setq appt-issue-message t)
274 (setq appt-display-interval 3)
275 (setq appt-message-warning-time 10)
277 ;; --- Cosmetic stuff ---
279 (setq display-time-24hr-format t)
283 (let ((view-diary-entries-initially t))
286 ;;;----- MailCrypt ----------------------------------------------------------
288 ;; --- Define more mode hooks for MailCrypt ---
291 '((mdwmail-mode (encrypt . mdwmail-mc-encrypt)
292 (sign . mdwmail-mc-sign))))
294 ;; --- Load the MailCrypt support ---
297 (and (string-match "linux" (symbol-name system-type))
298 (not mdw-fast-startup)
299 (progn (require 'mailcrypt-init)
301 (setq mc-default-scheme 'mc-scheme-gpg)
302 (setq mc-pgp-user-id "mdw-nsict-pgp")
303 (setq mc-gpg-user-id "mdw-nsict-gpg")
304 (setq mc-modes-alist (append mc-modes-alist mdw-mc-modes))
305 (setq mc-pgp-always-sign t)
306 (setq mc-gpg-always-sign t)
307 (setq mc-always-replace 'never)
308 (setq mc-passwd-timeout 3600)
309 (setq mc-temp-directory tmpdir)
310 (setq mc-modes-alist (append mc-modes-alist mdw-mc-modes))
311 (define-key mc-write-mode-map "\C-c/S" 'mc-sign-region)
312 (define-key mc-write-mode-map "\C-c/E" 'mc-encrypt-region)
313 (add-hook 'text-mode-hook 'mc-install-write-mode))))
315 ;;;----- Other common declarations ------------------------------------------
317 ;; --- Default frame size ---
319 (setq default-frame-alist
323 (vertical-scroll-bars . right))
325 '((cursor-type . bar)
329 (scroll-bar-width . 15)))
330 '((cursor-color . "red"))
331 (if mdw-black-background
332 '((background-color . "black")
333 (foreground-color . "white")
334 (background-mode . dark))
335 '((background-mode . light)))
336 (and (eq window-system 'pm)
337 '((font . "-os2-System VIO-medium-r-normal--*-40-*-*-m-*-cp850")
338 (menu-font . "8.Helv")
339 (background-color . "lightgrey")))
340 '((transparency . t))
341 default-frame-alist))
343 ;; --- Other frame fiddling ---
345 (setq frame-title-format '("" invocation-name "@" system-name ": %b"))
347 ;; --- Global keymap changes ---
350 (windmove-default-keybindings))
351 (setq windmove-wrap-around t)
352 (trap (iswitchb-mode))
353 (global-set-key [?\C-x ?w left] 'windmove-left)
354 (global-set-key [?\C-x ?w ?h] 'windmove-left)
355 (global-set-key [?\C-x ?w up] 'windmove-up)
356 (global-set-key [?\C-x ?w ?k] 'windmove-up)
357 (global-set-key [?\C-x ?w down] 'windmove-down)
358 (global-set-key [?\C-x ?w ?j] 'windmove-down)
359 (global-set-key [?\C-x ?w right] 'windmove-right)
360 (global-set-key [?\C-x ?w ?l] 'windmove-right)
361 (global-set-key [?\C-x ?g ?l] 'org-store-link)
362 (global-set-key [?\C-x ?g ?a] 'org-agenda)
363 (global-set-key [?\C-x ?t ?i] 'timeclock-in)
364 (global-set-key [?\C-x ?t ?c] 'timeclock-change)
365 (global-set-key [?\C-x ?t ?o] 'timeclock-out)
366 (global-set-key [?\C-x ?t ?r] 'timeclock-reread-log)
367 (global-set-key [?\C-x ?t ?w] 'timeclock-workday-remaining-string)
368 (global-set-key [?\C-x ?t ?s] 'timeclock-status-string)
369 (global-set-key [?\C-x ?t ?p] 'nc-timesheet-prepare)
370 (global-set-key [?\C-x ?t ?\C-m] 'nc-timesheet-submit)
371 (global-set-key [?\M-#] 'calc-dispatch)
372 (global-set-key [?\C-x ?/] 'auto-fill-mode)
373 (global-set-key [?\C-x ?w ?d] 'mdw-divvy-window)
374 (global-set-key [insertchar] 'overwrite-mode)
375 (global-set-key [?\C-x ?m] 'vm-mail)
376 (global-set-key [?\C-x ?\C-n] 'skel-create-file)
377 (global-set-key [?\C-x ?4 ?n] 'skel-create-file-other-window)
378 (global-set-key [?\C-x ?5 ?n] 'skel-create-file-other-frame)
379 (global-set-key [delete] 'delete-char)
380 (global-set-key [?\M-q] 'mdw-fill-paragraph)
381 (global-set-key [?\C-h ?\C-m] 'manual-entry)
382 (global-set-key [C-M-backspace] 'backward-kill-sexp)
383 (global-set-key [mode-line C-mouse-1] 'mouse-tear-off-window)
384 (global-set-key [vertical-scroll-bar C-down-mouse-1]
385 'mouse-drag-vertical-line)
386 (global-set-key [vertical-scroll-bar C-mouse-1]
387 #'(lambda () (interactive)))
389 ;; --- Recognising types of files ---
391 (setq auto-mode-alist
392 (append `(("\\.p[lm]$" . perl-mode)
393 ("\\.m$" . objc-mode)
395 ("\\.cs" . csharp-mode)
396 ("\\.org$" . org-mode)
397 ;; ("/[ch]/" . c-mode)
399 "\\.stgit\\.msg" "\\|"
400 "\\.git/COMMIT_EDITMSG" "\\|"
401 "svn-commit\\.tmp" "\\|"
402 "svk-commit[^/.]*\\.tmp"
405 (,(concat "^" tmpdir "/\\("
406 "svk-commit[^/.]*\\.tmp" "\\|"
407 "gitci\\.[^/.]*" "\\|"
408 "cvs[^/.]\\{6\\}" "\\|"
409 "quilt_header\.[^/.]\\{6\\}"
412 ("\\.calc?$" . apcalc-mode)
413 ("/src/linux/.*\\.\\(c\\|h\\|cc\\)$" . linux-c-mode)
414 ("/\\(s\\|sh\\)/" . arm-assembler-mode)
415 ("\\.\\(cmd\\|exec\\|rexx\\)$" . rexx-mode)
416 ("\\.st$" . smalltalk-mode)
417 ("\\.msgs$" . messages-mode)
418 ("/all-cmds\\.in$" . cpp-messages-mode)
419 ("\\.\\(tex\\|dtx\\)$" . latex-mode)
420 ("\\.gc$" . haskell.-mode)
421 (,(concat "^" (getenv "HOME") "/News/") . mdwmail-mode)
422 (,(concat "^" tmpdir "/\\(SLRN\\|snd\\|pico\\|mutt\\)")
426 (setq interpreter-mode-alist
427 (append `(("runlisp" . lisp-mode))
428 interpreter-mode-alist))
430 (setq completion-ignored-extensions
431 (append `(".hc" ".hi") completion-ignored-extensions))
433 ;; --- Some common local definitions ---
435 (make-variable-buffer-local 'mdw-auto-indent)
437 (mapcar (lambda (hook) (add-hook hook 'mdw-misc-mode-config))
438 '(c-mode-hook c++-mode-hook objc-mode-hook java-mode-hook
439 csharp-mode-hook perl-mode-hook cperl-mode-hook
440 python-mode-hook awk-mode-hook tcl-mode-hook
441 asm-mode-hook TeX-mode-hook LaTeX-mode-hook
442 TeXinfo-mode-hook tex-mode-hook latex-mode-hook
443 texinfo-mode-hook emacs-lisp-mode-hook scheme-mode-hook
444 lisp-mode-hook lisp-interaction-mode-hook
445 inferior-lisp-mode-hook slime-repl-mode-hook
446 sml-mode-hook haskell-mode-hook erlang-mode-hook
447 smalltalk-mode-hook rexx-mode-hook
448 arm-assembler-mode-hook))
450 (global-font-lock-mode t)
451 (defalias 'perl-mode 'cperl-mode)
453 ;;;----- Rootly editingness -------------------------------------------------
455 (eval-after-load "tramp"
460 (tramp-connection-function tramp-open-connection-su)
461 (tramp-remote-sh "/bin/sh")
462 (tramp-login-program "become")
463 (tramp-copy-program nil)
464 (tramp-copy-args nil)
465 (tramp-copy-keep-date-arg nil)
466 (tramp-login-args ("TERM=dumb" "%u")))
468 (tramp-connection-function tramp-open-connection-su)
469 (tramp-login-program "really")
470 (tramp-login-args ("-u" "%u" "--"
471 "env" "TERM=dumb" "/bin/sh"))
472 (tramp-copy-program nil)
473 (tramp-copy-args nil)
474 (tramp-copy-keep-date-arg nil)
475 (tramp-remote-sh "/bin/sh"))
477 (setq tramp-multi-connection-function-alist
479 '(("bc" tramp-multi-connect-su "become TERM=dumb %u%n"))
480 '(("r" tramp-multi-connect-su "really -u %u%n"))
481 tramp-multi-connection-function-alist))
482 (setq tramp-default-method "ssh")
483 (setq tramp-default-method-alist
484 `(("\\`localhost\\'" ""
485 ,(cond ((executable-find "become") "become")
486 ((executable-find "really") "really")
489 ;;;----- General fontification ----------------------------------------------
491 ;; --- Configure lazy fontification ---
493 (and (fboundp 'lazy-lock-mode)
494 (setq font-lock-support-mode 'lazy-lock-mode))
495 ; (setq lazy-lock-defer-contextually t)
496 (setq lazy-lock-defer-time nil)
497 (setq font-lock-maximum-decoration 3)
498 (setq lazy-lock-minimum-size 0)
499 (setq lazy-lock-stealth-time 5)
500 (setq lazy-lock-stealth-lines 100)
501 (setq lazy-lock-stealth-verbose t)
503 (add-hook 'after-make-frame-functions 'mdw-do-set-font)
504 (add-hook 'term-setup-hook (lambda () (mdw-do-set-font (selected-frame))))
505 (add-hook 'window-setup-hook (lambda () (mdw-do-set-font (selected-frame))))
507 (add-hook 'c-mode-hook 'mdw-fontify-c-and-c++ t)
508 (add-hook 'objc-mode-hook 'mdw-fontify-c-and-c++ t)
509 (add-hook 'c++-mode-hook 'mdw-fontify-c-and-c++ t)
510 (add-hook 'linux-c-mode-hook #'(lambda () (setq c-basic-offset 8)))
511 (add-hook 'asm-mode-hook 'mdw-fontify-asm t)
513 (add-hook 'apcalc-mode-hook 'mdw-misc-mode-config t)
514 (add-hook 'apcalc-mode-hook 'mdw-fontify-apcalc t)
516 (add-hook 'java-mode-hook 'mdw-fontify-java t)
517 (add-hook 'csharp-mode-hook 'mdw-fontify-csharp t)
519 (add-hook 'awk-mode-hook 'mdw-fontify-awk t)
521 (add-hook 'perl-mode-hook 'mdw-fontify-perl t)
522 (add-hook 'cperl-mode-hook 'mdw-fontify-perl t)
524 (setq-default py-indent-offset 2)
525 (add-hook 'python-mode-hook 'mdw-fontify-python t)
526 (setq py-python-command-args `("-i" "-colors" ,(if mdw-black-background
530 (setq-default tcl-indent-level 2)
531 (add-hook 'tcl-mode-hook 'mdw-fontify-tcl t)
533 (add-hook 'rexx-mode-hook 'mdw-fontify-rexx t)
535 (setq sml-nested-if-indent t)
536 (setq sml-case-indent nil)
537 (setq sml-indent-level 4)
538 (setq sml-type-of-indent nil)
539 (add-hook 'sml-mode-hook 'mdw-fontify-sml t)
541 (add-hook 'haskell-mode-hook 'mdw-fontify-haskell t)
542 (setq-default haskell-indent-offset 2)
544 (add-hook 'erlang-mode-hook 'mdw-fontify-erlang t)
546 (add-hook 'texinfo-mode-hook 'mdw-fontify-texinfo t)
547 (add-hook 'TeXinfo-mode-hook 'mdw-fontify-texinfo t)
549 (setq LaTeX-table-label "tbl:")
550 (setq TeX-auto-untabify nil)
551 (add-hook 'TeX-mode-hook 'mdw-fontify-tex t)
552 (add-hook 'tex-mode-hook 'mdw-fontify-tex t)
553 (add-hook 'LaTeX-mode-hook 'mdw-fontify-tex t)
554 (add-hook 'latex-mode-hook 'mdw-fontify-tex t)
556 (add-hook 'sh-mode-hook #'mdw-setup-sh-script-mode)
557 (add-hook 'autoconf-mode-hook #'mdw-setup-m4)
558 (add-hook 'm4-mode-hook #'mdw-setup-m4)
560 (add-hook 'smalltalk-mode-hook 'mdw-fontify-smalltalk t)
561 (add-hook 'smalltalk-mode-hook 'mdw-setup-smalltalk t)
563 (add-hook 'emacs-lisp-mode-hook 'mdw-fontify-lispy t)
564 (add-hook 'scheme-mode-hook 'mdw-fontify-lispy t)
565 (add-hook 'lisp-mode-hook 'mdw-fontify-lispy t)
566 (add-hook 'inferior-lisp-mode-hook 'mdw-fontify-lispy t)
567 (add-hook 'lisp-interaction-mode-hook 'mdw-fontify-lispy t)
568 (add-hook 'slime-repl-mode-hook 'mdw-fontify-lispy t)
569 (add-hook 'lisp-mode-hook 'mdw-common-lisp-indent t)
570 (add-hook 'inferior-lisp-mode-hook
572 (local-set-key "\C-m" 'comint-send-and-indent)) t)
574 (add-hook 'text-mode-hook 'mdw-text-mode t)
576 ;;;----- TeX stuff ----------------------------------------------------------
578 (setq TeX-output-view-style
580 ("^landscape$" "^pstricks$\\|^pst-\\|^psfrag$")
581 "%(o?)dvips -t landscape %d -o && evince %f")
582 ("^dvi$" "^pstricks$\\|^pst-\\|^psfrag$"
583 "%(o?)dvips %d -o && evince %f")
585 ("^a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4$" "^landscape$")
586 "%(o?)xdvi %dS -paper a4r -s 0 %d")
587 ("^dvi$" "^a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4$"
588 "%(o?)xdvi %dS -paper a4 %d")
590 ("^a5\\(?:comb\\|paper\\)$" "^landscape$")
591 "%(o?)xdvi %dS -paper a5r -s 0 %d")
592 ("^dvi$" "^a5\\(?:comb\\|paper\\)$" "%(o?)xdvi %dS -paper a5 %d")
593 ("^dvi$" "^b5paper$" "%(o?)xdvi %dS -paper b5 %d")
594 ("^dvi$" "^letterpaper$" "%(o?)xdvi %dS -paper us %d")
595 ("^dvi$" "^legalpaper$" "%(o?)xdvi %dS -paper legal %d")
596 ("^dvi$" "^executivepaper$" "%(o?)xdvi %dS -paper 7.25x10.5in %d")
597 ("^dvi$" "." "%(o?)xdvi %dS %d")
598 ("^pdf$" "." "evince %o")
599 ("^html?$" "." "netscape %o")))
601 (setq reftex-use-external-file-finders t
602 reftex-auto-recenter-toc t)
604 (setq reftex-label-alist
605 '(("theorem" ?T "th:" "~\\ref{%s}" t ("theorems?" "th\\.") -2)
606 ("axiom" ?A "ax:" "~\\ref{%s}" t ("axioms?" "ax\\.") -2)
607 ("definition" ?D "def:" "~\\ref{%s}" t ("definitions?" "def\\.") -2)
608 ("proposition" ?P "prop:" "~\\ref{%s}" t
609 ("propositions?" "prop\\.") -2)
610 ("lemma" ?P "lem:" "~\\ref{%s}" t ("lemmas?" "lem\\.") -2)
611 ("example" ?X "eg:" "~\\ref{%s}" t ("examples?") -2)
612 ("exercise" ?E "ex:" "~\\ref{%s}" t ("exercises?" "ex\\.") -2)
613 ("enumerate" ?i "i:" "~\\ref{%s}" item ("items?"))))
614 (setq reftex-section-prefixes
619 (setq bibtex-field-delimiters 'double-quotes
620 bibtex-entry-format '(realign opts-or-alts required-fields
621 numerical-fields last-comma delimiters
623 bibtex-include-OPTkey nil)
625 ;;;----- SLIME setup --------------------------------------------------------
628 (if (not mdw-fast-startup)
630 (require 'slime-autoloads)
631 (slime-setup '(slime-autodoc slime-c-p-c)))))
633 (let ((stuff '((cmucl ("cmucl"))
634 (sbcl ("sbcl") :coding-system utf-8-unix)
635 (clisp ("clisp") :coding-system utf-8-unix))))
636 (or (boundp 'slime-lisp-implementations)
637 (setq slime-lisp-implementations nil))
639 (let* ((head (car stuff))
640 (found (assq (car head) slime-lisp-implementations)))
641 (setq stuff (cdr stuff))
643 (rplacd found (cdr head))
644 (setq slime-lisp-implementations
645 (cons head slime-lisp-implementations))))))
646 (setq slime-default-lisp 'sbcl)
648 ;;;----- Blogging -----------------------------------------------------------
650 (setq weblogger-config-alist
653 ("server-url" . "http://vox.distorted.org.uk/admin/mt-xmlrpc.cgi")
656 ;;;----- Shell mode ---------------------------------------------------------
658 ;; --- Make the shell mode aware of my prompt ---
660 (setq shell-prompt-pattern "^[^]#$%>»}\n]*[]#$%>»}] *")
661 (setq comint-password-prompt-regexp
662 (concat "\\(\\([Oo]ld \\|[Nn]ew \\|[a-zA-Z0-9_]*'s \\|^\\)"
663 "[Pp]assword\\|pass phrase\\):\\s *\\'"))
665 ;; --- Notice passwords, and make C-a work right ---
667 (add-hook 'shell-mode-hook #'mdw-sh-mode-setup)
668 (add-hook 'shell-mode-hook #'ansi-color-for-comint-mode-on)
669 (setq shell-font-lock-keywords nil)
671 (add-hook 'term-mode-hook #'mdw-term-mode-setup)
673 ;;;----- Finishing touches --------------------------------------------------
675 (trap (select-window mdw-init-window))
676 (provide 'emacs-init)
678 ;;;----- That's all, folks --------------------------------------------------