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