chiark / gitweb /
bashrc: Read global and local completion runes.
[profile] / vm
CommitLineData
f617db13
MW
1;;; -*-emacs-lisp-*-
2;;;
3;;; Configuration for VM
4
370d4c8d
MW
5(let ((path exec-path))
6 (while path
7 (let ((try (expand-file-name "movemail" (car path))))
8 (if (file-executable-p try)
9 (setenv "REAL_MOVEMAIL" try))
10 (setq path (cdr path)))))
11
6b3f86c6
MW
12(setq vm-reply-subject-prefix "Re: "
13 vm-included-text-prefix "> "
14 vm-included-text-attribution-format "%F <%f> wrote:\n\n"
15 vm-folder-directory "~/Mail/"
16 vm-startup-with-summary t
17 vm-skip-deleted-messages nil
18 vm-circular-folders nil
19 vm-preview-lines nil
20 vm-highlighted-header-regexp "^From\\|^Subject"
370d4c8d 21 vm-movemail-program "movemail-hack"
6b3f86c6
MW
22 vm-delete-after-saving t
23 vm-move-after-deleting t
24 vm-delete-empty-folders)
25
26(setq vm-mime-qp-encoder-program "mimencode"
27 vm-mime-qp-encoder-switches '("-q")
28 vm-mime-qp-decoder-program "mimencode"
29 vm-mime-qp-decoder-switches '("-q" "-u")
30 vm-mime-base64-encoder-program "mimencode"
31 vm-mime-base64-encoder-switches '("-b")
32 vm-mime-base64-decoder-program "mimencode"
33 vm-mime-base64-decoder-switches '("-b" "-u"))
34
f617db13
MW
35(setq vm-visible-headers '("resent-from:" "from:" "reply-to:" "sender:"
36 "to:" "apparently-to:" "cc:"
37 "subject:" "date:"
38 "delivered-to:" "return-path:"))
6b3f86c6 39
f617db13
MW
40(setq vm-reply-ignored-addresses '("mdw@excessus\\.demon\\.co\\.uk"
41 "mdw@nsict\\.org" "mdw@eh\\.org"
42 "mdw@ncipher\\.com"
4b05ce02
MW
43 "mwooding@ncipher\\.com"
44 "submit@bugs\\.ncipher\\.com"
45 "mdw@chiark\\.greenend\\.org\\.uk"
f617db13
MW
46 "mdw@distorted\\.org\\.uk"
47 "mdw@metalzone\\.distorted\\.org\\.uk"
f617db13
MW
48 "tux@nsict\\.org"))
49
50(defvar mdw-mailing-lists
51 '("hibachi-dealers-members@chiark\\.greenend\\.org\\.uk"))
52
53(setq vm-mime-external-content-types-alist
4b05ce02
MW
54 '(("image/jpeg" "display")
55 ("image/jpg" "display")
56 ("image/gif" "display")
e4a505a0 57 ("image/bmp" "display")
4b05ce02
MW
58 ("image/tiff" "display")
59 ("application/postscript" "gv")
60 ("application/pdf" "gv")))
f617db13 61
4b05ce02 62(setq vm-url-browser "firefox")
f617db13
MW
63
64(setq vm-frame-parameter-alist
4b05ce02
MW
65 '((folder ((width . 81) (height . 33)))
66 (summary ((width . 81) (height . 33)))
e4a505a0 67 (primary-summary ((width . 81) (height . 33)))))
f617db13
MW
68
69(setq vm-auto-folder-alist
739cf036
MW
70 '(("delivered-to" ("root@" . "admin"))
71 ("from" ("Cron Daemon" . "admin"))))
f617db13 72
f617db13
MW
73(defun join-strings (del strings)
74 (with-output-to-string
75 (if (null strings)
76 nil
77 (princ (car strings))
78 (setq strings (cdr strings))
79 (while strings
80 (princ del)
81 (princ (car strings))
82 (setq strings (cdr strings))))))
cc643e69 83
f617db13
MW
84(defun mdw-vm-fix-mailing-lists ()
85 (save-restriction
86 (save-excursion
87 (or (vm-mail-mode-get-header-contents "Resent-To:")
88 (vm-mail-mode-get-header-contents "Resent-Cc:")
89 (vm-mail-mode-get-header-contents "Resent-Bcc:")
90 (let ((mailing-list-regex (concat "\\<\\("
91 (join-strings "\\|"
92 mdw-mailing-lists)
93 "\\)\\>"))
94 (to (vm-mail-mode-get-header-contents "To:"))
95 (cc (vm-mail-mode-get-header-contents "Cc:")))
96 (if (or (and to (string-match mailing-list-regex to))
97 (and cc (string-match mailing-list-regex cc)))
98 (let ((addrs (nconc (and to (vm-parse-addresses to))
99 (and cc (vm-parse-addresses cc))))
100 (new nil))
101 (while addrs
102 (if (string-match mailing-list-regex (car addrs))
103 (setq new (cons (car addrs) new)))
104 (setq addrs (cdr addrs)))
105 (vm-mail-mode-remove-header "Cc:")
106 (vm-mail-mode-remove-header "To:")
107 (widen)
108 (goto-char (point-min))
109 (insert (format "To: %s\n" (join-strings ", " new))))))))))
110
111(add-hook 'vm-reply-hook 'mdw-vm-fix-mailing-lists)