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 86859431FAE for ; Fri, 27 Nov 2009 00:42:32 -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 PnN-lrSxYrDN for ; Fri, 27 Nov 2009 00:42:31 -0800 (PST) Received: from e23smtp07.au.ibm.com (e23smtp07.au.ibm.com [202.81.31.140]) by olra.theworths.org (Postfix) with ESMTP id 58C77431FBC for ; Fri, 27 Nov 2009 00:42:31 -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 nAR8gT8T029303 for ; Fri, 27 Nov 2009 19:42:29 +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 nAR8gTYh1888364 for ; Fri, 27 Nov 2009 19:42:29 +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 nAR8gT5D004871 for ; Fri, 27 Nov 2009 19:42:29 +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 nAR8gRvb004813; Fri, 27 Nov 2009 19:42:28 +1100 From: "Aneesh Kumar K.V" To: notmuch@notmuchmail.org Date: Fri, 27 Nov 2009 14:12:12 +0530 Message-Id: <1259311332-14557-2-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-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1259125080-18708-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1259311332-14557-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Subject: [notmuch] [PATCH -v5] 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 08:42:32 -0000 Signed-off-by: Aneesh Kumar K.V --- notmuch.el | 35 +++++++++++++++++++++++++++++++++-- 1 files changed, 33 insertions(+), 2 deletions(-) diff --git a/notmuch.el b/notmuch.el index 89ccef6..851c60c 100644 --- a/notmuch.el +++ b/notmuch.el @@ -595,6 +595,38 @@ 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))) + (beginning-of-line) + (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))) + (beginning-of-line) + (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))) + (beginning-of-line) + (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))) + (beginning-of-line) + +)) (defun notmuch-show-markup-header (depth) (re-search-forward notmuch-show-header-begin-regexp) @@ -615,8 +647,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