From 8b1f1a0c15f404c4f46edc7f2cd722457cd50af3 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 7 Oct 1994 10:00:00 +0000 Subject: [PATCH] (mail-font-lock-keywords): New variable. (mail-mode): Set font-lock-keywords locally. --- lisp/mail/sendmail.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index fcaed8fa381..982ed8ecbbd 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -159,11 +159,22 @@ actually occur.") (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 @@ C-c C-v mail-sent-via (add a sent-via field for each To or CC)." (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 -- 2.39.5