aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.el
diff options
context:
space:
mode:
authorGravatar Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2009-11-27 15:44:13 +0530
committerGravatar Carl Worth <cworth@cworth.org>2009-11-27 20:57:43 -0800
commit8418dee2f6cf02f66dff236362f7cc1aadb56d38 (patch)
tree7da114f9bb11d7a12ce1419d284d0ee34e6fb968 /notmuch.el
parent6da656657621febf2d5b9e1ba69c8856f9882140 (diff)
notmuch.el: Use message-mode font-face to highlight mail headers
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'notmuch.el')
-rw-r--r--notmuch.el29
1 files changed, 27 insertions, 2 deletions
diff --git a/notmuch.el b/notmuch.el
index f99feae8..1f5e681c 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -627,6 +627,32 @@ which this thread was originally shown."
(set-marker beg nil)
(set-marker end nil)
)))
+(defun notmuch-fontify-headers ()
+ (progn
+ (if (looking-at "[Tt]o:")
+ (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+ 'face 'message-header-name)
+ (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+ 'face 'message-header-to))
+ (if (looking-at "[B]?[Cc][Cc]:")
+ (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+ 'face 'message-header-name)
+ (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+ 'face 'message-header-cc))
+ (if (looking-at "[Ss]ubject:")
+ (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+ 'face 'message-header-name)
+ (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+ 'face 'message-header-subject))
+ (if (looking-at "[Ff]rom:")
+ (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+ 'face 'message-header-name)
+ (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+ 'face 'message-header-other))))))))
(defun notmuch-show-markup-header (depth)
(re-search-forward notmuch-show-header-begin-regexp)
@@ -647,8 +673,7 @@ which this thread was originally shown."
(forward-line)
(while (looking-at "[A-Za-z][-A-Za-z0-9]*:")
(beginning-of-line)
- (overlay-put (make-overlay (point) (re-search-forward ":"))
- 'face 'bold)
+ (notmuch-fontify-headers)
(forward-line)
)
(indent-rigidly beg end depth)