[notmuch] [PATCH -v5] notmuch.el: Use message-mode font-face to highlight mail headers
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Fri, 27 Nov 2009 08:42:12 +0000 (14:12 +0530)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:44 +0000 (09:35 -0800)
5a/36d6f32cb764666e3b1f3bd3e339227b7f6e31 [new file with mode: 0644]

diff --git a/5a/36d6f32cb764666e3b1f3bd3e339227b7f6e31 b/5a/36d6f32cb764666e3b1f3bd3e339227b7f6e31
new file mode 100644 (file)
index 0000000..33c0257
--- /dev/null
@@ -0,0 +1,117 @@
+Return-Path: <aneesh.kumar@linux.vnet.ibm.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 86859431FAE\r
+       for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 00:42:32 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id PnN-lrSxYrDN for <notmuch@notmuchmail.org>;\r
+       Fri, 27 Nov 2009 00:42:31 -0800 (PST)\r
+Received: from e23smtp07.au.ibm.com (e23smtp07.au.ibm.com [202.81.31.140])\r
+       by olra.theworths.org (Postfix) with ESMTP id 58C77431FBC\r
+       for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 00:42:31 -0800 (PST)\r
+Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245])\r
+       by e23smtp07.au.ibm.com (8.14.3/8.13.1) with ESMTP id nAR8gT8T029303\r
+       for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 19:42:29 +1100\r
+Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96])\r
+       by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id\r
+       nAR8gTYh1888364\r
+       for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 19:42:29 +1100\r
+Received: from d23av01.au.ibm.com (loopback [127.0.0.1])\r
+       by d23av01.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id\r
+       nAR8gT5D004871\r
+       for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 19:42:29 +1100\r
+Received: from localhost.localdomain (N20wks267599wss.in.ibm.com\r
+       [9.124.31.111])\r
+       by d23av01.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id\r
+       nAR8gRvb004813; Fri, 27 Nov 2009 19:42:28 +1100\r
+From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>\r
+To: notmuch@notmuchmail.org\r
+Date: Fri, 27 Nov 2009 14:12:12 +0530\r
+Message-Id:\r
+ <1259311332-14557-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com>\r
+X-Mailer: git-send-email 1.6.5.2.74.g610f9\r
+In-Reply-To:\r
+ <1259311332-14557-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>\r
+References:\r
+ <1259125080-18708-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>\r
+       <1259311332-14557-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>\r
+Subject: [notmuch] [PATCH -v5] notmuch.el: Use message-mode font-face to\r
+       highlight mail headers\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.12\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 27 Nov 2009 08:42:32 -0000\r
+\r
+Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>\r
+---\r
+ notmuch.el |   35 +++++++++++++++++++++++++++++++++--\r
+ 1 files changed, 33 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/notmuch.el b/notmuch.el\r
+index 89ccef6..851c60c 100644\r
+--- a/notmuch.el\r
++++ b/notmuch.el\r
+@@ -595,6 +595,38 @@ which this thread was originally shown."\r
+       (set-marker beg nil)\r
+       (set-marker end nil)\r
+       )))\r
++(defun notmuch-fontify-headers ()\r
++  (progn\r
++    (if (looking-at "[Tt]o:")\r
++      (progn\r
++        (overlay-put (make-overlay (point) (re-search-forward ":"))\r
++                       'face 'message-header-name)\r
++          (overlay-put (make-overlay (point) (re-search-forward ".*$"))\r
++                       'face 'message-header-to)))\r
++    (beginning-of-line)\r
++    (if (looking-at "[B]?[Cc][Cc]:")\r
++      (progn\r
++        (overlay-put (make-overlay (point) (re-search-forward ":"))\r
++                       'face 'message-header-name)\r
++          (overlay-put (make-overlay (point) (re-search-forward ".*$"))\r
++                       'face 'message-header-cc)))\r
++    (beginning-of-line)\r
++    (if (looking-at "[Ss]ubject:")\r
++      (progn\r
++        (overlay-put (make-overlay (point) (re-search-forward ":"))\r
++                       'face 'message-header-name)\r
++          (overlay-put (make-overlay (point) (re-search-forward ".*$"))\r
++                       'face 'message-header-subject)))\r
++    (beginning-of-line)\r
++    (if (looking-at "[Ff]rom:")\r
++      (progn\r
++        (overlay-put (make-overlay (point) (re-search-forward ":"))\r
++                       'face 'message-header-name)\r
++          (overlay-put (make-overlay (point) (re-search-forward ".*$"))\r
++                       'face 'message-header-other)))\r
++    (beginning-of-line)\r
++\r
++))\r
\r
+ (defun notmuch-show-markup-header (depth)\r
+   (re-search-forward notmuch-show-header-begin-regexp)\r
+@@ -615,8 +647,7 @@ which this thread was originally shown."\r
+         (forward-line)\r
+         (while (looking-at "[A-Za-z][-A-Za-z0-9]*:")\r
+           (beginning-of-line)\r
+-          (overlay-put (make-overlay (point) (re-search-forward ":"))\r
+-                       'face 'bold)\r
++        (notmuch-fontify-headers)\r
+           (forward-line)\r
+           )\r
+       (indent-rigidly beg end depth)\r
+-- \r
+1.6.5.2.74.g610f9\r
+\r