~ubuntu-branches/ubuntu/natty/vm/natty

« back to all changes in this revision

Viewing changes to debian/examples/dot.vm-color

  • Committer: Bazaar Package Importer
  • Author(s): Manoj Srivastava
  • Date: 2002-03-06 00:46:29 UTC
  • Revision ID: james.westby@ubuntu.com-20020306004629-d6hkaca872wyesmc
Tags: 7.03-1
* fixed defcustom syntax errors.
* minor compiler error cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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?
 
5
 
 
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.
 
10
 
 
11
 
 
12
(require 'highlight-headers)
 
13
;;colours
 
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)
 
20
 
 
21
;;highlighting
 
22
(defconst kmc-vm-mail-font-lock-keywords
 
23
  (purecopy
 
24
   (list
 
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)
 
30
    (list (concat "\\("
 
31
                  highlight-headers-citation-header-regexp
 
32
                  "\\)") 1 'message-headers t)
 
33
    )))
 
34
 
 
35
(add-hook 'vm-mail-mode-hook
 
36
          (lambda ()
 
37
          (setq font-lock-keywords kmc-vm-mail-font-lock-keywords)
 
38
        ))
 
39
(add-hook 'mail-setup-hook
 
40
          (lambda ()
 
41
            (setq font-lock-keywords kmc-vm-mail-font-lock-keywords)
 
42
        )
 
43
 
 
44
 
 
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.
 
50
 
 
51
 
 
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
 
55
decode zones.
 
56
======================================================================
 
57
 
 
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)
 
64
        )
 
65
)
 
66
 
 
67
(defun vm-fontify ()
 
68
        (make-local-variable 'font-lock-defaults)
 
69
        (setq font-lock-defaults '(vm-font-lock-words t))
 
70
        (turn-on-font-lock))
 
71
 
 
72
(add-hook 'vm-mode-hook
 
73
          '(lambda ()
 
74
             (local-set-key "r" 'vm-followup)
 
75
             (vm-fontify)))
 
76
 
 
77
(add-hook 'vm-presentation-mode-hook
 
78
          '(lambda ()
 
79
             (vm-fontify)))
 
80