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 D444E431FAF for ; Thu, 1 Mar 2012 14:29: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 Pi5y6nNkPF6Q for ; Thu, 1 Mar 2012 14:29:52 -0800 (PST) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id F2193431FDC for ; Thu, 1 Mar 2012 14:29:51 -0800 (PST) Received: by mail-wi0-f181.google.com with SMTP id o1so305757wic.26 for ; Thu, 01 Mar 2012 14:29:51 -0800 (PST) Received-SPF: pass (google.com: domain of markwalters1009@gmail.com designates 10.180.99.65 as permitted sender) client-ip=10.180.99.65; Authentication-Results: mr.google.com; spf=pass (google.com: domain of markwalters1009@gmail.com designates 10.180.99.65 as permitted sender) smtp.mail=markwalters1009@gmail.com; dkim=pass header.i=markwalters1009@gmail.com Received: from mr.google.com ([10.180.99.65]) by 10.180.99.65 with SMTP id eo1mr6536534wib.13.1330640991835 (num_hops = 1); Thu, 01 Mar 2012 14:29:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=XGzouvhcaMkSYxvTwZnHC4C8s/Kptw6Y12r/uGuEPH4=; b=BeuzEAGHOFNtyorSYajSpKzq49bNeXR//FoX/FKIFQQqkC53/e3j/TAvBzeIj+Q4B2 tHGitFLEdHkH2WSt7Rq0DW5p25ErZHH6qUSMPgUeZ9uVh2tEFpEYyPrzTp1dxF+NjING uHbzmZEiScgGPFfr0MmUXthD4AoO32uZjsJqIEgaFL7n7g0VS73J4zfL/NosWeaLyrTK FOOJWUqC4vP+Uc/+p+RgRm0JSBj+xGYPC9i5wxStS2MEidcjzI8eIW7KmmYvfhSZDpjV Jh5wtj4MW/tCREJVFb/MIMGmdrFq4flChzX0XUCRbKteAexgJCkBV/E4T62Bu662GcrK 93Uw== Received: by 10.180.99.65 with SMTP id eo1mr5281382wib.13.1330640991774; Thu, 01 Mar 2012 14:29:51 -0800 (PST) Received: from localhost (94-192-233-223.zone6.bethere.co.uk. [94.192.233.223]) by mx.google.com with ESMTPS id fw5sm44681145wib.0.2012.03.01.14.29.49 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Mar 2012 14:29:50 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [Patch v7 13/13] emacs: notmuch.el ignore excluded matches Date: Thu, 1 Mar 2012 22:30:45 +0000 Message-Id: <1330641045-27416-14-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1330641045-27416-1-git-send-email-markwalters1009@gmail.com> References: <1330641045-27416-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: Thu, 01 Mar 2012 22:29:54 -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. --- emacs/notmuch.el | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index f851c6f..99e0c93 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -872,16 +872,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