1
I find font-locking email very useful for colouring quoted text
2
differently to the new text. In fact, Gnus manages to colour every
3
quoted message differently, which is very handy once you get three or
4
four different people quoting each other. Can you get VM to do this?
6
FWIW, here is the relevant bit of my .vm file (i use XEmacs which may
7
(not) be relevant). Before anyone asks i don't know why i need to use
8
both vm-mail-mode-hook and mail-setup-hook, but it works for me, and i
9
can't be bothered to sort it out.
12
(require 'highlight-headers)
14
(set-face-foreground 'message-headers "darkslateblue")
15
(set-face-foreground 'message-header-contents "brown")
16
(set-face-foreground 'message-highlighted-header-contents "black")
17
(set-face-foreground 'message-cited-text "darkgreen")
18
(make-face-bold 'message-highlighted-header-contents)
19
(make-face-unitalic 'message-header-contents)
22
(defconst kmc-vm-mail-font-lock-keywords
25
'("^\\([-a-zA-Z0-9]+:\\)[ ]*\\(.*\\)$" 1 message-headers t)
26
'("^\\([-a-zA-Z0-9]+:\\)[ ]*\\(.*\\)$" 2 message-header-contents t)
27
'("Subject[ \t]*:[ ]*\\(.*\\)$" 1 message-highlighted-header-contents t)
28
(list (concat highlight-headers-citation-regexp
29
"\\(.*\\)$") 2 'message-cited-text t)
31
highlight-headers-citation-header-regexp
32
"\\)") 1 'message-headers t)
35
(add-hook 'vm-mail-mode-hook
37
(setq font-lock-keywords kmc-vm-mail-font-lock-keywords)
39
(add-hook 'mail-setup-hook
41
(setq font-lock-keywords kmc-vm-mail-font-lock-keywords)
45
======================================================================
46
> I've found it useful when you can display the quoted portion in a
47
> grey-ish color, rather than my default white on black. It seems to
48
> make it easier to focus in on the reply parts. Certainly not
49
> critical, but I'd find it a very nice feature.
52
I had to add a new hook to VM for making that:
53
vm-presentation-mode-hook. Then, I use the following. It fontifies the
54
"From" and "Subject" lines, as well as URLs, quoted text and auto-MIME
56
======================================================================
58
(setq vm-font-lock-words
59
'(("^Subject: \\(.*\\)$" . font-lock-reference-face)
60
("^From: \\(.*\\)" . font-lock-type-face)
61
("^[>|}].*" . font-lock-comment-face)
62
("^.*\\\[Click .*\\\]$" . font-lock-variable-name-face)
63
("\\(file\\|ftp\\|gopher\\|http\\|https\\|news\\|wais\\|www\\)://[^ \t\n\f\r\"<>|()]*[^ \t\n\f\r\"<>|.!?(){}]" . font-lock-string-face)
68
(make-local-variable 'font-lock-defaults)
69
(setq font-lock-defaults '(vm-font-lock-words t))
72
(add-hook 'vm-mode-hook
74
(local-set-key "r" 'vm-followup)
77
(add-hook 'vm-presentation-mode-hook