[Patch v7 13/13] emacs: notmuch.el ignore excluded matches
authorMark Walters <markwalters1009@gmail.com>
Thu, 1 Mar 2012 22:30:45 +0000 (22:30 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:45:09 +0000 (09:45 -0800)
f6/ef6a62250585465f3fa7280a96deb75cc655c9 [new file with mode: 0644]

diff --git a/f6/ef6a62250585465f3fa7280a96deb75cc655c9 b/f6/ef6a62250585465f3fa7280a96deb75cc655c9
new file mode 100644 (file)
index 0000000..1175dc7
--- /dev/null
@@ -0,0 +1,116 @@
+Return-Path: <markwalters1009@gmail.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 D444E431FAF\r
+       for <notmuch@notmuchmail.org>; Thu,  1 Mar 2012 14:29:53 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       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 Pi5y6nNkPF6Q for <notmuch@notmuchmail.org>;\r
+       Thu,  1 Mar 2012 14:29:52 -0800 (PST)\r
+Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
+       [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id F2193431FDC\r
+       for <notmuch@notmuchmail.org>; Thu,  1 Mar 2012 14:29:51 -0800 (PST)\r
+Received: by mail-wi0-f181.google.com with SMTP id o1so305757wic.26\r
+       for <notmuch@notmuchmail.org>; Thu, 01 Mar 2012 14:29:51 -0800 (PST)\r
+Received-SPF: pass (google.com: domain of markwalters1009@gmail.com designates\r
+       10.180.99.65 as permitted sender) client-ip=10.180.99.65; \r
+Authentication-Results: mr.google.com; spf=pass (google.com: domain of\r
+       markwalters1009@gmail.com designates 10.180.99.65 as permitted\r
+       sender) smtp.mail=markwalters1009@gmail.com;\r
+       dkim=pass header.i=markwalters1009@gmail.com\r
+Received: from mr.google.com ([10.180.99.65])\r
+       by 10.180.99.65 with SMTP id eo1mr6536534wib.13.1330640991835 (num_hops\r
+       = 1); Thu, 01 Mar 2012 14:29:51 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=XGzouvhcaMkSYxvTwZnHC4C8s/Kptw6Y12r/uGuEPH4=;\r
+       b=BeuzEAGHOFNtyorSYajSpKzq49bNeXR//FoX/FKIFQQqkC53/e3j/TAvBzeIj+Q4B2\r
+       tHGitFLEdHkH2WSt7Rq0DW5p25ErZHH6qUSMPgUeZ9uVh2tEFpEYyPrzTp1dxF+NjING\r
+       uHbzmZEiScgGPFfr0MmUXthD4AoO32uZjsJqIEgaFL7n7g0VS73J4zfL/NosWeaLyrTK\r
+       FOOJWUqC4vP+Uc/+p+RgRm0JSBj+xGYPC9i5wxStS2MEidcjzI8eIW7KmmYvfhSZDpjV\r
+       Jh5wtj4MW/tCREJVFb/MIMGmdrFq4flChzX0XUCRbKteAexgJCkBV/E4T62Bu662GcrK\r
+       93Uw==\r
+Received: by 10.180.99.65 with SMTP id eo1mr5281382wib.13.1330640991774;\r
+       Thu, 01 Mar 2012 14:29:51 -0800 (PST)\r
+Received: from localhost (94-192-233-223.zone6.bethere.co.uk.\r
+ [94.192.233.223])     by mx.google.com with ESMTPS id\r
+ fw5sm44681145wib.0.2012.03.01.14.29.49        (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Thu, 01 Mar 2012 14:29:50 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [Patch v7 13/13] emacs: notmuch.el ignore excluded matches\r
+Date: Thu,  1 Mar 2012 22:30:45 +0000\r
+Message-Id: <1330641045-27416-14-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.2.3\r
+In-Reply-To: <1330641045-27416-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1330641045-27416-1-git-send-email-markwalters1009@gmail.com>\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: Thu, 01 Mar 2012 22:29:54 -0000\r
+\r
+This is a small change to make notmuch.el ignore excluded matches.  In\r
+the future it could do something better like add a button for\r
+rerunning the search with the excludes (particularly if nothing\r
+matches with the excludes) or having them invisible and allowing the\r
+visibility to be toggled.\r
+---\r
+ emacs/notmuch.el |   22 ++++++++++++----------\r
+ 1 files changed, 12 insertions(+), 10 deletions(-)\r
+\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index f851c6f..99e0c93 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -872,16 +872,18 @@ non-authors is found, assume that all of the authors match."\r
+                     (goto-char (point-max))\r
+                     (if (/= (match-beginning 1) line)\r
+                         (insert (concat "Error: Unexpected output from notmuch search:\n" (substring string line (match-beginning 1)) "\n")))\r
+-                    (let ((beg (point)))\r
+-                      (notmuch-search-show-result date count authors\r
+-                                                  (notmuch-prettify-subject subject) tags)\r
+-                      (notmuch-search-color-line beg (point) tag-list)\r
+-                      (put-text-property beg (point) 'notmuch-search-thread-id thread-id)\r
+-                      (put-text-property beg (point) 'notmuch-search-authors authors)\r
+-                      (put-text-property beg (point) 'notmuch-search-subject subject)\r
+-                      (when (string= thread-id notmuch-search-target-thread)\r
+-                        (set 'found-target beg)\r
+-                        (set 'notmuch-search-target-thread "found")))\r
++                    ;; We currently just throw away excluded matches.\r
++                    (unless (eq (aref count 1) ?0)\r
++                      (let ((beg (point)))\r
++                        (notmuch-search-show-result date count authors\r
++                                                    (notmuch-prettify-subject subject) tags)\r
++                        (notmuch-search-color-line beg (point) tag-list)\r
++                        (put-text-property beg (point) 'notmuch-search-thread-id thread-id)\r
++                        (put-text-property beg (point) 'notmuch-search-authors authors)\r
++                        (put-text-property beg (point) 'notmuch-search-subject subject)\r
++                        (when (string= thread-id notmuch-search-target-thread)\r
++                          (set 'found-target beg)\r
++                          (set 'notmuch-search-target-thread "found"))))\r
+                     (set 'line (match-end 0)))\r
+                 (set 'more nil)\r
+                 (while (and (< line (length string)) (= (elt string line) ?\n))\r
+-- \r
+1.7.2.3\r
+\r