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 0A347431FAF for ; Thu, 19 Jan 2012 15:56:31 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 TsPonQAoTfu2 for ; Thu, 19 Jan 2012 15:56:30 -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 44BDE431FAE for ; Thu, 19 Jan 2012 15:56:30 -0800 (PST) Received: by wibhr12 with SMTP id hr12so3989wib.26 for ; Thu, 19 Jan 2012 15:56:29 -0800 (PST) Received: by 10.180.101.164 with SMTP id fh4mr8122493wib.0.1327017389038; Thu, 19 Jan 2012 15:56:29 -0800 (PST) Received: from localhost ([109.131.97.13]) by mx.google.com with ESMTPS id l8sm3103914wiy.5.2012.01.19.15.56.28 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Jan 2012 15:56:28 -0800 (PST) From: Pieter Praet To: Austin Clements , Mark Walters Subject: Re: [PATCH] Automatically exclude tags in notmuch-show In-Reply-To: <20120119225910.GT16740@mit.edu> References: <874nvric7c.fsf@qmul.ac.uk> <1327010583-23954-1-git-send-email-markwalters1009@gmail.com> <20120119225910.GT16740@mit.edu> User-Agent: Notmuch/0.11+99~gab86e73 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-unknown-linux-gnu) Date: Fri, 20 Jan 2012 00:54:43 +0100 Message-ID: <87fwfbuu2k.fsf@praet.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: notmuch@notmuchmail.org 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, 19 Jan 2012 23:56:31 -0000 On Thu, 19 Jan 2012 17:59:10 -0500, Austin Clements wrote: > LGTM, but should definitely come with a test. > [...] > Also, this won't commute with Pieter's patch > (id:"1327000744-25463-2-git-send-email-pieter@praet.org"), so one or > the other will have to get updated. > No problem, I'll have to resubmit my entire series anyway, so go right ahead. > Quoth Mark Walters on Jan 19 at 10:03 pm: > > Add the use of auto_exclude_tags in notmuch-show.c. As with Austin's > > patch (commit 42a907992823030f070fc395a174f779998ca6f5) it just adds > > the excluded tags to the query so the excluded messages will still > > appear in the emacs interface, but as a single header line rather than > > as a matching message. > > --- > > notmuch-show.c | 8 ++++++++ > > 1 files changed, 8 insertions(+), 0 deletions(-) > > > > diff --git a/notmuch-show.c b/notmuch-show.c > > index d14dac9..925dfd6 100644 > > --- a/notmuch-show.c > > +++ b/notmuch-show.c > > @@ -948,9 +948,12 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[])) > > char *opt; > > const notmuch_show_format_t *format = &format_text; > > notmuch_show_params_t params; > > + const char **auto_exclude_tags; > > + size_t auto_exclude_tags_length; > > int mbox = 0; > > int format_specified = 0; > > int i; > > + unsigned int j; > > Hah. The original patch series updated 'count' to use the new > argument parsing solely so I could steal 'i' for the tag exclude code. > > > > > params.entire_thread = 0; > > params.raw = 0; > > @@ -1040,6 +1043,11 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[])) > > return 1; > > } > > > > + auto_exclude_tags = notmuch_config_get_auto_exclude_tags > > + (config, &auto_exclude_tags_length); > > + for (j = 0; j < auto_exclude_tags_length; j++) > > + notmuch_query_add_tag_exclude (query, auto_exclude_tags[j]); > > + > > /* if part was requested and format was not specified, use format=raw */ > > if (params.part >= 0 && !format_specified) > > format = &format_raw; > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch Peace -- Pieter