home *** CD-ROM | disk | FTP | other *** search
- Tony E. Bennett writes:
- > This is what I did. Not entirely happy with it. Sometimes
- > it seems to take a *long* time to step from one msg to the next.
- >
- > add to dummy-font-lock-mode-hook
- >
- > ((eq major-mode 'vm-mode)
- > (set (make-local-variable 'font-lock-keywords)
- > vm-font-lock-keywords))
- > ((eq major-mode 'vm-summary-mode)
- > (set (make-local-variable 'font-lock-keywords)
- > vm-summary-font-lock-keywords))
- > ((eq major-mode 'mail-mode)
- > (set (make-local-variable 'font-lock-keywords)
- > vm-font-lock-keywords))
- >
- > put this with your font-lock config (.emacs):
- > note I use environ variable to specify fonts.
- > In this case I have MFONT_BOLD set to "lucidasans-typewriterbold-12"
- >
- > (or (find-face 'marked-face)
- > (make-face 'marked-face))
- > (or (find-face 'new-face)
- > (make-face 'new-face))
- > (or (find-face 'red-face)
- > (make-face 'red-face))
- > (or (find-face 'yellow-face)
- > (make-face 'yellow-face))
- > (or (find-face 'deleted-face)
- > (make-face 'deleted-face))
- >
- > (set-face-background 'marked-face "dark green")
- > (set-face-font 'marked-face (getenv "MFONT_BOLD"))
- >
- > (set-face-background 'new-face "light coral")
- > (set-face-foreground 'new-face "black")
- > (set-face-font 'new-face (getenv "MFONT_BOLD"))
- >
- > (set-face-foreground 'deleted-face "grey30")
- > (set-face-background 'deleted-face "grey60")
- >
- > (set-face-foreground 'red-face "#FF2060")
- > (set-face-font 'red-face (getenv "MFONT_BOLD"))
- >
- > (set-face-foreground 'yellow-face "yellow")
- > (set-face-font 'yellow-face (getenv "MFONT_BOLD"))
- >
- > ;;
- > ;; VM and Mail mode
- > ;;
- >
- > (setq vm-font-lock-keywords
- > '(
- > ("^From:.*" . font-lock-keyword-face)
- > ("^T[oO]:.*" . font-lock-string-face)
- > ("^C[cC]:.*\\|^FCC:.*" . font-lock-comment-face)
- > ("^Subject:.*" . font-lock-function-name-face)))
- >
- > ;;
- > ;; VM summary buffer
- > ;;
- >
- > (setq vm-summary-font-lock-keywords
- > '(
- > ("^->.*" 0 yellow-face t)
- > ("^...[0-9]+[UN].*" 0 new-face t) ;; new/unread
- > ("^...[0-9]+[A-Z]* *\\*.*" 0 marked-face t) ;; marked
- > ("^...[0-9]+D.*" 0 deleted-face t) ;; deleted
- > ))
- >
- > ;; Define the highlighting function. Basically just redefine the
- > ;; standard VM function so it uses font-lock buttons.
- >
- > (defun vm-highlight-headers (message window)
- > "\
- > Using font-lock; highlight From: and Subject: fields in mail messages displayed
- > by VM."
- > (save-excursion
- > ;; As of v18.52, this call to save-window-excursion is needed!
- > ;; Somehow window point can get fouled in here, and drag the
- > ;; buffer point along with it. This problem only manifests
- > ;; itself when operating VM from the summary buffer, subsequent
- > ;; to using vm-beginning-of-message or vm-end-of-message.
- > ;; After running a next or previous message command, point
- > ;; somehow ends up at the end of the message.
- > (save-window-excursion
- > (font-lock-mode 1))))
- >
- > (defun vm-my-force-font-lock ()
- > (let ((font-lock-verbose nil))
- > (setq font-lock-fontified nil)
- > (font-lock-mode 1)))
- >
- > (add-hook 'vm-show-message-hook 'vm-my-force-font-lock)
- > (add-hook 'vm-preview-message-hook 'vm-my-force-font-lock)
- > (add-hook 'vm-summary-mode-hooks 'vm-my-force-font-lock)
- > (add-hook 'mail-setup-hook '(lambda () (font-lock-mode 1)))
-
-
- I love it, you made my day.
- If you have any improvements, please let us know, o.k ?
-
- Thanks,
-
- --
- Danny.
-
- -------------------------------
- Dan Bar Dov
-
- Applied Materials (Israel)
- Currently at Applied Materials - Santa Clara, CA
-
- Email: danny@amil.co.il
- Phone: office (408) 235-6514
- home (408) 739-5281
- TimeZone: PST
- -------------------------------
-
-