chiark / gitweb /
Merge branch 'master' of git.distorted.org.uk:~mdw/publish/public-git/profile
[profile] / dot / 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
6f6c3649
MW
24(let ((path "~/lib/emacs/")
25 (pkgs (list "bbdb/" "multiple-cursors/" "rust-mode/"))
26 pkg)
27 (setq load-path (nconc load-path (list path)))
28 (while (setq pkg (pop pkgs))
29 (let ((dir (concat path pkg)))
30 (if (file-exists-p dir)
31 (setq load-path (nconc load-path (list dir))))))
32 (let ((boot (concat path "mdw-pkgs.el")))
33 (if (file-exists-p boot)
34 (load boot))))
35
f617db13 36(require 'dot-emacs)
a1bf764e 37(require 'cl)
f617db13 38
6132bc01
MW
39;;;--------------------------------------------------------------------------
40;;; Some random initialisation.
f617db13
MW
41
42(setq mdw-init-window (selected-window))
43
6132bc01 44;; Load some other bits of code.
f617db13 45
400223a1
MW
46(maybe-autoload 'cc-mode "cc-mode" nil t)
47(maybe-autoload 'rexx-mode "rexx-mode" nil t)
48(maybe-autoload 'cvs-update "pcl-cvs" nil t)
49(maybe-autoload 'debian-changelog-mode "debian-changelog-mode" nil t)
50(maybe-autoload 'git-status "git" nil t)
459c9fb2
MW
51(maybe-autoload 'git-blame-mode "git-blame" nil t)
52(maybe-autoload 'stgit "stgit" nil t)
b29312d0
MW
53(maybe-autoload 'nc-timesheet-prepare "nc-timesheet" nil t nil)
54(maybe-autoload 'nc-timesheet-submit "nc-timesheet" nil t nil)
55
eac7b622
MW
56(and (library-exists-p "debian-changelog-mode")
57 (add-to-list 'auto-mode-alist
58 `(,(concat "/debian/"
59 "\\("
01a478c2
MW
60 "[" "[:lower:]" "[:digit:]" "]"
61 "[" "[:lower:]" "[:digit:]" ".+-" "]+"
eac7b622
MW
62 "\\."
63 "\\)?"
64 "changelog\\'")
65 . debian-changelog-mode)))
66
400223a1
MW
67(and (library-exists-p "vc-git")
68 (not (memq 'GIT vc-handled-backends))
8d244e27 69 (not (memq 'Git vc-handled-backends))
79ba2d35 70 (not (memq 'git vc-handled-backends))
308b0b57 71 (setq vc-handled-backends (cons 'GIT vc-handled-backends)))
f617db13 72
0f2aab7b 73(setq magit-log-cutoff-length 512)
2285e371
MW
74(defun mdw-magit-try-load-config-extensions ()
75 (trap (magit-load-config-extensions)))
76(add-hook 'magit-mode-hook 'mdw-magit-try-load-config-extensions)
0f2aab7b 77
ab9e097f
MW
78(trap (or mdw-fast-startup (require 'p4)))
79
c7a8da49 80(trap (or mdw-fast-startup (require 'tex-site)))
f617db13 81
c07e3e33 82(trap (or mdw-fast-startup t (semantic-load-enable-code-helpers)))
33abafd2 83(setq semanticdb-default-save-directory "~/.emacs.d/semanticdb/")
e74ad275
MW
84(eval-after-load "senator"
85 '(setq isearch-mode-hook
86 (remq 'senator-isearch-mode-hook isearch-mode-hook)
87 isearch-mode-end-hook
88 (remq 'senator-isearch-mode-hook isearch-mode-end-hook)))
75bd2d66 89
6132bc01 90;; Skeleton stuff.
f617db13 91
c7a8da49 92(trap (or mdw-fast-startup (require 'skel-init)))
f617db13 93
6132bc01 94;; Window system-dependent things.
f617db13
MW
95
96(require 'paren)
97(trap (show-paren-mode t))
e8ea88ba 98(or window-system (mdw-emacs-version-p 22) (menu-bar-mode -1))
f617db13 99
c6fe19d5
MW
100;; Multiple cursors.
101
c6fe19d5
MW
102(global-set-key [?\C-c ?r] 'mdw-multiple-cursors-keymap)
103(autoload 'mdw-multiple-cursors-keymap "mdw-multiple-cursors.el"
104 "A keymap for Magnar Sveen's awesome multiple-cursors." nil 'keymap)
105
36db1ea7
MW
106;; Rust mode.
107
36db1ea7
MW
108(autoload 'rust-mode "rust-mode" nil t)
109(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))
110
6132bc01 111;; Temporary directory handling.
f617db13
MW
112
113(defun mdw-check-dir-exists (dir)
114 (and dir
115 (file-directory-p dir)
116 dir))
117(setq tmpdir (or (mdw-check-dir-exists (getenv "TMPDIR"))
118 (mdw-check-dir-exists (format "/tmp/%s" (user-login-name)))
119 "/tmp"))
120
6132bc01 121;; Emacs server behaviour.
f617db13 122
e8ea88ba 123(and (or window-system (mdw-emacs-version-p 23))
ccc2e1fa 124 (progn (setq server-temp-file-regexp (concat "^" tmpdir "\\|/draft$")
116259a9 125 edit-server-new-frame nil
ccc2e1fa 126 gnuserv-frame t)
116259a9
MW
127 (trap (server-start))
128 (trap (progn
129 (require 'edit-server)
955a327c
MW
130 (edit-server-start)
131 (let ((edit (get-process "edit-server")))
132 (and edit
133 (set-process-query-on-exit-flag edit nil)))))))
f617db13 134
6132bc01 135;; Control backup behaviour.
f617db13
MW
136
137(setq backup-by-copying nil)
138(setq backup-by-copying-when-linked t)
139(setq backup-by-copying-when-mismatch t)
140
2ae647c4
MW
141(setq mdw-backup-disable-regexps
142 '("/\\.git/COMMIT_EDITMSG$"
17fca674
MW
143 "/\\.stgit\\(-edit\\.txt\\|msg\\.txt\\|\\.msg\\)$"
144 "^/tmp/" "^/var/tmp/"))
2ae647c4 145
6132bc01 146;; Safe variables.
20d4403c
MW
147
148(setq safe-local-variable-values
149 '((make-backup-files . nil)))
150
6132bc01 151;; Calculator fiddling.
f617db13
MW
152
153(setq calc-settings-file "~/.emacs-calc")
154(load calc-settings-file)
155
156;; ---- Some mail and news configuration ---
157
c17fdbff 158(setq mail-from-style 'angles
c60cbbe8
MW
159 mail-signature t
160 mail-yank-prefix "> "
161 mail-archive-file-name "~/Mail/sent"
162 compose-mail-user-agent-warnings nil)
f617db13
MW
163
164(setq rmail-display-summary t)
165(setq rmail-file-name "~/Mail/rmail")
166
03f7e611
MW
167(setq sendmail-program "~/bin/sendmail-hack"
168 send-mail-function 'sendmail-send-it
169 mail-interactive t
170 sendmail-error-reporting-interactive '("-odb" "-oee"))
a3bdb4d9 171
cb1389c0
MW
172(setq mail-user-agent 'message-user-agent
173 read-mail-command 'gnus)
728fe976
MW
174(setq message-signature-separator "^-- \\(\\|\\[mdw\\]\\)$"
175 message-yank-prefix "> "
176 message-yank-cited-prefix "> "
98ed7cc2 177 message-send-mail-function 'message-send-mail-with-sendmail
03f7e611
MW
178 message-interactive t
179 message-sendmail-extra-arguments '("-odb" "-oee")
f646ea77 180 message-sendmail-envelope-from 'header
728fe976
MW
181 message-indent-citation-function '(message-indent-citation
182 mdw-trim-spaces-after-citing))
183
184(defun mdw-trim-spaces-after-citing ()
185 (save-excursion
186 (save-restriction
187 (narrow-to-region (point) (mark t))
188 (while (re-search-forward "^> +$" nil t)
189 (replace-match ">")))))
a3bdb4d9
MW
190
191(and (fboundp 'turn-on-gnus-dired-mode)
192 (not mdw-fast-startup)
193 (add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode))
194
195(or mdw-fast-startup
98a0bc3f 196 (trap (bbdb-initialize 'gnus 'sendmail 'message)))
58da3726 197(setq bbdb-file "~/etc/brain/bbdb"
8b5b8c6b 198 bbdb-north-american-phone-numbers-p nil
f23fd56d
MW
199 bbdb/news-auto-create-p
200 (lambda ()
201 (let ((group gnus-newsgroup-name))
202 (and (string-match "^nnimap\\+" group)
203 (not (string-match ":\\(crap\\|spam\\)\\." group)))))
43026cf3
MW
204 bbdb-user-mail-names
205 (concat "^"
206 "\\(" "\\(mdw\\|markw\\|root\\|postmaster\\)"
207 "\\([-+][^@]*\\|\\)"
208 "@\\(\\(dist\\|esc\\)orted\\.org\\.uk\\|odin\\.gg\\)"
209 "\\|" "distorted\\.mdw@g\\(\\|oogle\\)mail.com"
210 "\\|" "mwooding@\\(good\\|blackberry\\)\\.com"
211 "\\)$")
212 bbdb-canonicalize-net-hook
213 (lambda (addr)
214 (cond ((string-match (concat "^reply-[0-9a-f]+-[0-9a-f]+_"
215 "HTML-[0-9]+-[0-9]+-[0-9]+"
216 "@\\(nationwide-communications\\.co\\.uk\\)")
217 addr)
218 (concat "nationwide@" (match-string 1 addr)))
11faf2c5
MW
219 ((string-match (concat "^[0-9]+@bugs\\."
220 "\\(" "debian\\.org"
221 "\\|" "distorted\\.org\\.uk"
222 "\\)")
223 addr)
224 (concat "submit@bugs." (match-string 1 addr)))
2d14c353
MW
225 ((string-match "^\\([^@+]+\\)\\+[^@]*\\(@.*\\)$" addr)
226 (concat (match-string 1 addr) (match-string 2 addr)))
43026cf3 227 (t addr))))
a3bdb4d9 228
6132bc01 229;; Customization.
78100945
MW
230
231(setq custom-file "~/.emacs-custom")
232(trap (load custom-file))
233
234(trap (load "~/.emacs-local"))
235
6132bc01 236;; Internationalization twiddling.
f617db13
MW
237
238(trap
bc30f5c4 239 ;; Have top-bit-set characters work properly in terminals.
f617db13
MW
240 (let ((im (current-input-mode)))
241 (apply #'set-input-mode
bc30f5c4 242 (nconc (list (nth 0 im) (nth 1 im) 0) (nthcdr 3 im)))))
f617db13 243
6132bc01 244;; Don't disable any commands.
f617db13
MW
245
246(mapatoms #'(lambda (sym) (put sym 'disabled nil)))
247
6132bc01 248;; Split a wide window.
f617db13
MW
249
250(mdw-divvy-window)
251
6132bc01 252;; Postscript printing.
1a4d7e7d
MW
253
254(setq ps-paper-type 'a4
255 ps-print-color-p nil
256 ps-landscape-mode t
2c84dee2 257 ps-number-of-columns 2
1a4d7e7d 258 ps-font-family 'Courier
2c84dee2 259 ps-font-size 6.5)
1a4d7e7d 260
6132bc01 261;; Splash screen stuff.
1a4d7e7d
MW
262
263(or window-system
264 (setq inhibit-splash-screen t
265 inhibit-startup-message t))
266
6132bc01 267;; Other goodies.
f617db13 268
89a72209 269(trap (resize-minibuffer-mode 1)) ;Make minibuffer grow dynamically
f617db13 270(auto-compression-mode 1) ;Enable automatic compression
cf6c4653
MW
271(setq enable-local-variables :safe
272 enable-local-eval nil)
f617db13 273(setq dabbrev-case-replace nil) ;Retain case when completing
e2363e48 274(setq linum-format "%7d ")
f617db13 275(setq next-line-add-newlines nil) ;Don't add weird newlines
9a60965e 276(setq split-height-threshold nil) ;Reuse windows where sensible
9aea0679
MW
277(setq display-buffer-reuse-frames nil ;Don't confuse me by showing buffers
278 iswitchb-default-method 'samewindow) ;in other random frames
f617db13 279(setq dired-deletion-confirmer ;Make deletion easier in dired
f3f0c0a0
MW
280 (symbol-function 'y-or-n-p)
281 dired-listing-switches "-alF" ;Do `ls -F' things in dired windows
282 wdired-allow-to-change-permissions 'advanced)
85dc07c7 283(setq read-quoted-char-radix 16) ;C-q HEX-STUFF [RET]
f617db13
MW
284(setq case-fold-file-names nil) ;Don't translate file names (grr...)
285(setq scroll-step 5) ;Don't scroll too much at a time
286(setq-default fill-column 77) ;I use rather narrow windows
287(setq-default comment-column 40) ;Set a standard comment column
a2f12a94
MW
288(setq-default truncate-partial-width-windows nil
289 truncate-lines t)
3459d2cb
MW
290(setq default-indicate-empty-lines t)
291(setq whitespace-style
11a169c1 292 '(trailing space-before-tab space-after-tab empty indentation face))
4d4f9ad1
MW
293(setq woman-use-own-frame nil ;Keep man pages somewhere sensible
294 woman-fill-column 72) ;Right margin position.
f617db13
MW
295(setq diff-switches "-u" ;I like reading unified diffs
296 cvs-diff-flags (list diff-switches))
297(setq echo-keystrokes 10) ;Long delay before keystrokes echo
298(setq ange-ftp-ftp-program-name "pftp") ;Use passive FTP
299(setq find-ls-option ;Build file lists efficiently
300 '("-print0 | xargs -0r ls -ld" . "ld"))
6006518e 301(setq bookmark-save-flag 0) ;Save bookmarks automatically
91dba4e4 302(setq x-gtk-file-dialog-help-text nil)
e34a133f 303(setq Info-fontify-maximum-menu-size 100000)
3af826d8 304(setq set-mark-command-repeat-pop t)
38ddb67e 305(setq password-cache-expiry nil)
9de66169
MW
306(setq-default proced-filter 'all
307 proced-sort 'user)
68b2e9e6 308(setq ispell-program-name "aspell-hack"
cbffcf2b
MW
309 ispell-local-dictionary "en_GB-ize-w_accents"
310 flyspell-default-dictionary "en_GB-ize-w_accents"
30acc372
MW
311 ispell-local-dictionary-alist
312 '(("en_GB-ize-w_accents" "[[:alpha:]]" "[^[:alpha:]]" "'" t
313 ("-d" "en_GB-ize-w_accents") nil utf-8))
689009c0 314 ispell-silently-savep t)
f617db13
MW
315(trap
316 (require 'uniquify)
317 (setq uniquify-buffer-name-style 'post-forward-angle-brackets)
318 (setq uniquify-after-kill-buffer-p t))
319(transient-mark-mode t)
9958af68 320(setq mark-even-if-inactive t)
f617db13
MW
321(trap
322 (tooltip-mode 0)
323 (tool-bar-mode 0))
4ae85887 324(trap (or mdw-fast-startup (global-auto-revert-mode t)))
f617db13
MW
325(setq psgml-html-build-new-buffer nil)
326
3d6a7d27
MW
327(defvar mdw-black-background t)
328
5de5db48
MW
329(eval-after-load "outline"
330 '(progn
331 (trap (require 'foldout))
332 (define-key outline-mode-prefix-map [?\C-r] 'reveal-mode)
333 (define-key outline-mode-prefix-map [?\C--] 'mdw-outline-collapse-all)))
8fd1960c 334
56becc91
MW
335(setq imenu-auto-rescan t
336 imenu-auto-rescan-maxout (* 128 1024)
337 imenu-max-items 60)
338
f141fe0f
MW
339(setq cltl2-root-url (mdw-config 'cltl-url))
340(setq common-lisp-hyperspec-root (mdw-config 'hyperspec-url))
341
25b77072
MW
342(setq rfcview-rfc-location-pattern
343 "/ftp@mirror.distorted.org.uk:/pub/mirrors/rfc/rfc%s.txt"
344 rfcview-std-location-pattern
345 "/ftp@mirror.distorted.org.uk:/pub/mirrors/rfc/std/std%s.txt"
346 rfcview-index-location
347 "/ftp@mirror.distorted.org.uk:/pub/mirrors/rfc/rfc-index.txt")
348
6132bc01
MW
349;;;--------------------------------------------------------------------------
350;;; W3 and URL fetching stuff.
f141fe0f 351
45d17e24 352(let ((proxy (mdw-config 'http-proxy)))
f141fe0f
MW
353 (setq url-proxy-services
354 `(("http" . ,proxy)
355 ("ftp" . ,proxy)
356 ("gopher" . ,proxy))))
357(setq url-cookie-untrusted-urls '("."))
852cd5fb 358
a203fba8 359(setq browse-url-browser-function (mdw-good-url-browser)
ed5e20a5 360 browse-url-generic-program "mdw-chrome"
a0d16e44 361 browse-url-mozilla-program "mdw-iceweasel")
9b72460c 362
3d6231da
MW
363(setq w3m-default-display-inline-images t
364 w3m-use-cookies t)
9b72460c 365
b0ef6a66
MW
366(eval-after-load "w3m"
367 '(let ((entries '(("application/pdf" "\\.pdf\\'" ("evince" file) nil)
368 ("application/x-pdf" "\\.pdf\\'" ("evince" file) nil))))
369 (dolist (e entries)
370 (setq w3m-content-type-alist
371 (cons e (remove* (car e) w3m-content-type-alist
372 :key #'car :test #'string=))))))
373
f141fe0f
MW
374(setq w3-do-incremental-display t
375 w3-use-menus '(file edit view go bookmark options
376 buffers style search emacs nil help)
377 w3-display-inline-image t
378 w3-keybinding 'info)
f617db13 379
6132bc01
MW
380;;;--------------------------------------------------------------------------
381;;; Calendar configuration.
f617db13 382
2fddf4aa 383(setq diary-file
58da3726
MW
384 (let ((main-diary "~/etc/brain/diary")
385 (index "~/etc/index.diary"))
386 (if (file-exists-p index)
387 index
2fddf4aa 388 main-diary)))
ea09c6cb 389
6132bc01 390;; Trivial stuff for the sunrise/sunset calculations.
f617db13
MW
391
392(setq calendar-latitude 52.2)
393(setq calendar-longitude 0.1)
394(setq calendar-location-name "Cambridge, UK")
395
6132bc01 396;; Holidays.
a1293ade
MW
397
398(and (not mdw-fast-startup)
399 (trap
400 (require 'ew-hols)
401 (setq other-holidays (append english-and-welsh-bank-holidays
402 other-holidays))))
403
6132bc01 404;; Date format fiddling.
f617db13 405
13a077ae 406(setq european-calendar-style t
51603539
MW
407 calendar-date-style 'european
408 calendar-time-display-form
409 '(24-hours ":" minutes
410 (if time-zone " (") time-zone (if time-zone ")")))
f617db13 411
a677bd3a
MW
412(setq diary-date-forms
413 '((day "[-/]" month "[^-/0-9]")
414 (day " *" monthname "[ \t]*\\(\^M\\|\n\\)")
415 (backup day " *" monthname "\\W+\\<\\([^*0-9]\\|[0-9]+[:aApP]\\)")
416 (day "[-/]" month "[-/]" year "[^0-9]")
417 (day " *" monthname " *" year "[^0-9]")
418 (year "[-/]" month "[-/]" day "[^0-9]")
419 (dayname "\\W")))
f617db13 420
6132bc01 421;; Fancy diary handling.
f617db13
MW
422
423(add-hook 'diary-display-hook 'fancy-diary-display)
424(setq diary-list-include-blanks t)
0d4e1152
MW
425(cond ((mdw-emacs-version-p 23 1)
426 (add-hook 'list-diary-entries-hook 'diary-include-other-diary-files)
427 (add-hook 'mark-diary-entries-hook 'diary-mark-included-diary-files))
428 (t
429 (add-hook 'list-diary-entries-hook 'include-other-diary-files)
430 (add-hook 'mark-diary-entries-hook 'mark-included-diary-files)))
f617db13 431
6132bc01 432;; Appointment management.
f617db13
MW
433
434(add-hook 'diary-hook 'appt-make-list)
435(setq appt-issue-message t)
436(setq appt-display-interval 3)
437(setq appt-message-warning-time 10)
fc32103d
MW
438(and (not mdw-fast-startup)
439 (trap (appt-activate 1)))
f617db13 440
6132bc01 441;; Org-mode agenda.
2d6b9d95 442
e3f433a2 443(setq org-agenda-include-diary t
58da3726
MW
444 org-directory "~/etc/brain.local/"
445 org-default-notes-file (concat org-directory "local.org")
5d62fc5a
MW
446 org-tags-column -77
447 org-agenda-align-tags-to-column org-tags-column)
2d6b9d95 448
6132bc01 449;; Cosmetic stuff.
f617db13 450
8244840a
MW
451(setq calendar-view-diary-initially-flag nil
452 calendar-view-holidays-initially-flag nil
453 calendar-mark-diary-entries-flag t)
b7a7bc64 454
f617db13
MW
455(setq display-time-24hr-format t)
456(display-time)
dca9e3ae 457(column-number-mode 1)
8244840a
MW
458(trap
459 (if window-system
460 (let ((calendar-view-diary-initially-flag t))
461 (calendar))))
f617db13 462
6132bc01
MW
463;;;--------------------------------------------------------------------------
464;;; MailCrypt.
f617db13 465
6132bc01 466;; Define more mode hooks for MailCrypt.
f617db13
MW
467
468(setq mdw-mc-modes
469 '((mdwmail-mode (encrypt . mdwmail-mc-encrypt)
470 (sign . mdwmail-mc-sign))))
471
6132bc01 472;; Load the MailCrypt support.
f617db13
MW
473
474(trap
475 (and (string-match "linux" (symbol-name system-type))
c7a8da49 476 (not mdw-fast-startup)
f617db13
MW
477 (progn (require 'mailcrypt-init)
478 (require 'mailcrypt)
479 (setq mc-default-scheme 'mc-scheme-gpg)
480 (setq mc-pgp-user-id "mdw-nsict-pgp")
481 (setq mc-gpg-user-id "mdw-nsict-gpg")
482 (setq mc-modes-alist (append mc-modes-alist mdw-mc-modes))
483 (setq mc-pgp-always-sign t)
484 (setq mc-gpg-always-sign t)
485 (setq mc-always-replace 'never)
486 (setq mc-passwd-timeout 3600)
487 (setq mc-temp-directory tmpdir)
488 (setq mc-modes-alist (append mc-modes-alist mdw-mc-modes))
489 (define-key mc-write-mode-map "\C-c/S" 'mc-sign-region)
490 (define-key mc-write-mode-map "\C-c/E" 'mc-encrypt-region)
491 (add-hook 'text-mode-hook 'mc-install-write-mode))))
492
6132bc01
MW
493;;;--------------------------------------------------------------------------
494;;; Other common declarations.
f617db13 495
6132bc01 496;; Default frame size.
f617db13 497
8bf730c6
MW
498(setq frame-background-mode (if mdw-black-background 'dark 'light)
499 default-frame-alist
861e478a
MW
500 `((width . ,(if (>= emacs-major-version 21) 77 78))
501 (height . 33)
502 (vertical-scroll-bars . right)
503 (cursor-type . bar)
504 (cursor-blink . t)
505 (left-fringe . 5)
506 (right-fringe . 5)
507 (scroll-bar-width . 15)
e357ccfe
MW
508 (tool-bar-lines . 0)
509 (menu-bar-lines . 1)
861e478a 510 (cursor-color . "red")
8bf730c6 511 (background-mode . ,frame-background-mode))
e357ccfe
MW
512 initial-frame-alist
513 `((width . ,(if (>= emacs-major-version 21) 77 78))
514 (menu-bar-lines . ,(if window-system 1 0)))
861e478a 515 window-system-default-frame-alist
2dd9081f
MW
516 '((pm (font . "-os2-System VIO-medium-r-normal--*-40-*-*-m-*-cp850")
517 (menu-font . "8.Helv")
518 (background-color . "lightgrey"))
33fef33f 519 (w32 (font . "fixed613 10")
48c107b0
MW
520 (background-color . "black")
521 (foreground-color . "white"))
2dd9081f 522 (nil (menu-bar-lines . 0))))
f617db13 523
6132bc01 524;; Other frame fiddling.
f617db13
MW
525
526(setq frame-title-format '("" invocation-name "@" system-name ": %b"))
527
6132bc01 528;; Global keymap changes.
f617db13
MW
529
530(trap
f110f932
MW
531 (windmove-default-keybindings))
532(setq windmove-wrap-around t)
f617db13 533(trap (iswitchb-mode))
f9d83bff 534(progn
a1b01eb3
MW
535 (global-set-key [?\e ?\e] 'mdw-wrong)
536 (global-set-key [?\e ?\C-\] ?\C-\]] 'keyboard-escape-quit)
d015d85c
MW
537 (global-set-key [?\C-c ?w left] 'windmove-left)
538 (global-set-key [?\C-c ?w ?h] 'windmove-left)
539 (global-set-key [?\C-c ?w up] 'windmove-up)
540 (global-set-key [?\C-c ?w ?k] 'windmove-up)
541 (global-set-key [?\C-c ?w down] 'windmove-down)
542 (global-set-key [?\C-c ?w ?j] 'windmove-down)
543 (global-set-key [?\C-c ?w right] 'windmove-right)
544 (global-set-key [?\C-c ?w ?l] 'windmove-right)
545 (global-set-key [?\C-c ?g ?l] 'org-store-link)
546 (global-set-key [?\C-c ?g ?a] 'org-agenda)
547 (global-set-key [?\C-c ?g ?b] 'org-iswitchb)
548 (global-set-key [?\C-c ?t ?i] 'timeclock-in)
549 (global-set-key [?\C-c ?t ?c] 'timeclock-change)
550 (global-set-key [?\C-c ?t ?o] 'timeclock-out)
551 (global-set-key [?\C-c ?t ?r] 'timeclock-reread-log)
552 (global-set-key [?\C-c ?t ?w] 'timeclock-workday-remaining-string)
553 (global-set-key [?\C-c ?t ?s] 'timeclock-status-string)
3ba0b777 554 (global-set-key [?\C-x ?3] 'mdw-split-window-horizontally)
f9d83bff
MW
555 (global-set-key [?\M-#] 'calc-dispatch)
556 (global-set-key [?\C-x ?/] 'auto-fill-mode)
d2b58496 557 (global-set-key [?\C-c ?w ?d] 'mdw-divvy-window)
f9d83bff
MW
558 (global-set-key [insertchar] 'overwrite-mode)
559 (global-set-key [?\C-x ?\C-n] 'skel-create-file)
560 (global-set-key [?\C-x ?4 ?n] 'skel-create-file-other-window)
561 (global-set-key [?\C-x ?5 ?n] 'skel-create-file-other-frame)
562 (global-set-key [delete] 'delete-char)
563 (global-set-key [?\M-q] 'mdw-fill-paragraph)
564 (global-set-key [?\C-h ?\C-m] 'manual-entry)
565 (global-set-key [C-M-backspace] 'backward-kill-sexp)
566 (global-set-key [mode-line C-mouse-1] 'mouse-tear-off-window)
567 (global-set-key [vertical-scroll-bar C-down-mouse-1]
568 'mouse-drag-vertical-line)
569 (global-set-key [vertical-scroll-bar C-mouse-1]
570 #'(lambda () (interactive)))
56becc91 571 (global-set-key [M-S-mouse-3] 'imenu)
f9d83bff 572 (global-set-key [XF86WakeUp] "")
a41fc1c8
MW
573 (global-set-key [?\C-c ?d ?w] 'devhelp-word-at-point)
574 (global-set-key [?\C-c ?d ?a] 'devhelp-assistant-word-at-point)
f3674a83 575 (global-set-key [f11] 'mdw-toggle-full-screen)
f9d83bff
MW
576 (and (not mdw-fast-startup) (fboundp 'hippie-expand)
577 (global-set-key [?\M-/] 'hippie-expand)))
f617db13 578
cadc9736
MW
579(eval-after-load "dired"
580 '(progn
8cb828d5
MW
581 (or (lookup-key dired-mode-map [?\C-x ?\C-q])
582 (define-key dired-mode-map [?\C-x ?\C-q]
583 'wdired-change-to-wdired-mode))
d9d0aed3 584 (trap (require 'dired-x))
8cb828d5
MW
585 (and (fboundp 'dired-do-relsymlink)
586 (define-key dired-mode-map [?\C-c ?\C-s] 'dired-do-relsymlink))))
cadc9736 587
16fe7c41
MW
588(add-hook 'org-mode-hook
589 #'(lambda () (mdw-clobber-evil-keymap org-mode-map)))
590(add-hook 'org-agenda-mode-hook
591 #'(lambda () (mdw-clobber-evil-keymap org-agenda-mode-map)))
f351e828 592(or mdw-fast-startup
f6cd49f1
MW
593 (trap (progn
594 (org-remember-insinuate)
5b39779d 595 (global-set-key [?\C-c ?g ?r] 'org-remember))))
4849ea18 596
9b63bcd2
MW
597;; Minor mode listing
598
599(setq minor-mode-alist
600 (mdw-uniquify-alist '((reveal-mode (hs-minor-mode
601 " hs/r"
602 (global-reveal-mode
603 "" " Reveal")))
604 (hs-minor-mode (reveal-mode "" " hs"))
605 (abbrev-mode "")
606 (gtags-mode ""))
607 minor-mode-alist))
608
6132bc01 609;; Recognising types of files.
f617db13
MW
610
611(setq auto-mode-alist
7c061a6f 612 (append `(("\\.p[lm]$" . cperl-mode)
f617db13
MW
613 ("\\.m$" . objc-mode)
614 ("\\.mxd$" . c-mode)
e6cb5770 615 ("\\.cs$" . csharp-mode)
07965a39 616 ("\\.go$" . go-mode)
133cf81d 617 ("\\.org$" . org-mode)
10ac316c 618 ("\\.make$" . makefile-mode)
05f15fd7 619 ("\\.mk?d$" . markdown-mode)
f617db13
MW
620 ;; ("/[ch]/" . c-mode)
621 (,(concat "/\\("
622 "\\.stgit\\.msg" "\\|"
03372583 623 "\\.topmsg" "\\|"
f617db13
MW
624 "\\.git/COMMIT_EDITMSG" "\\|"
625 "svn-commit\\.tmp" "\\|"
626 "svk-commit[^/.]*\\.tmp"
627 "\\)$")
628 . text-mode)
629 (,(concat "^" tmpdir "/\\("
630 "svk-commit[^/.]*\\.tmp" "\\|"
631 "gitci\\.[^/.]*" "\\|"
632 "cvs[^/.]\\{6\\}" "\\|"
400223a1 633 "quilt_header\.[^/.]\\{6\\}"
f617db13
MW
634 "\\)$")
635 . text-mode)
636 ("\\.calc?$" . apcalc-mode)
637 ("/src/linux/.*\\.\\(c\\|h\\|cc\\)$" . linux-c-mode)
638 ("/\\(s\\|sh\\)/" . arm-assembler-mode)
639 ("\\.\\(cmd\\|exec\\|rexx\\)$" . rexx-mode)
640 ("\\.st$" . smalltalk-mode)
1e52f579
MW
641 ("\\.msgs$" . messages-mode)
642 ("/all-cmds\\.in$" . cpp-messages-mode)
f617db13
MW
643 ("\\.\\(tex\\|dtx\\)$" . latex-mode)
644 ("\\.gc$" . haskell.-mode)
645 (,(concat "^" (getenv "HOME") "/News/") . mdwmail-mode)
870778ff 646 (,(concat "^" tmpdir "/\\(SLRN\\|snd\\|pico\\|mutt\\)")
f617db13
MW
647 . mdwmail-mode))
648 auto-mode-alist))
649
27cb4215 650(setq interpreter-mode-alist
8b064239 651 (append `(("runlisp" . lisp-mode)
9a60965e 652 ("@BASH@" . sh-mode)
8b064239 653 ("@PYTHON@" . python-mode)
7c061a6f 654 ("@PERL@" . cperl-mode)
cf7fb3e1 655 ("perl" . cperl-mode)
8b064239 656 ("@TCLSH@" . tcl-mode)
6905514a 657 ("@WISH@" . tcl-mode)
cf7fb3e1
MW
658 ("tclsh" . tcl-mode)
659 ("wish" . tcl-mode))
27cb4215
MW
660 interpreter-mode-alist))
661
f617db13
MW
662(setq completion-ignored-extensions
663 (append `(".hc" ".hi") completion-ignored-extensions))
298fab5b
MW
664(dolist (dir (remove-if-not (lambda (ext)
665 (= (aref ext (- (length ext) 1)) ?/))
666 completion-ignored-extensions))
667 (if (/= (aref dir 0) ?/)
668 (setq completion-ignored-extensions
669 (cons (concat "/" dir)
670 (remove dir completion-ignored-extensions)))))
f617db13 671
6132bc01 672;; Some common local definitions.
f617db13
MW
673
674(make-variable-buffer-local 'mdw-auto-indent)
675
32194bba
MW
676(mapc (lambda (hook) (add-hook hook 'mdw-misc-mode-config))
677 '(c-mode-hook c++-mode-hook objc-mode-hook java-mode-hook
ad305d7e 678 csharp-mode-hook perl-mode-hook cperl-mode-hook dylan-mode-hook
32194bba 679 python-mode-hook pyrec-mode-hook icon-mode-hook awk-mode-hook
c24a0acd
MW
680 tcl-mode-hook go-mode-hook js-mode-hook javascript-mode-hook
681 conf-mode-hook m4-mode-hook autoconf-mode-hook autotest-mode-hook
81fb08fc 682 a68-mode-hook a68-mode-hooks asm-mode-hook fsharp-mode-hook
36db1ea7 683 scala-mode-hook rust-mode-hook TeX-mode-hook LaTeX-mode-hook
32194bba
MW
684 TeXinfo-mode-hook tex-mode-hook latex-mode-hook
685 texinfo-mode-hook emacs-lisp-mode-hook scheme-mode-hook
686 lisp-mode-hook lisp-interaction-mode-hook makefile-mode-hook
687 inferior-lisp-mode-hook slime-repl-mode-hook
688 sml-mode-hook haskell-mode-hook erlang-mode-hook
689 smalltalk-mode-hook rexx-mode-hook
690 arm-assembler-mode-hook))
f617db13
MW
691
692(global-font-lock-mode t)
f617db13 693
6132bc01
MW
694;;;--------------------------------------------------------------------------
695;;; Rootly editingness.
f617db13
MW
696
697(eval-after-load "tramp"
ae7460d4 698 '(let ((fix-args (if (mdw-version-< tramp-version "2.1")
507ebf80 699 #'append #'list)))
f617db13
MW
700 (setq tramp-methods
701 (mdw-uniquify-alist
702 `(("become"
703 (tramp-connection-function tramp-open-connection-su)
704 (tramp-remote-sh "/bin/sh")
705 (tramp-login-program "become")
706 (tramp-copy-program nil)
707 (tramp-copy-args nil)
708 (tramp-copy-keep-date-arg nil)
ae7460d4 709 (tramp-login-args ,(funcall fix-args `("TERM=dumb" "%u"))))
f617db13
MW
710 ("really"
711 (tramp-connection-function tramp-open-connection-su)
712 (tramp-login-program "really")
ae7460d4
MW
713 (tramp-login-args ,(funcall fix-args
714 `("-u" "%u")
715 `("--")
716 `("env" "TERM=dumb" "/bin/sh")))
f617db13
MW
717 (tramp-copy-program nil)
718 (tramp-copy-args nil)
719 (tramp-copy-keep-date-arg nil)
720 (tramp-remote-sh "/bin/sh"))
721 ,@tramp-methods)))
f617db13 722 (setq tramp-default-method "ssh")
415c9a27
MW
723 (let ((rootlyness (cond ((executable-find "really") "really")
724 ((executable-find "become") "become")
725 ((executable-find "sudo") "sudo")
ac667d04
MW
726 (t "su")))
727 (this-host (concat "\\`\\(localhost\\|"
728 (system-name) "\\|\\)\\'"))
729 (this-user (concat "\\`\\(" (user-login-name) "\\|"
730 (user-real-login-name) "\\|\\)\\'")))
415c9a27 731 (setq tramp-default-method-alist
ac667d04
MW
732 `((,this-host nil ,rootlyness)
733 (nil ,this-user "ssh")
734 (nil "." ,rootlyness)))
735 (setq tramp-default-proxies-alist
736 `((,this-host nil nil)
737 (nil "." "/ssh:%h:"))))))
f617db13 738
6132bc01
MW
739;;;--------------------------------------------------------------------------
740;;; General fontification.
f617db13 741
6132bc01 742;; Configure lazy fontification.
f617db13 743
f29cc9b2
MW
744(and (fboundp 'lazy-lock-mode)
745 (setq font-lock-support-mode 'lazy-lock-mode))
f617db13 746; (setq lazy-lock-defer-contextually t)
f9d83bff
MW
747(setq lazy-lock-defer-time nil
748 font-lock-maximum-decoration 3
749 lazy-lock-minimum-size 0
750 lazy-lock-stealth-time 5
751 lazy-lock-stealth-lines 100
752 lazy-lock-stealth-verbose t)
f617db13 753
f9d83bff
MW
754(progn
755 (add-hook 'c-mode-hook 'mdw-fontify-c-and-c++ t)
756 (add-hook 'objc-mode-hook 'mdw-fontify-c-and-c++ t)
757 (add-hook 'c++-mode-hook 'mdw-fontify-c-and-c++ t)
758 (add-hook 'linux-c-mode-hook #'(lambda () (setq c-basic-offset 8)))
759 (add-hook 'asm-mode-hook 'mdw-fontify-asm t)
07965a39 760 (add-hook 'go-mode-hook 'mdw-fontify-go t)
36db1ea7 761 (add-hook 'rust-mode-hook 'mdw-fontify-rust t)
f617db13 762
f9d83bff 763 (add-hook 'icon-mode-hook 'mdw-fontify-icon t)
f617db13 764
f9d83bff
MW
765 (add-hook 'apcalc-mode-hook 'mdw-misc-mode-config t)
766 (add-hook 'apcalc-mode-hook 'mdw-fontify-apcalc t)
cc1980e1 767
f9d83bff 768 (add-hook 'java-mode-hook 'mdw-fontify-java t)
52bcde59 769 (add-hook 'scala-mode-hook 'mdw-fontify-scala t)
61d63206 770 (add-hook 'js-mode-hook 'mdw-fontify-javascript t)
f9d83bff 771 (add-hook 'csharp-mode-hook 'mdw-fontify-csharp t)
81fb08fc
MW
772 (add-hook 'fsharp-mode-hook 'mdw-fontify-fsharp t)
773 (add-hook 'inferior-fsharp-mode-hooks 'mdw-fontify-inferior-fsharp t)
f617db13 774
f9d83bff 775 (add-hook 'awk-mode-hook 'mdw-fontify-awk t)
f617db13 776
f9d83bff
MW
777 (add-hook 'perl-mode-hook 'mdw-fontify-perl t)
778 (add-hook 'cperl-mode-hook 'mdw-fontify-perl t))
f617db13 779
f9d83bff
MW
780(progn
781 (setq-default py-indent-offset 2
85e430d4 782 python-indent 2
f9d83bff
MW
783 py-python-command-args
784 `("-i" "-colors" ,(if mdw-black-background
785 "Linux" "LightBG")))
786 (add-hook 'python-mode-hook 'mdw-fontify-python t)
787 (add-hook 'pyrex-mode-hook 'mdw-fontify-pyrex t))
f617db13
MW
788
789(setq-default tcl-indent-level 2)
790(add-hook 'tcl-mode-hook 'mdw-fontify-tcl t)
791
792(add-hook 'rexx-mode-hook 'mdw-fontify-rexx t)
793
f9d83bff
MW
794(setq sml-nested-if-indent t
795 sml-case-indent nil
796 sml-indent-level 4
797 sml-type-of-indent nil)
f617db13
MW
798(add-hook 'sml-mode-hook 'mdw-fontify-sml t)
799
800(add-hook 'haskell-mode-hook 'mdw-fontify-haskell t)
801(setq-default haskell-indent-offset 2)
802
2ded9493
MW
803(add-hook 'erlang-mode-hook 'mdw-fontify-erlang t)
804
f617db13
MW
805(add-hook 'texinfo-mode-hook 'mdw-fontify-texinfo t)
806(add-hook 'TeXinfo-mode-hook 'mdw-fontify-texinfo t)
807
808(setq LaTeX-table-label "tbl:")
f617db13
MW
809(setq TeX-auto-untabify nil)
810(add-hook 'TeX-mode-hook 'mdw-fontify-tex t)
811(add-hook 'tex-mode-hook 'mdw-fontify-tex t)
812(add-hook 'LaTeX-mode-hook 'mdw-fontify-tex t)
813(add-hook 'latex-mode-hook 'mdw-fontify-tex t)
814
815(add-hook 'sh-mode-hook #'mdw-setup-sh-script-mode)
ec007bea 816(add-hook 'autoconf-mode-hook #'mdw-setup-m4)
32194bba 817(add-hook 'autotest-mode-hook #'mdw-setup-m4)
ec007bea 818(add-hook 'm4-mode-hook #'mdw-setup-m4)
f617db13
MW
819
820(add-hook 'smalltalk-mode-hook 'mdw-fontify-smalltalk t)
821(add-hook 'smalltalk-mode-hook 'mdw-setup-smalltalk t)
822
7fce54c3
MW
823(add-hook 'a68-mode-hook 'mdw-fontify-algol-68 t)
824(add-hook 'a68-mode-hooks 'mdw-fontify-algol-68 t)
ad305d7e
MW
825(add-hook 'dylan-mode-hook 'mdw-fontify-dylan t)
826
f9d83bff
MW
827(progn
828 (add-hook 'emacs-lisp-mode-hook 'mdw-fontify-lispy t)
829 (add-hook 'scheme-mode-hook 'mdw-fontify-lispy t)
830 (add-hook 'lisp-mode-hook 'mdw-fontify-lispy t)
831 (add-hook 'inferior-lisp-mode-hook 'mdw-fontify-lispy t)
832 (add-hook 'lisp-interaction-mode-hook 'mdw-fontify-lispy t)
833 (add-hook 'slime-repl-mode-hook 'mdw-fontify-lispy t)
834 (add-hook 'lisp-mode-hook 'mdw-common-lisp-indent t)
835 (add-hook 'inferior-lisp-mode-hook
f617db13 836 #'(lambda ()
f9d83bff 837 (local-set-key "\C-m" 'comint-send-and-indent)) t))
f617db13
MW
838
839(add-hook 'text-mode-hook 'mdw-text-mode t)
840
6132bc01
MW
841;;;--------------------------------------------------------------------------
842;;; TeX stuff.
e9955c63
MW
843
844(setq TeX-output-view-style
845 '(("^dvi$"
846 ("^landscape$" "^pstricks$\\|^pst-\\|^psfrag$")
847 "%(o?)dvips -t landscape %d -o && evince %f")
848 ("^dvi$" "^pstricks$\\|^pst-\\|^psfrag$"
849 "%(o?)dvips %d -o && evince %f")
850 ("^dvi$"
851 ("^a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4$" "^landscape$")
852 "%(o?)xdvi %dS -paper a4r -s 0 %d")
853 ("^dvi$" "^a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4$"
854 "%(o?)xdvi %dS -paper a4 %d")
855 ("^dvi$"
856 ("^a5\\(?:comb\\|paper\\)$" "^landscape$")
857 "%(o?)xdvi %dS -paper a5r -s 0 %d")
858 ("^dvi$" "^a5\\(?:comb\\|paper\\)$" "%(o?)xdvi %dS -paper a5 %d")
859 ("^dvi$" "^b5paper$" "%(o?)xdvi %dS -paper b5 %d")
860 ("^dvi$" "^letterpaper$" "%(o?)xdvi %dS -paper us %d")
861 ("^dvi$" "^legalpaper$" "%(o?)xdvi %dS -paper legal %d")
862 ("^dvi$" "^executivepaper$" "%(o?)xdvi %dS -paper 7.25x10.5in %d")
863 ("^dvi$" "." "%(o?)xdvi %dS %d")
864 ("^pdf$" "." "evince %o")
865 ("^html?$" "." "netscape %o")))
866
88daf8fb
MW
867(setq TeX-view-program-selection
868 '(((output-dvi style-pstricks) "dvips and gv")
869 (output-dvi "xdvi")
870 (output-pdf "Evince")
871 (output-html "xdg-open")))
872
b615028c
MW
873(setq TeX-open-quote "\""
874 TeX-close-quote "\"")
875
ad21c20c
MW
876(setq reftex-use-external-file-finders t
877 reftex-auto-recenter-toc t)
878
879(setq reftex-label-alist
880 '(("theorem" ?T "th:" "~\\ref{%s}" t ("theorems?" "th\\.") -2)
881 ("axiom" ?A "ax:" "~\\ref{%s}" t ("axioms?" "ax\\.") -2)
882 ("definition" ?D "def:" "~\\ref{%s}" t ("definitions?" "def\\.") -2)
883 ("proposition" ?P "prop:" "~\\ref{%s}" t
884 ("propositions?" "prop\\.") -2)
4458f45a 885 ("lemma" ?L "lem:" "~\\ref{%s}" t ("lemmas?" "lem\\.") -2)
ad21c20c
MW
886 ("example" ?X "eg:" "~\\ref{%s}" t ("examples?") -2)
887 ("exercise" ?E "ex:" "~\\ref{%s}" t ("exercises?" "ex\\.") -2)
888 ("enumerate" ?i "i:" "~\\ref{%s}" item ("items?"))))
889(setq reftex-section-prefixes
890 '((0 . "part:")
891 (1 . "ch:")
892 (t . "sec:")))
55f80fae 893
cfabf52c
MW
894(setq bibtex-field-delimiters 'double-quotes
895 bibtex-entry-format '(realign opts-or-alts required-fields
896 numerical-fields last-comma delimiters
897 unify-case)
898 bibtex-include-OPTkey nil)
899
6132bc01
MW
900;;;--------------------------------------------------------------------------
901;;; SLIME setup.
c70671f3 902
ea8a749b
MW
903(trap
904 (if (not mdw-fast-startup)
905 (progn
906 (require 'slime-autoloads)
907 (slime-setup '(slime-autodoc slime-c-p-c)))))
908
c70671f3
MW
909(let ((stuff '((cmucl ("cmucl"))
910 (sbcl ("sbcl") :coding-system utf-8-unix)
911 (clisp ("clisp") :coding-system utf-8-unix))))
912 (or (boundp 'slime-lisp-implementations)
913 (setq slime-lisp-implementations nil))
914 (while stuff
915 (let* ((head (car stuff))
916 (found (assq (car head) slime-lisp-implementations)))
917 (setq stuff (cdr stuff))
918 (if found
919 (rplacd found (cdr head))
920 (setq slime-lisp-implementations
921 (cons head slime-lisp-implementations))))))
922(setq slime-default-lisp 'sbcl)
923
6132bc01
MW
924;;;--------------------------------------------------------------------------
925;;; Blogging.
362f6ac4
MW
926
927(setq weblogger-config-alist
928 '(("vox"
929 ("user" . "mdw")
930 ("server-url" . "http://vox.distorted.org.uk/admin/mt-xmlrpc.cgi")
931 ("weblog" . "1"))))
932
6132bc01
MW
933;;;--------------------------------------------------------------------------
934;;; Shell mode.
f617db13 935
6132bc01 936;; Make the shell mode aware of my prompt.
f617db13 937
ac4ae7cd 938(setq shell-prompt-pattern "^[^]#$%>»}\n]*\\([]#$%»}]\\|>>?\\) *")
f617db13 939(setq comint-password-prompt-regexp
ab9e097f 940 (concat "\\(\\([Ee]nter \\|[Oo]ld \\|[Nn]ew \\|[a-zA-Z0-9_]*'s \\|^\\)"
c70b4880 941 "[Pp]assword\\|[Pp]ass ?phrase\\(\\| [-a-zA-Z0-9._]+\\)\\):")
423716a6
MW
942 comint-file-name-chars "~/A-Za-z0-9+@:_.$#%,={}-"
943 shell-file-name-chars comint-file-name-chars)
f617db13 944
6132bc01 945;; Notice passwords, and make C-a work right.
f617db13
MW
946
947(add-hook 'shell-mode-hook #'mdw-sh-mode-setup)
21409787 948(add-hook 'shell-mode-hook #'ansi-color-for-comint-mode-on)
0805d57c 949(setq shell-font-lock-keywords nil)
f617db13
MW
950
951(add-hook 'term-mode-hook #'mdw-term-mode-setup)
952
6132bc01
MW
953;;;--------------------------------------------------------------------------
954;;; Finishing touches.
f617db13
MW
955
956(trap (select-window mdw-init-window))
957(provide 'emacs-init)
958
f617db13 959;;;----- That's all, folks --------------------------------------------------