From 5d04afbea91038464ed34d53c805f35f61656aef Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sat, 25 Feb 2012 08:06:44 +0000 Subject: [PATCH] [Patch v6 13/13] emacs: notmuch.el ignore excluded matches --- c8/894103c749a224de538b35e0d999a56d896d37 | 116 ++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 c8/894103c749a224de538b35e0d999a56d896d37 diff --git a/c8/894103c749a224de538b35e0d999a56d896d37 b/c8/894103c749a224de538b35e0d999a56d896d37 new file mode 100644 index 000000000..2d971333b --- /dev/null +++ b/c8/894103c749a224de538b35e0d999a56d896d37 @@ -0,0 +1,116 @@ +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 BC90E431FBD + for ; Sat, 25 Feb 2012 21:08:53 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.201 +X-Spam-Level: +X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, + RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +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 YcQywd4EptEl for ; + Sat, 25 Feb 2012 21:08:53 -0800 (PST) +Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com + [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 25C87431FAE for ; Sat, 25 Feb 2012 21:08:53 -0800 + (PST) +Received: by wgbdt12 with SMTP id dt12so2813759wgb.2 + for ; Sat, 25 Feb 2012 21:08:52 -0800 (PST) +Received-SPF: pass (google.com: domain of markwalters1009@gmail.com designates + 10.180.78.6 as permitted sender) client-ip=10.180.78.6; +Authentication-Results: mr.google.com; spf=pass (google.com: domain of + markwalters1009@gmail.com designates 10.180.78.6 as permitted + sender) smtp.mail=markwalters1009@gmail.com; + dkim=pass header.i=markwalters1009@gmail.com +Received: from mr.google.com ([10.180.78.6]) + by 10.180.78.6 with SMTP id x6mr8104461wiw.18.1330232932081 (num_hops = + 1); Sat, 25 Feb 2012 21:08:52 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; + bh=kTsI2ZMo+rBmhGz/LXusdK9NBBiE4ufayWBC1cKc9CY=; + b=YOJIfwEenysdCbHSAhuJ8b2TLQrFgsD/tUccJmlMwGyICmd5VMeESTXTOWw5pOXA1V + Rne+/QoslZ5cVPUPCerzMqfanqHQkhTxskrB00UjNblbHJJJ4rQOxPmLucbxUNmHj6dL + m1lDPqqv+t0VGrWrLjIEP+3mIRsDefm/qsubM= +Received: by 10.180.78.6 with SMTP id x6mr1725934wiw.18.1330157156328; + Sat, 25 Feb 2012 00:05:56 -0800 (PST) +Received: from localhost (94-192-233-223.zone6.bethere.co.uk. + [94.192.233.223]) by mx.google.com with ESMTPS id + hb10sm20589357wib.10.2012.02.25.00.05.55 (version=TLSv1/SSLv3 cipher=OTHER); + Sat, 25 Feb 2012 00:05:55 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org, + Austin Clements +Subject: [Patch v6 13/13] emacs: notmuch.el ignore excluded matches +Date: Sat, 25 Feb 2012 08:06:44 +0000 +Message-Id: <1330157204-26094-14-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.2.3 +In-Reply-To: <1330157204-26094-1-git-send-email-markwalters1009@gmail.com> +References: <1330157204-26094-1-git-send-email-markwalters1009@gmail.com> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +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: Sun, 26 Feb 2012 05:08:53 -0000 + +This is a small change to make notmuch.el ignore excluded matches. In +the future it could do something better like add a button for +rerunning the search with the excludes (particularly if nothing +matches with the excludes) or having them invisible and allowing the +visibility to be toggled. + +It is a 1 or 2 line change except for indentation. +--- + emacs/notmuch.el | 22 ++++++++++++---------- + 1 files changed, 12 insertions(+), 10 deletions(-) + +diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index 5b4f1c5..8b209cd 100644 +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -865,16 +865,18 @@ non-authors is found, assume that all of the authors match." + (goto-char (point-max)) + (if (/= (match-beginning 1) line) + (insert (concat "Error: Unexpected output from notmuch search:\n" (substring string line (match-beginning 1)) "\n"))) +- (let ((beg (point))) +- (notmuch-search-show-result date count authors +- (notmuch-prettify-subject subject) tags) +- (notmuch-search-color-line beg (point) tag-list) +- (put-text-property beg (point) 'notmuch-search-thread-id thread-id) +- (put-text-property beg (point) 'notmuch-search-authors authors) +- (put-text-property beg (point) 'notmuch-search-subject subject) +- (when (string= thread-id notmuch-search-target-thread) +- (set 'found-target beg) +- (set 'notmuch-search-target-thread "found"))) ++ ;; We currently just throw away excluded matches. ++ (unless (eq (aref count 1) ?0) ++ (let ((beg (point))) ++ (notmuch-search-show-result date count authors ++ (notmuch-prettify-subject subject) tags) ++ (notmuch-search-color-line beg (point) tag-list) ++ (put-text-property beg (point) 'notmuch-search-thread-id thread-id) ++ (put-text-property beg (point) 'notmuch-search-authors authors) ++ (put-text-property beg (point) 'notmuch-search-subject subject) ++ (when (string= thread-id notmuch-search-target-thread) ++ (set 'found-target beg) ++ (set 'notmuch-search-target-thread "found")))) + (set 'line (match-end 0))) + (set 'more nil) + (while (and (< line (length string)) (= (elt string line) ?\n)) +-- +1.7.2.3 + -- 2.26.2