emacs: Don't back up boring files like commit messages.
[profile] / emacs
CommitLineData
502f4699 1;;; -*- mode: emacs-lisp; coding: utf-8 -*-
f617db13 2;;;
f617db13
MW
3;;; Emacs configuration file
4;;;
5;;; (c) 1996-1999 Mark Wooding
6;;;
7
8;;;----- Licensing notice ---------------------------------------------------
9;;;
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.
14;;;
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.
19;;;
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
23
24(setq load-path (nconc load-path (list "~/lib/emacs")))
25(require 'dot-emacs)
26
27;;;----- Some random initialisation -----------------------------------------
28
29(setq mdw-init-window (selected-window))
30
31;; --- Load some other bits of code ---
32
400223a1
MW
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)
459c9fb2
MW
38(maybe-autoload 'git-blame-mode "git-blame" nil t)
39(maybe-autoload 'stgit "stgit" nil t)
400223a1
MW
40(and (library-exists-p "vc-git")
41 (not (memq 'GIT vc-handled-backends))
308b0b57 42 (setq vc-handled-backends (cons 'GIT vc-handled-backends)))
400223a1 43(and (library-exists-p "quilt")
c7a8da49 44 (not mdw-fast-startup)
400223a1 45 (load "quilt"))
f617db13 46
c7a8da49 47(trap (or mdw-fast-startup (require 'tex-site)))
f617db13
MW
48
49;; --- Skeleton stuff ---
50
c7a8da49 51(trap (or mdw-fast-startup (require 'skel-init)))
f617db13
MW
52
53;; --- Window system-dependent things ---
54
55(require 'paren)
56(trap (show-paren-mode t))
57(or window-system (menu-bar-mode -1))
58
59;; --- Temporary directory handling ---
60
61(defun mdw-check-dir-exists (dir)
62 (and dir
63 (file-directory-p dir)
64 dir))
65(setq tmpdir (or (mdw-check-dir-exists (getenv "TMPDIR"))
66 (mdw-check-dir-exists (format "/tmp/%s" (user-login-name)))
67 "/tmp"))
68
69;; --- Emacs server behaviour ---
70
71(and window-system
72 (trap (gnuserv-start)
73 (setq server-temp-file-regexp (concat "^" tmpdir "\\|/draft$"))))
74
75;; --- Control backup behaviour ---
76
77(setq backup-by-copying nil)
78(setq backup-by-copying-when-linked t)
79(setq backup-by-copying-when-mismatch t)
80
2ae647c4
MW
81(setq mdw-backup-disable-regexps
82 '("/\\.git/COMMIT_EDITMSG$"
83 "/\\.stgit\\(-edit\\.txt\\|msg\\.txt\\|\\.msg\\)$"))
84
f617db13
MW
85;; --- Calculator fiddling ---
86
87(setq calc-settings-file "~/.emacs-calc")
88(load calc-settings-file)
89
90;; ---- Some mail and news configuration ---
91
92(setq mail-from-style 'parens)
93(setq mail-signature t)
94(setq mail-yank-prefix "> ")
95(setq mail-archive-file-name "~/Mail/sent")
96
97(setq rmail-display-summary t)
98(setq rmail-file-name "~/Mail/rmail")
99
f617db13
MW
100;; --- Internationalization twiddling ---
101
102(trap
bc30f5c4 103 ;; Have top-bit-set characters work properly in terminals.
f617db13
MW
104 (let ((im (current-input-mode)))
105 (apply #'set-input-mode
bc30f5c4 106 (nconc (list (nth 0 im) (nth 1 im) 0) (nthcdr 3 im)))))
f617db13
MW
107
108;; --- Don't disable any commands ---
109
110(mapatoms #'(lambda (sym) (put sym 'disabled nil)))
111
112;; --- Split a wide window ---
113
114(mdw-divvy-window)
115
1a4d7e7d
MW
116;; --- Postscript printing ---
117
118(setq ps-paper-type 'a4
119 ps-print-color-p nil
120 ps-landscape-mode t
121 ps-number-of-columns 3
122 ps-font-family 'Courier
b5ffc3eb 123 ps-font-size 4)
1a4d7e7d
MW
124
125;; --- Splash screen stuff ---
126
127(or window-system
128 (setq inhibit-splash-screen t
129 inhibit-startup-message t))
130
f617db13
MW
131;; --- Other goodies ---
132
89a72209 133(trap (resize-minibuffer-mode 1)) ;Make minibuffer grow dynamically
f617db13
MW
134(auto-compression-mode 1) ;Enable automatic compression
135(setq dabbrev-case-replace nil) ;Retain case when completing
136(setq next-line-add-newlines nil) ;Don't add weird newlines
137(setq split-height-threshold 45) ;Reuse windows where sensible
138(setq dired-deletion-confirmer ;Make deletion easier in dired
139 (symbol-function 'y-or-n-p))
140(setq dired-listing-switches "-alF") ;Do `ls -F' things in dired windows
c7a8da49 141(setq wdired-allow-to-change-permissions t)
f617db13
MW
142(setq case-fold-file-names nil) ;Don't translate file names (grr...)
143(setq scroll-step 5) ;Don't scroll too much at a time
144(setq-default fill-column 77) ;I use rather narrow windows
145(setq-default comment-column 40) ;Set a standard comment column
146(setq-default truncate-partial-width-windows nil)
8c521a22 147(setq woman-use-own-frame nil) ;Keep man pages somewhere sensible
f617db13
MW
148(setq diff-switches "-u" ;I like reading unified diffs
149 cvs-diff-flags (list diff-switches))
150(setq echo-keystrokes 10) ;Long delay before keystrokes echo
151(setq ange-ftp-ftp-program-name "pftp") ;Use passive FTP
152(setq find-ls-option ;Build file lists efficiently
153 '("-print0 | xargs -0r ls -ld" . "ld"))
6006518e 154(setq bookmark-save-flag 0) ;Save bookmarks automatically
f617db13 155(setq Info-fontify-maximum-menu-size 60000)
cbffcf2b
MW
156(setq ispell-program-name "aspell"
157 ispell-local-dictionary "en_GB-ize-w_accents"
158 flyspell-default-dictionary "en_GB-ize-w_accents"
689009c0 159 ispell-silently-savep t)
f617db13
MW
160(trap
161 (require 'uniquify)
162 (setq uniquify-buffer-name-style 'post-forward-angle-brackets)
163 (setq uniquify-after-kill-buffer-p t))
164(transient-mark-mode t)
165(trap
166 (tooltip-mode 0)
167 (tool-bar-mode 0))
4ae85887 168(trap (or mdw-fast-startup (global-auto-revert-mode t)))
f617db13
MW
169(setq psgml-html-build-new-buffer nil)
170
f141fe0f
MW
171(setq cltl2-root-url (mdw-config 'cltl-url))
172(setq common-lisp-hyperspec-root (mdw-config 'hyperspec-url))
173
174;;;----- W3 and URL fetching stuff ------------------------------------------
175
45d17e24 176(let ((proxy (mdw-config 'http-proxy)))
f141fe0f
MW
177 (setq url-proxy-services
178 `(("http" . ,proxy)
179 ("ftp" . ,proxy)
180 ("gopher" . ,proxy))))
181(setq url-cookie-untrusted-urls '("."))
852cd5fb 182
a203fba8
MW
183(setq browse-url-browser-function (mdw-good-url-browser)
184 browse-url-mozilla-program "firefox")
9b72460c
MW
185
186(setq w3m-default-display-inline-images t)
187
f141fe0f
MW
188(setq w3-do-incremental-display t
189 w3-use-menus '(file edit view go bookmark options
190 buffers style search emacs nil help)
191 w3-display-inline-image t
192 w3-keybinding 'info)
f617db13
MW
193
194;;;----- Calendar configuration ---------------------------------------------
195
196;; --- Trivial stuff for the sunrise/sunset calculations ---
197
198(setq calendar-latitude 52.2)
199(setq calendar-longitude 0.1)
200(setq calendar-location-name "Cambridge, UK")
201
202;; --- Date format fiddling ---
203
204(setq european-calendar-style t)
205
206(setq diary-date-forms '((day "[-/]" month "[^-/0-9]")
207 (day " *" monthname "[ \t]*\\(\^M\\|\n\\)")
208 (backup day " *" monthname "\\W+\\<[^*0-9]")
209 (day "[-/]" month "[-/]" year "[^0-9]")
210 (day " *" monthname " *" year "[^0-9]")
211 (year "[-/]" month "[-/]" day "[^0-9]")
212 (dayname "\\W")))
213
214;; --- Fancy diary handling ---
215
216(add-hook 'diary-display-hook 'fancy-diary-display)
217(setq diary-list-include-blanks t)
218(add-hook 'list-diary-entries-hook 'sort-diary-entries t)
219(add-hook 'list-diary-entries-hook 'include-other-diary-files)
220(add-hook 'mark-diary-entries-hook 'mark-included-diary-files)
221
222;; --- Appointment management ---
223
224(add-hook 'diary-hook 'appt-make-list)
225(setq appt-issue-message t)
226(setq appt-display-interval 3)
227(setq appt-message-warning-time 10)
228
229;; --- Cosmetic stuff ---
230
231(setq display-time-24hr-format t)
232(display-time)
233(trap
234 (if window-system
235 (let ((view-diary-entries-initially t))
236 (calendar))))
237
238(defvar mdw-black-background t)
239
240;; --- Define more mode hooks for MailCrypt ---
241
242(setq mdw-mc-modes
243 '((mdwmail-mode (encrypt . mdwmail-mc-encrypt)
244 (sign . mdwmail-mc-sign))))
245
246;; --- Load the MailCrypt support ---
247
248(trap
249 (and (string-match "linux" (symbol-name system-type))
c7a8da49 250 (not mdw-fast-startup)
f617db13
MW
251 (progn (require 'mailcrypt-init)
252 (require 'mailcrypt)
253 (setq mc-default-scheme 'mc-scheme-gpg)
254 (setq mc-pgp-user-id "mdw-nsict-pgp")
255 (setq mc-gpg-user-id "mdw-nsict-gpg")
256 (setq mc-modes-alist (append mc-modes-alist mdw-mc-modes))
257 (setq mc-pgp-always-sign t)
258 (setq mc-gpg-always-sign t)
259 (setq mc-always-replace 'never)
260 (setq mc-passwd-timeout 3600)
261 (setq mc-temp-directory tmpdir)
262 (setq mc-modes-alist (append mc-modes-alist mdw-mc-modes))
263 (define-key mc-write-mode-map "\C-c/S" 'mc-sign-region)
264 (define-key mc-write-mode-map "\C-c/E" 'mc-encrypt-region)
265 (add-hook 'text-mode-hook 'mc-install-write-mode))))
266
267;;;----- Other common declarations ------------------------------------------
268
269;; --- Default frame size ---
270
271(setq default-frame-alist
272 (mdw-uniquify-alist
273 '((width . 78)
274 (height . 33)
275 (vertical-scroll-bars . right))
276 (and window-system
277 '((cursor-type . bar)
b5d724dd
MW
278 (cursor-blink . t)
279 (left-fringe . 5)
280 (right-fringe . 5)
281 (scroll-bar-width . 15)))
f617db13
MW
282 '((cursor-color . "red"))
283 (if mdw-black-background
284 '((background-color . "black")
285 (foreground-color . "white")
286 (background-mode . dark))
287 '((background-mode . light)))
288 (and (eq window-system 'pm)
289 '((font . "-os2-System VIO-medium-r-normal--*-40-*-*-m-*-cp850")
290 (menu-font . "8.Helv")
291 (background-color . "lightgrey")))
292 '((transparency . t))
293 default-frame-alist))
294
295;; --- Other frame fiddling ---
296
297(setq frame-title-format '("" invocation-name "@" system-name ": %b"))
298
299;; --- Global keymap changes ---
300
301(trap
302 (windmove-default-keybindings)
303 (setq windmove-wrap-around t))
304(trap (iswitchb-mode))
b5d724dd 305(global-set-key "\M-#" 'calc-dispatch)
f617db13
MW
306(global-set-key [f4] 'query-replace-regexp)
307(global-set-key [f5] 'goto-line)
308(global-set-key [f6] 'auto-fill-mode)
309(global-set-key [f7] 'occur)
310(global-set-key [f8] 'undo)
311(global-set-key [f9] 'mdw-divvy-window)
312(global-set-key [insertchar] 'overwrite-mode)
313(global-set-key "\C-xm" 'vm-mail)
314(global-set-key "\C-x\C-n" 'skel-create-file)
315(global-set-key "\C-x4n" 'skel-create-file-other-window)
316(global-set-key "\C-x5n" 'skel-create-file-other-frame)
317(global-set-key [delete] 'delete-char)
318(global-set-key "\C-[\C-m" 'call-last-kbd-macro)
319(global-set-key "\M-q" 'mdw-fill-paragraph)
320(global-set-key "\C-h\C-m" 'manual-entry)
321(global-set-key [mode-line C-mouse-1] 'mouse-tear-off-window)
322(global-set-key [vertical-scroll-bar C-down-mouse-1]
323 'mouse-drag-vertical-line)
324(global-set-key [vertical-scroll-bar C-mouse-1]
325 #'(lambda () (interactive)))
326(global-set-key [mouse-4] 'mdw-wheel-up)
327(global-set-key [mouse-5] 'mdw-wheel-down)
328
329;; --- Recognising types of files ---
330
331(setq auto-mode-alist
332 (append `(("\\.p[lm]$" . perl-mode)
333 ("\\.m$" . objc-mode)
334 ("\\.mxd$" . c-mode)
e808c1e5 335 ("\\.cs" . csharp-mode)
f617db13
MW
336 ;; ("/[ch]/" . c-mode)
337 (,(concat "/\\("
338 "\\.stgit\\.msg" "\\|"
339 "\\.git/COMMIT_EDITMSG" "\\|"
340 "svn-commit\\.tmp" "\\|"
341 "svk-commit[^/.]*\\.tmp"
342 "\\)$")
343 . text-mode)
344 (,(concat "^" tmpdir "/\\("
345 "svk-commit[^/.]*\\.tmp" "\\|"
346 "gitci\\.[^/.]*" "\\|"
347 "cvs[^/.]\\{6\\}" "\\|"
400223a1 348 "quilt_header\.[^/.]\\{6\\}"
f617db13
MW
349 "\\)$")
350 . text-mode)
351 ("\\.calc?$" . apcalc-mode)
352 ("/src/linux/.*\\.\\(c\\|h\\|cc\\)$" . linux-c-mode)
353 ("/\\(s\\|sh\\)/" . arm-assembler-mode)
354 ("\\.\\(cmd\\|exec\\|rexx\\)$" . rexx-mode)
355 ("\\.st$" . smalltalk-mode)
1e52f579
MW
356 ("\\.msgs$" . messages-mode)
357 ("/all-cmds\\.in$" . cpp-messages-mode)
f617db13
MW
358 ("\\.\\(tex\\|dtx\\)$" . latex-mode)
359 ("\\.gc$" . haskell.-mode)
360 (,(concat "^" (getenv "HOME") "/News/") . mdwmail-mode)
361 (,(concat "^" tmpdir "/\\(SLRN\\|snd\\|pico\\)")
362 . mdwmail-mode))
363 auto-mode-alist))
364
27cb4215
MW
365(setq interpreter-mode-alist
366 (append `(("runlisp" . lisp-mode))
367 interpreter-mode-alist))
368
f617db13
MW
369(setq completion-ignored-extensions
370 (append `(".hc" ".hi") completion-ignored-extensions))
371
372;; --- Some common local definitions ---
373
374(make-variable-buffer-local 'mdw-auto-indent)
375
376(mapcar (lambda (hook) (add-hook hook 'mdw-misc-mode-config))
377 '(c-mode-hook c++-mode-hook objc-mode-hook java-mode-hook
378 perl-mode-hook cperl-mode-hook python-mode-hook awk-mode-hook
30c8a8fb 379 tcl-mode-hook asm-mode-hook
f617db13
MW
380 TeX-mode-hook LaTeX-mode-hook TeXinfo-mode-hook
381 tex-mode-hook latex-mode-hook texinfo-mode-hook
382 emacs-lisp-mode-hook scheme-mode-hook
383 lisp-mode-hook lisp-interaction-mode-hook inferior-lisp-mode-hook
384 slime-repl-mode-hook
385 sml-mode-hook haskell-mode-hook
386 smalltalk-mode-hook rexx-mode-hook
387 arm-assembler-mode-hook))
388
389(global-font-lock-mode t)
390(defalias 'perl-mode 'cperl-mode)
391
392;;;----- Rootly editingness -------------------------------------------------
393
394(eval-after-load "tramp"
395 '(progn
396 (setq tramp-methods
397 (mdw-uniquify-alist
398 `(("become"
399 (tramp-connection-function tramp-open-connection-su)
400 (tramp-remote-sh "/bin/sh")
401 (tramp-login-program "become")
402 (tramp-copy-program nil)
403 (tramp-copy-args nil)
404 (tramp-copy-keep-date-arg nil)
405 (tramp-login-args ("TERM=dumb" "%u")))
406 ("really"
407 (tramp-connection-function tramp-open-connection-su)
408 (tramp-login-program "really")
409 (tramp-login-args ("-u" "%u" "--"
410 "env" "TERM=dumb" "/bin/sh"))
411 (tramp-copy-program nil)
412 (tramp-copy-args nil)
413 (tramp-copy-keep-date-arg nil)
414 (tramp-remote-sh "/bin/sh"))
415 ,@tramp-methods)))
416 (setq tramp-multi-connection-function-alist
417 (mdw-uniquify-alist
418 '(("bc" tramp-multi-connect-su "become TERM=dumb %u%n"))
419 '(("r" tramp-multi-connect-su "really -u %u%n"))
420 tramp-multi-connection-function-alist))
421 (setq tramp-default-method "ssh")
422 (setq tramp-default-method-alist
423 `(("\\`localhost\\'" ""
424 ,(cond ((executable-find "become") "become")
425 ((executable-find "really") "really")
426 (t "su")))))))
427
428;;;----- General fontification ----------------------------------------------
429
430;; --- Configure lazy fontification ---
431
f29cc9b2
MW
432(and (fboundp 'lazy-lock-mode)
433 (setq font-lock-support-mode 'lazy-lock-mode))
f617db13
MW
434; (setq lazy-lock-defer-contextually t)
435(setq lazy-lock-defer-time nil)
436(setq font-lock-maximum-decoration 3)
437(setq lazy-lock-minimum-size 0)
438(setq lazy-lock-stealth-time 5)
439(setq lazy-lock-stealth-lines 100)
440(setq lazy-lock-stealth-verbose t)
441
442(add-hook 'after-make-frame-functions 'mdw-do-set-font)
443(add-hook 'term-setup-hook (lambda () (mdw-do-set-font (selected-frame))))
444(add-hook 'window-setup-hook (lambda () (mdw-do-set-font (selected-frame))))
445
446(add-hook 'c-mode-hook 'mdw-fontify-c-and-c++ t)
447(add-hook 'objc-mode-hook 'mdw-fontify-c-and-c++ t)
448(add-hook 'c++-mode-hook 'mdw-fontify-c-and-c++ t)
449(add-hook 'linux-c-mode-hook #'(lambda () (setq c-basic-offset 8)))
30c8a8fb 450(add-hook 'asm-mode-hook 'mdw-fontify-asm t)
f617db13
MW
451
452(add-hook 'apcalc-mode-hook 'mdw-misc-mode-config t)
453(add-hook 'apcalc-mode-hook 'mdw-fontify-apcalc t)
454
455(add-hook 'java-mode-hook 'mdw-fontify-java t)
456
457(add-hook 'awk-mode-hook 'mdw-fontify-awk t)
458
459(add-hook 'perl-mode-hook 'mdw-fontify-perl t)
460(add-hook 'cperl-mode-hook 'mdw-fontify-perl t)
461
462(setq-default py-indent-offset 2)
463(add-hook 'python-mode-hook 'mdw-fontify-python t)
464
465(setq-default tcl-indent-level 2)
466(add-hook 'tcl-mode-hook 'mdw-fontify-tcl t)
467
468(add-hook 'rexx-mode-hook 'mdw-fontify-rexx t)
469
470(setq sml-nested-if-indent t)
471(setq sml-case-indent nil)
472(setq sml-indent-level 4)
473(setq sml-type-of-indent nil)
474(add-hook 'sml-mode-hook 'mdw-fontify-sml t)
475
476(add-hook 'haskell-mode-hook 'mdw-fontify-haskell t)
477(setq-default haskell-indent-offset 2)
478
479(add-hook 'texinfo-mode-hook 'mdw-fontify-texinfo t)
480(add-hook 'TeXinfo-mode-hook 'mdw-fontify-texinfo t)
481
482(setq LaTeX-table-label "tbl:")
483(setq-default TeX-master nil)
484;; (setq TeX-parse-self t)
485;; (setq TeX-auto-save t)
486(setq TeX-auto-untabify nil)
487(add-hook 'TeX-mode-hook 'mdw-fontify-tex t)
488(add-hook 'tex-mode-hook 'mdw-fontify-tex t)
489(add-hook 'LaTeX-mode-hook 'mdw-fontify-tex t)
490(add-hook 'latex-mode-hook 'mdw-fontify-tex t)
491
492(add-hook 'sh-mode-hook #'mdw-setup-sh-script-mode)
ec007bea
MW
493(add-hook 'autoconf-mode-hook #'mdw-setup-m4)
494(add-hook 'm4-mode-hook #'mdw-setup-m4)
f617db13
MW
495
496(add-hook 'smalltalk-mode-hook 'mdw-fontify-smalltalk t)
497(add-hook 'smalltalk-mode-hook 'mdw-setup-smalltalk t)
498
499(add-hook 'emacs-lisp-mode-hook 'mdw-fontify-lispy t)
500(add-hook 'scheme-mode-hook 'mdw-fontify-lispy t)
501(add-hook 'lisp-mode-hook 'mdw-fontify-lispy t)
502(add-hook 'inferior-lisp-mode-hook 'mdw-fontify-lispy t)
503(add-hook 'lisp-interaction-mode-hook 'mdw-fontify-lispy t)
504(add-hook 'slime-repl-mode-hook 'mdw-fontify-lispy t)
505(add-hook 'lisp-mode-hook 'mdw-common-lisp-indent t)
801a881a 506(trap
c7a8da49
MW
507 (if (not mdw-fast-startup)
508 (progn
509 (require 'slime-autoloads)
510 (slime-setup '(slime-autodoc)))))
f617db13
MW
511(add-hook 'inferior-lisp-mode-hook
512 #'(lambda ()
513 (local-set-key "\C-m" 'comint-send-and-indent)) t)
514
515(add-hook 'text-mode-hook 'mdw-text-mode t)
516
e9955c63
MW
517;;;----- TeX stuff ----------------------------------------------------------
518
519(setq TeX-output-view-style
520 '(("^dvi$"
521 ("^landscape$" "^pstricks$\\|^pst-\\|^psfrag$")
522 "%(o?)dvips -t landscape %d -o && evince %f")
523 ("^dvi$" "^pstricks$\\|^pst-\\|^psfrag$"
524 "%(o?)dvips %d -o && evince %f")
525 ("^dvi$"
526 ("^a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4$" "^landscape$")
527 "%(o?)xdvi %dS -paper a4r -s 0 %d")
528 ("^dvi$" "^a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4$"
529 "%(o?)xdvi %dS -paper a4 %d")
530 ("^dvi$"
531 ("^a5\\(?:comb\\|paper\\)$" "^landscape$")
532 "%(o?)xdvi %dS -paper a5r -s 0 %d")
533 ("^dvi$" "^a5\\(?:comb\\|paper\\)$" "%(o?)xdvi %dS -paper a5 %d")
534 ("^dvi$" "^b5paper$" "%(o?)xdvi %dS -paper b5 %d")
535 ("^dvi$" "^letterpaper$" "%(o?)xdvi %dS -paper us %d")
536 ("^dvi$" "^legalpaper$" "%(o?)xdvi %dS -paper legal %d")
537 ("^dvi$" "^executivepaper$" "%(o?)xdvi %dS -paper 7.25x10.5in %d")
538 ("^dvi$" "." "%(o?)xdvi %dS %d")
539 ("^pdf$" "." "evince %o")
540 ("^html?$" "." "netscape %o")))
541
c70671f3
MW
542;;;----- SLIME setup --------------------------------------------------------
543
544(let ((stuff '((cmucl ("cmucl"))
545 (sbcl ("sbcl") :coding-system utf-8-unix)
546 (clisp ("clisp") :coding-system utf-8-unix))))
547 (or (boundp 'slime-lisp-implementations)
548 (setq slime-lisp-implementations nil))
549 (while stuff
550 (let* ((head (car stuff))
551 (found (assq (car head) slime-lisp-implementations)))
552 (setq stuff (cdr stuff))
553 (if found
554 (rplacd found (cdr head))
555 (setq slime-lisp-implementations
556 (cons head slime-lisp-implementations))))))
557(setq slime-default-lisp 'sbcl)
558
f617db13
MW
559;;;----- Shell mode ---------------------------------------------------------
560
561;; --- Make the shell mode aware of my prompt ---
562
502f4699 563(setq shell-prompt-pattern "^[^]#$%>»}\n]*[]#$%>»}] *")
f617db13
MW
564(setq comint-password-prompt-regexp
565 (concat "\\(\\([Oo]ld \\|[Nn]ew \\|[a-zA-Z0-9_]*'s \\|^\\)"
566 "[Pp]assword\\|pass phrase\\):\\s *\\'"))
567
568;; --- Notice passwords, and make C-a work right ---
569
570(add-hook 'shell-mode-hook #'mdw-sh-mode-setup)
571
572(add-hook 'term-mode-hook #'mdw-term-mode-setup)
573
574;;;----- Finishing touches --------------------------------------------------
575
576(trap (select-window mdw-init-window))
577(provide 'emacs-init)
578
f617db13 579;;;----- That's all, folks --------------------------------------------------