From: Jean-Marc Liotier Date: Tue, 10 Mar 2015 12:21:38 +0000 (+0100) Subject: Re: Alternative to no longer supported folder:foo* wildcard matching ? X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ad6a315df0214d74d3b58801a7c080c86af45b7e;p=notmuch-archives.git Re: Alternative to no longer supported folder:foo* wildcard matching ? --- diff --git a/da/d3f35f8cc6e9a839821b7ed0917f0d432eeaf8 b/da/d3f35f8cc6e9a839821b7ed0917f0d432eeaf8 new file mode 100644 index 000000000..ab215afbd --- /dev/null +++ b/da/d3f35f8cc6e9a839821b7ed0917f0d432eeaf8 @@ -0,0 +1,132 @@ +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 A362F431FB6 + for ; Tue, 10 Mar 2015 05:22:14 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.438 +X-Spam-Level: ** +X-Spam-Status: No, score=2.438 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438] 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 bHSZ0IZR-xzJ for ; + Tue, 10 Mar 2015 05:22:11 -0700 (PDT) +Received: from kivu.grabeuh.com (kivu.grabeuh.com [212.85.152.17]) + (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id D21E4431FAF + for ; Tue, 10 Mar 2015 05:22:10 -0700 (PDT) +Received: from localhost (localhost [127.0.0.1]) + by kivu.grabeuh.com (Postfix) with ESMTP id 43619B3594F; + Tue, 10 Mar 2015 13:22:06 +0100 (CET) +X-Virus-Scanned: by a bunch of giggling Japanese schoolgirls at + kivu.grabeuh.com +Received: from kivu.grabeuh.com ([127.0.0.1]) + by localhost (kivu.grabeuh.com [127.0.0.1]) (amavisd-new, port 10024) + with LMTP id PtNMdG-S2zdC; Tue, 10 Mar 2015 13:21:39 +0100 (CET) +Received: from [127.0.0.1] (nawak.grabeuh.com [212.85.154.15]) + (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) (Authenticated sender: jim) + by kivu.grabeuh.com (Postfix) with ESMTPSA id 69A56B3594B; + Tue, 10 Mar 2015 13:21:39 +0100 (CET) +Message-ID: <54FEE1D2.9000108@liotier.org> +Date: Tue, 10 Mar 2015 13:21:38 +0100 +From: Jean-Marc Liotier +User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; + rv:31.0) Gecko/20100101 Thunderbird/31.3.0 +MIME-Version: 1.0 +To: David Bremner , notmuch@notmuchmail.org +Subject: Re: Alternative to no longer supported folder:foo* wildcard matching + ? +References: <54FDFAAB.9080504@liotier.org> + <877fupzuzc.fsf@maritornes.cs.unb.ca> + <54FE37F4.7090605@liotier.org> + <87a8zlxr86.fsf@maritornes.cs.unb.ca> +In-Reply-To: <87a8zlxr86.fsf@maritornes.cs.unb.ca> +Content-Type: text/plain; charset=utf-8; format=flowed +Content-Transfer-Encoding: 7bit +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: Tue, 10 Mar 2015 12:22:14 -0000 + +On 10/03/2015 08:10, David Bremner wrote: +> [..] In fact the NM_myTopLevelFolder doesn't seem useful to me, +> since you don't gain any new queries that way. +> +> So if you have .foo.* and .bar.*, I would +> +> mkdir foo +> ln -rs .foo.* -t foo + +I had forgotten I could make a maildir without initial . just as well - +thus removing the need for my silly prefix: with dot is a normal +maildir, without is a top-level Notmuch symlink container. + +> in notmuch jargon, the number of _messages_ does not increase but +> rather the number of _files_. + +That makes sense since, from what I read in notmuch-insert.c, the +messages are identified by message-id and therefore counted only once +however many times they are encountered during notmuch new. + +> so --remove-dups becomes +> mandatory in any search query +> Based on the name, I'd suspect "remove-dups" corresponds roughly to the +> default behaviour of notmuch in reporting results. + +Yes, though --duplicate=N is only supported with --output=files and +--output=messages, and it is not even appear the default there since { +NOTMUCH_OPT_INT, &ctx->dupe, "duplicate", 'D', 0 } in notmuch-search.c + +Otherwise it does behaves as implicitly removing duplicates, which was +somewhat confusing me until I understood notmuch's conceptual +distinction between files and messages. + +> notmuch count not 'path:list/**' +> and +> notmuch count not 'path:list/**' and from:bremner +> +> work as expected. + +Indeed they do - both with notmuch and notmuch-mutt... I just had to +struggle a bit until I realized that my notmuch-mutt --output-dir is +inside the maildir indexed by notmuch... So the number of result and +duplicates varied according to what state the symlink results maildir +was in when I last indexed the whole thing... + +Yes, I do need the --output-dir to be inside the maildir because the +IMAP server lets me have my search results in any MUA I happen to be +using (Thunderbird, K-9 or Outlook for example). And by the way, maybe +notmuch-mutt should be named notmuch-maildir or notmuch-symlinks : the +mutt part is just about setting the macros in ~/.muttrc - everything +else is generic to anything that can read a maildir. + +So my indexing command is now : + +notmuch tag +nmsearchresult 'path:.=Search/**' && notmuch new + +With ~/.notmuch-config now containing: + +[search] +exclude_tags=deleted;spam;nmsearchresult + +And it works. + +I would have prefered explicit folder inclusion/exclusion at query time +and path inclusion/exclusion at indexing time... But I guess I'll get +used to notmuch's logic of tagging everything and then using the tags. + +Thank you for your kind guidance !