Subject: Finally got font-lock to work with VM...Here's how!

From: John Vella <[email-masked]>
Date: Fri, 28 Jun 1996 07:35:00 -0700

This is from my .emacs file.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;;------------------------------------------------------------
;;
;; Font lock settings
;;
;;------------------------------------------------------------
;;
(require 'font-lock)

(global-font-lock-mode t)
;; For some reason, the "global" doesn't work for VM buffers
(add-hook 'vm-mode-hook         'turn-on-font-lock)
(add-hook 'vm-summary-mode-hook 'turn-on-font-lock)

;; Faces & Keywords for VM
(make-face 'vm-summ-hilite-face)
(set-face-background 'vm-summ-hilite-face "Orange")
(set-face-foreground 'vm-summ-hilite-face "Black")
(setq vm-summary-highlight-face 'vm-summ-hilite-face)
(setq vm-font-lock-keywords
      (list '("^From:.*"                                 . font-lock-comment-face)
            '("^To:.*"                                   . font-lock-function-name-face)
            '("^[BF]*C[cC]:.*\\|^***Reply-To:.*"         . font-lock-doc-string-face)
            '("^Subject:.*"                              . font-lock-keyword-face)
            '("^[ ]*>.*"                                 . font-lock-reference-face)
            '("^\\(X-[A-Za-z0-9-]+\\|In-reply-to\\):.*$" . font-lock-type-face)))

;; Highlight my name and subject lines(threaded subjects are hilited differently)
(setq vm-summary-font-lock-keywords
      (list '("|> [^ ].*"  . font-lock-function-name-face)
            '("|>   .*"    . font-lock-comment-face)
            '("John Vella\\|jvella" . font-lock-keyword-face)))

;; Got the next two lines from Kyle Jones on 6-20-96.
;; Without them there just wasn't a way to get font-lock turned on.
(setq font-lock-defaults-alist 
      (cons (list 'vm-summary-mode 'vm-summary-font-lock-keywords nil nil nil nil)
            font-lock-defaults-alist))
(setq font-lock-defaults-alist 
      (cons (list 'vm-mode 'vm-font-lock-keywords nil nil nil nil)
            font-lock-defaults-alist))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-john