emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

New custom faces for rmail.el


From: Bastien Guerry
Subject: New custom faces for rmail.el
Date: Mon, 11 Feb 2008 21:55:53 +0000
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux)

For now rmail.el uses font-lock-* faces to highlight header fields like
From: or To:.  The patch below defines new faces for the Subject: Date:
From: and To: header fields.

I'd like to commit this change.  Comment?

--- rmail.el.~1.448.~   2008-02-10 21:13:03.000000000 +0000
+++ rmail.el    2008-02-11 21:08:25.000000000 +0000
@@ -345,6 +345,58 @@
                 face)
   :group 'rmail-headers)
 
+(defface rmail-subject
+  '((t (:inherit font-lock-comment-face)))
+  "Face to use for highlighting the \"Subject:\" header field."
+  :group 'rmail-headers
+  :version "22.1")
+
+(defcustom rmail-subject-face 'rmail-subject "\
+*Face use be Rmail for highlighting the \"Subject:\" header field."
+  :type '(choice (const :tag "Default" nil)
+                face)
+  :group 'rmail-headers)
+
+(defface rmail-date
+  '((t (:inherit font-lock-string-face)))
+  "Face to use for highlighting the \"Date:\" header field."
+  :group 'rmail-headers
+  :version "22.1")
+
+(defcustom rmail-date-face 'rmail-date "\
+*Face use be Rmail for highlighting the \"Date:\" header field."
+  :type '(choice (const :tag "Default" nil)
+                face)
+  :group 'rmail-headers)
+
+(defface rmail-from
+  '((t (:inherit font-lock-function-name-face)))
+  "Face to use for highlighting the \"From:\" header field.
+Also used for this fields: Sender and Resent-From."
+  :group 'rmail-headers
+  :version "22.1")
+
+(defcustom rmail-from-face 'rmail-from "\
+*Face use be Rmail for highlighting the \"From:\" header field.
+Also used for this fields: Sender and Resent-From."
+  :type '(choice (const :tag "Default" nil)
+                face)
+  :group 'rmail-headers)
+
+(defface rmail-to
+  '((t (:inherit font-lock-keyword-face)))
+  "Face to use for highlighting the \"To:\" header field.
+Also used for this fields: Apparently-To, Cc and Newsgroups."
+  :group 'rmail-headers
+  :version "22.1")
+
+(defcustom rmail-to-face 'rmail-to "\
+*Face use be Rmail for highlighting the \"To:\" header field.
+Also used for this fields: Apparently-To, Cc and Newsgroups."
+  :type '(choice (const :tag "Default" nil)
+                face)
+  :group 'rmail-headers)
+
 ;;;###autoload
 (defcustom rmail-delete-after-output nil "\
 *Non-nil means automatically delete a message that is copied to a file."
@@ -705,12 +757,12 @@
           (cite-prefix "a-z")
           (cite-suffix (concat cite-prefix "address@hidden'\"")))
       (list '("^\\(From\\|Sender\\|Resent-From\\):"
-             . font-lock-function-name-face)
+             . rmail-from-face)
            '("^Reply-To:.*$" . font-lock-function-name-face)
-           '("^Subject:" . font-lock-comment-face)
+           '("^Subject:" . rmail-subject-face)
            '("^X-Spam-Status:" . font-lock-keyword-face)
            '("^\\(To\\|Apparently-To\\|Cc\\|Newsgroups\\):"
-             . font-lock-keyword-face)
+             . rmail-to-face)
            ;; Use MATCH-ANCHORED to effectively anchor the regexp left side.
            `(,cite-chars
              (,(concat "\\=[ \t]*"
@@ -720,9 +772,10 @@
               (beginning-of-line) (end-of-line)
               (1 font-lock-comment-delimiter-face nil t)
               (5 font-lock-comment-face nil t)))
-           '("^\\(X-[a-z0-9-]+\\|In-reply-to\\|Date\\):.*\\(\n[ \t]+.*\\)*$"
-             . font-lock-string-face))))
-  "Additional expressions to highlight in Rmail mode.")
+           '("^\\(X-[a-z0-9-]+\\|In-reply-to\\):.*\\(\n[ \t]+.*\\)*$"
+             . font-lock-string-face)
+           '("^Date:.*\\(\n[ \t]+.*\\)*$" . rmail-date-face))))
+    "Additional expressions to highlight in Rmail mode.")
 
 ;; Perform BODY in the summary buffer
 ;; in such a way that its cursor is properly updated in its own window.
-- 
Bastien

reply via email to

[Prev in Thread] Current Thread [Next in Thread]