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 651E0431FBC for ; Sat, 3 Mar 2012 05:03:46 -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 FcdlkmGKudoW for ; Sat, 3 Mar 2012 05:03:44 -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 E6D10431FAF for ; Sat, 3 Mar 2012 05:03:43 -0800 (PST) Received: by mail-wi0-f181.google.com with SMTP id o1so697694wic.26 for ; Sat, 03 Mar 2012 05:03:43 -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=99ZNVLORcVmb+s8yFoXhDtarvdyLmEZF5wNmGojsaVg=; b=yK9mYfN6YFV582ExxyPc1SnCkOKO43jWnZvysRzjUFH0kH2xwXl+Kn0PmO8q4Igniz DgQovtox322HYvhzAKCXfBjRMvrWtulMXUYRFFUp3HE1r7pG7FrZn3MIsK9KG8SZGiCC yRMu8xUYytIqNGeLMpcJgYLnxW45yTtoUWIF5teXTBzwyQxtVGlH2lP2lzoddKOytaGb 8+3sc0/5Q7/eVEGL8oS/81OA6jqxgO5W6TinaiEC1JEBMD6oQQqZslO3dYy/yfnt0wRR uBloHqV9ld6CK8+jsPpV06sJkoOfTtErF539guDWnGPkx34Z5QoN/AwTi4/+YqrUft2S XzUQ== Received: by 10.180.88.164 with SMTP id bh4mr2991649wib.22.1330779823655; Sat, 03 Mar 2012 05:03:43 -0800 (PST) Received: from localhost (94-192-233-223.zone6.bethere.co.uk. [94.192.233.223]) by mx.google.com with ESMTPS id gf3sm9368279wib.6.2012.03.03.05.03.42 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 03 Mar 2012 05:03:42 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH 1/5] lib: rename (and negate) set_omit_excluded set_with_excluded Date: Sat, 3 Mar 2012 13:05:14 +0000 Message-Id: <1330779918-28024-2-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1330779918-28024-1-git-send-email-markwalters1009@gmail.com> References: <1330779918-28024-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: Sat, 03 Mar 2012 13:03:46 -0000 Rename the function notmuch_query_set_omit_excluded_messages to notmuch_query_set_with_excluded_messages and negate its meaning. Note the suite will not compile currently as the callers of notmuch_query_set_omit_excluded_messages have not been updated yet. --- lib/notmuch.h | 12 +++++++----- lib/query.cc | 10 +++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/notmuch.h b/lib/notmuch.h index babd208..53ec82e 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -449,12 +449,14 @@ typedef enum { const char * notmuch_query_get_query_string (notmuch_query_t *query); -/* Specify whether to results should omit the excluded results rather - * than just marking them excluded. This is useful for passing a - * notmuch_messages_t not containing the excluded messages to other - * functions. */ +/* Specify whether to results should include the excluded results + * (marking them excluded) rather than just omitting them. Note when + * calling notmuch_query_search_threads, the returned thread will + * contain all messages regardless of this setting but, unless this is + * set, only threads matching in a non-excluded message will be + * returned. */ void -notmuch_query_set_omit_excluded_messages (notmuch_query_t *query, notmuch_bool_t omit); +notmuch_query_set_with_excluded_messages (notmuch_query_t *query, notmuch_bool_t with_excluded); /* Specify the sorting desired for this query. */ void diff --git a/lib/query.cc b/lib/query.cc index ab18fbc..cf8dfd0 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -28,7 +28,7 @@ struct _notmuch_query { const char *query_string; notmuch_sort_t sort; notmuch_string_list_t *exclude_terms; - notmuch_bool_t omit_excluded_messages; + notmuch_bool_t with_excluded; }; typedef struct _notmuch_mset_messages { @@ -86,7 +86,7 @@ notmuch_query_create (notmuch_database_t *notmuch, query->exclude_terms = _notmuch_string_list_create (query); - query->omit_excluded_messages = FALSE; + query->with_excluded = FALSE; return query; } @@ -98,9 +98,9 @@ notmuch_query_get_query_string (notmuch_query_t *query) } void -notmuch_query_set_omit_excluded_messages (notmuch_query_t *query, notmuch_bool_t omit) +notmuch_query_set_with_excluded_messages (notmuch_query_t *query, notmuch_bool_t with_excluded) { - query->omit_excluded_messages = omit; + query->with_excluded = with_excluded; } void @@ -216,7 +216,7 @@ notmuch_query_search_messages (notmuch_query_t *query) exclude_query = Xapian::Query (Xapian::Query::OP_AND, exclude_query, final_query); - if (query->omit_excluded_messages) + if (!query->with_excluded) final_query = Xapian::Query (Xapian::Query::OP_AND_NOT, final_query, exclude_query); else { -- 1.7.2.3