Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id DD111431FBC for ; Fri, 27 Nov 2009 02:14:20 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4nbQNmGFr+YF for ; Fri, 27 Nov 2009 02:14:19 -0800 (PST) Received: from e23smtp07.au.ibm.com (e23smtp07.au.ibm.com [202.81.31.140]) by olra.theworths.org (Postfix) with ESMTP id 54718431FAE for ; Fri, 27 Nov 2009 02:14:19 -0800 (PST) Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp07.au.ibm.com (8.14.3/8.13.1) with ESMTP id nARAEHY9023673 for ; Fri, 27 Nov 2009 21:14:17 +1100 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nARAEHnW1868028 for ; Fri, 27 Nov 2009 21:14:17 +1100 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nARAEHJ0028278 for ; Fri, 27 Nov 2009 21:14:17 +1100 Received: from localhost.localdomain (N20wks267599wss.in.ibm.com [9.124.31.111]) by d23av01.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id nARAEFO7028260; Fri, 27 Nov 2009 21:14:15 +1100 From: "Aneesh Kumar K.V" To: notmuch@notmuchmail.org Date: Fri, 27 Nov 2009 15:44:13 +0530 Message-Id: <1259316853-17725-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.6.5.2.74.g610f9 In-Reply-To: <1259311332-14557-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1259311332-14557-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Subject: [notmuch] [PATCH -v6] notmuch.el: Use message-mode font-face to highlight mail headers X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 10:14:21 -0000 Signed-off-by: Aneesh Kumar K.V --- notmuch.el | 29 +++++++++++++++++++++++++++-- 1 files changed, 27 insertions(+), 2 deletions(-) diff --git a/notmuch.el b/notmuch.el index d2ebb40..b089732 100644 --- a/notmuch.el +++ b/notmuch.el @@ -604,6 +604,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) @@ -624,8 +650,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) -- 1.6.5.2.74.g610f9