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 E410B431FAF for ; Thu, 19 Jan 2012 14:59:29 -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 0JFMskQZueQX for ; Thu, 19 Jan 2012 14:59:29 -0800 (PST) Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU [18.9.25.12]) by olra.theworths.org (Postfix) with ESMTP id 4BA94431FAE for ; Thu, 19 Jan 2012 14:59:29 -0800 (PST) X-AuditID: 1209190c-b7fad6d000000920-d7-4f18a050a176 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id D9.05.02336.050A81F4; Thu, 19 Jan 2012 17:59:29 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q0JMxSwt030607; Thu, 19 Jan 2012 17:59:28 -0500 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0JMxR1x020507 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Thu, 19 Jan 2012 17:59:28 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1Ro0wo-0004N4-1c; Thu, 19 Jan 2012 17:59:10 -0500 Date: Thu, 19 Jan 2012 17:59:10 -0500 From: Austin Clements To: Mark Walters Subject: Re: [PATCH] Automatically exclude tags in notmuch-show Message-ID: <20120119225910.GT16740@mit.edu> References: <874nvric7c.fsf@qmul.ac.uk> <1327010583-23954-1-git-send-email-markwalters1009@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1327010583-23954-1-git-send-email-markwalters1009@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42IRYrdT0Q1cIOFv8NbZYvVcHovrN2cyOzB5 7Jx1l93j2apbzAFMUVw2Kak5mWWpRfp2CVwZC5b+Yy9o4q/4/8mzgfEGdxcjJ4eEgInEo9ZX jBC2mMSFe+vZuhi5OIQE9jFKTD0zA8rZwCixdGc3lHOSSeLsuvmMEM4SRolZ72cxg/SzCKhK tD1fwwpiswloSGzbvxxsroiAjsTtQwvYQWxmAWmJb7+bmUBsYQF7iclLF4P18gLV3DnRydLF yAE0NF3i9ANniLCgxMmZT1ggWrUkbvx7yQRSAjJm+T8OkDCngJfEmtYpYFtFBVQkppzcxjaB UWgWku5ZSLpnIXQvYGRexSibklulm5uYmVOcmqxbnJyYl5dapGuol5tZopeaUrqJERTQnJI8 OxjfHFQ6xCjAwajEw8vlKuEvxJpYVlyZe4hRkoNJSZR303ygEF9SfkplRmJxRnxRaU5q8SFG CQ5mJRHehj6gHG9KYmVValE+TEqag0VJnFdF650f0LuJJanZqakFqUUwWRkODiUJXieQoYJF qempFWmZOSUIaSYOTpDhPEDD14DU8BYXJOYWZ6ZD5E8x6nJ8+d12nlGIJS8/L1VKnLcXpEgA pCijNA9uDiwRvWIUB3pLmHc1SBUPMInBTXoFtIQJaIlHkxjIkpJEhJRUAyNfcda0yoodBi/Z wr78uFYnO9F9W8SfU29j/5RPPLZM7n61QG216Dzb2Ztm/Lb+FfnlU/x/5cXp90MbEuVXGa+r ruo01xJ1uqvwec32H193JO0vjRZ8d/bGDUvFYm+dcy7LvBuijLeapc2f9/R/k0OIcOP5PUZH vQqdQsOvVGyS9NyzyophdY0SS3FGoqEWc1FxIgCB5IqFHwMAAA== 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 22:59:30 -0000 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. 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;