[PATCH 1/5] emacs: add property "matched-msgids" to each search result
authorPieter Praet <pieter@praet.org>
Mon, 4 Jul 2011 06:51:54 +0000 (08:51 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:56 +0000 (09:38 -0800)
48/340f536ddd5f57640a7cf9192a804feb28595b [new file with mode: 0644]

diff --git a/48/340f536ddd5f57640a7cf9192a804feb28595b b/48/340f536ddd5f57640a7cf9192a804feb28595b
new file mode 100644 (file)
index 0000000..74eee15
--- /dev/null
@@ -0,0 +1,90 @@
+Return-Path: <pieter@praet.org>\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 A7DC5429E29\r
+       for <notmuch@notmuchmail.org>; Sun,  3 Jul 2011 23:52:37 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 tXjV-STdy9VJ for <notmuch@notmuchmail.org>;\r
+       Sun,  3 Jul 2011 23:52:37 -0700 (PDT)\r
+Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
+ [74.125.82.45])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 02D81429E27   for <notmuch@notmuchmail.org>; Sun,  3 Jul 2011 23:52:36 -0700\r
+ (PDT)\r
+Received: by wwj40 with SMTP id 40so3858165wwj.2\r
+       for <notmuch@notmuchmail.org>; Sun, 03 Jul 2011 23:52:35 -0700 (PDT)\r
+Received: by 10.227.154.6 with SMTP id m6mr5034155wbw.73.1309762355792;\r
+       Sun, 03 Jul 2011 23:52:35 -0700 (PDT)\r
+Received: from localhost ([109.131.160.67])\r
+       by mx.google.com with ESMTPS id fu18sm4222090wbb.61.2011.07.03.23.52.34\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sun, 03 Jul 2011 23:52:35 -0700 (PDT)\r
+From: Pieter Praet <pieter@praet.org>\r
+To: Austin Clements <amdragon@mit.edu>\r
+Subject: [PATCH 1/5] emacs: add property "matched-msgids" to each search\r
+ result\r
+Date: Mon,  4 Jul 2011 08:51:54 +0200\r
+Message-Id: <1309762318-4530-2-git-send-email-pieter@praet.org>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <1309762318-4530-1-git-send-email-pieter@praet.org>\r
+References: <20110703171743.GL15901@mit.edu>\r
+       <1309762318-4530-1-git-send-email-pieter@praet.org>\r
+Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\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: Mon, 04 Jul 2011 06:52:37 -0000\r
+\r
+Signed-off-by: Pieter Praet <pieter@praet.org>\r
+---\r
+ emacs/notmuch.el |    4 +++-\r
+ 1 files changed, 3 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index f11ec24..674deb7 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -801,13 +801,14 @@ non-authors is found, assume that all of the authors match."\r
+             (while more\r
+               (while (and (< line (length string)) (= (elt string line) ?\n))\r
+                 (setq line (1+ line)))\r
+-              (if (string-match "^\\(thread:[0-9A-Fa-f]*\\) \\([^][]*\\) \\(\\[[0-9/]*\\]\\) \\([^;]*\\); \\(.*\\) (\\([^()]*\\))$" string line)\r
++              (if (string-match "^\\(thread:[0-9A-Fa-f]*\\) \\([^][]*\\) \\(\\[[0-9/]*\\]\\) \\([^;]*\\); \\(.*\\) (\\([^()]*\\)) \\(.*\\)$" string line)\r
+                   (let* ((thread-id (match-string 1 string))\r
+                          (date (match-string 2 string))\r
+                          (count (match-string 3 string))\r
+                          (authors (match-string 4 string))\r
+                          (subject (match-string 5 string))\r
+                          (tags (match-string 6 string))\r
++                         (matched-msgids (match-string 7 string))\r
+                          (tag-list (if tags (save-match-data (split-string tags)))))\r
+                     (goto-char (point-max))\r
+                     (if (/= (match-beginning 1) line)\r
+@@ -816,6 +817,7 @@ non-authors is found, assume that all of the authors match."\r
+                       (notmuch-search-show-result date count authors subject tags)\r
+                       (notmuch-search-color-line beg (point-marker) tag-list)\r
+                       (put-text-property beg (point-marker) 'notmuch-search-thread-id thread-id)\r
++                      (put-text-property beg (point-marker) 'notmuch-search-matched-msgids matched-msgids)\r
+                       (put-text-property beg (point-marker) 'notmuch-search-authors authors)\r
+                       (put-text-property beg (point-marker) 'notmuch-search-subject subject)\r
+                       (if (string= thread-id notmuch-search-target-thread)\r
+-- \r
+1.7.5.4\r
+\r