From 2215e339d09098e6ebe27f1a40b4a8267520cda0 Mon Sep 17 00:00:00 2001 From: Jean-Marc Liotier Date: Tue, 10 Mar 2015 01:16:52 +0100 Subject: [PATCH] Re: Alternative to no longer supported folder:foo* wildcard matching ? --- 92/736c7a26cd9b299d8f1b5f59068fa81bb89efb | 108 ++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 92/736c7a26cd9b299d8f1b5f59068fa81bb89efb diff --git a/92/736c7a26cd9b299d8f1b5f59068fa81bb89efb b/92/736c7a26cd9b299d8f1b5f59068fa81bb89efb new file mode 100644 index 000000000..e42e261e9 --- /dev/null +++ b/92/736c7a26cd9b299d8f1b5f59068fa81bb89efb @@ -0,0 +1,108 @@ +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 19681431FAF + for ; Mon, 9 Mar 2015 17:17:05 -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 L98fsaml7ih0 for ; + Mon, 9 Mar 2015 17:17:01 -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 C3E1E431FAE + for ; Mon, 9 Mar 2015 17:17:01 -0700 (PDT) +Received: from localhost (localhost [127.0.0.1]) + by kivu.grabeuh.com (Postfix) with ESMTP id DEAA981D4E3; + Tue, 10 Mar 2015 01:16:58 +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 G4vu1vAnb4Yj; Tue, 10 Mar 2015 01:16:52 +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 8C83CC24E64; + Tue, 10 Mar 2015 01:16:52 +0100 (CET) +Message-ID: <54FE37F4.7090605@liotier.org> +Date: Tue, 10 Mar 2015 01:16:52 +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> +In-Reply-To: <877fupzuzc.fsf@maritornes.cs.unb.ca> +Content-Type: text/plain; charset=windows-1252; format=flowed +Content-Transfer-Encoding: 8bit +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 00:17:05 -0000 + +On 09/03/2015 23:06, David Bremner wrote: +> Jean-Marc Liotier writes: +>> So nowadays, is there any other way to express "this folder and all its subfolders" ? The path: keyword does not seem useful for that with a maildir with a flat structure of dot.delimited.directories - or is there something like a dot.delimited.* wildcard ? +> One option is to create symlink farm. Since it's only directories being +> symlinked, it isn't that bad. I don't know how well this scales, but it +> seems to work for about 200k messages in 184 mailing lists. + +On the plus side: it works. Here is my interpretation of the idea: + +% cd ~/Maildir +% mkdir .NM_myTopLevelFolder +% ln -rs .myTopLevelFolder* -t .NM_myTopLevelFolder +% rm -f .NM_myTopLevelFolder/.myTopLevelFolder +% notmuch new +% notmuch-mutt --remove-dups --output-dir ~/Maildir/.=Search \ + search keyword and "path:.NM_myTopLevelFolder/**" + +So, thanks for this workaround suggestion. + +On the downside: +- It doubles the number of messages to index (though then even +multiplied by two, my 300k messages are Not Much Mail™ - but still...) +- myTopLevelFolder gets a NM_myTopLevelFolder twin and restricting the +search scope to it requires using its twin's name +- The additional messages are duplicates, so --remove-dups becomes +mandatory in any search query +- This method is good for restricting the search scope to a directory, +but not for excluding a directory from the search scope... Which alas is +what I desire most... + + +> Roughly +> speaking: +> +> % mkdir list +> % cd list +> % ln -s ../.list.* . +> % mmv .list.* * # zsh specific, optional +> % notmuch new +> +> Notmuch new took about 10 minutes, but now I can search +> +> 'path:list/**' +> +> + -- 2.26.2