changeset 9381:535197b3fc42

(mail-font-lock-keywords): New variable. (mail-mode): Set font-lock-keywords locally.
author Richard M. Stallman <rms@gnu.org>
date Fri, 07 Oct 1994 10:00:00 +0000
parents 5eb799a4819b
children ac2649a20967
files lisp/mail/sendmail.el
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/sendmail.el	Fri Oct 07 09:59:00 1994 +0000
+++ b/lisp/mail/sendmail.el	Fri Oct 07 10:00:00 1994 +0000
@@ -159,11 +159,22 @@
 (defvar mail-mode-syntax-table nil
   "Syntax table used while in mail mode.")
 
-(if (null mail-mode-syntax-table)
+(if (not mail-mode-syntax-table)
     (progn
      (setq mail-mode-syntax-table (copy-syntax-table text-mode-syntax-table))
      (modify-syntax-entry ?% ". " mail-mode-syntax-table)))
 
+(defvar mail-font-lock-keywords
+  (list '("^To:" . font-lock-function-name-face)
+	'("^B?CC:\\|^Reply-To:" . font-lock-keyword-face)
+	'("^Subject:" . font-lock-comment-face)
+	'("^Subject:\\s *\\(.+\\)$" 1 font-lock-type-face)
+	(list (concat "^\\(" mail-header-separator "\\)$") 1
+	      'font-lock-comment-face)
+	'("^[ \t]*\\sw*[>|}].*$" . font-lock-reference-face)	; Citation.
+	'("^\\(X-[A-Za-z0-9-]+\\|In-reply-to\\):.*$" . font-lock-string-face))
+  "Additional expressions to highlight in Mail mode.")
+
 (defvar mail-send-hook nil
   "Normal hook run before sending mail, in Mail mode.")
 
@@ -253,6 +264,8 @@
   (setq major-mode 'mail-mode)
   (setq mode-name "Mail")
   (setq buffer-offer-save t)
+  (make-local-variable 'font-lock-keywords)
+  (setq font-lock-keywords mail-font-lock-keywords)
   (make-local-variable 'paragraph-separate)
   (make-local-variable 'paragraph-start)
   (setq paragraph-start (concat "^" mail-header-separator