[notmuch] [PATCH -v6] 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 10:14:13 +0000 (15:44 +0530)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:44 +0000 (09:35 -0800)
1b/c63032b0ebfd7ed5760baed7f4f649b113564a [new file with mode: 0644]

diff --git a/1b/c63032b0ebfd7ed5760baed7f4f649b113564a b/1b/c63032b0ebfd7ed5760baed7f4f649b113564a
new file mode 100644 (file)
index 0000000..8462e08
--- /dev/null
@@ -0,0 +1,110 @@
+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 DD111431FBC\r
+       for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 02:14:20 -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 4nbQNmGFr+YF for <notmuch@notmuchmail.org>;\r
+       Fri, 27 Nov 2009 02:14:19 -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 54718431FAE\r
+       for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 02:14:19 -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 nARAEHY9023673\r
+       for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 21:14:17 +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
+       nARAEHnW1868028\r
+       for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 21:14:17 +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
+       nARAEHJ0028278\r
+       for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 21:14:17 +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
+       nARAEFO7028260; Fri, 27 Nov 2009 21:14:15 +1100\r
+From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>\r
+To: notmuch@notmuchmail.org\r
+Date: Fri, 27 Nov 2009 15:44:13 +0530\r
+Message-Id:\r
+ <1259316853-17725-1-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-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com>\r
+References:\r
+ <1259311332-14557-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com>\r
+Subject: [notmuch] [PATCH -v6] 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 10:14:21 -0000\r
+\r
+Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>\r
+---\r
+ notmuch.el |   29 +++++++++++++++++++++++++++--\r
+ 1 files changed, 27 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/notmuch.el b/notmuch.el\r
+index d2ebb40..b089732 100644\r
+--- a/notmuch.el\r
++++ b/notmuch.el\r
+@@ -604,6 +604,32 @@ 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
++    (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
++    (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
++    (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
\r
+ (defun notmuch-show-markup-header (depth)\r
+   (re-search-forward notmuch-show-header-begin-regexp)\r
+@@ -624,8 +650,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