From: Jani Nikula Date: Sat, 25 Jan 2014 18:22:16 +0000 (+0200) Subject: Re: [PATCH 0/5] lib: make folder: prefix literal X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9651c5d43d4e008c8779c4863137959f8a124e0b;p=notmuch-archives.git Re: [PATCH 0/5] lib: make folder: prefix literal --- diff --git a/e3/27ed79669471b3f570ae0d441bb55a48a58587 b/e3/27ed79669471b3f570ae0d441bb55a48a58587 new file mode 100644 index 000000000..e2ab7c9ec --- /dev/null +++ b/e3/27ed79669471b3f570ae0d441bb55a48a58587 @@ -0,0 +1,131 @@ +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 1D2B8431FBD + for ; Sat, 25 Jan 2014 10:22: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 nWbWlWagWG32 for ; + Sat, 25 Jan 2014 10:22:21 -0800 (PST) +Received: from mail-ee0-f51.google.com (mail-ee0-f51.google.com + [74.125.83.51]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 04AAD431FBC for ; Sat, 25 Jan 2014 10:22:20 -0800 + (PST) +Received: by mail-ee0-f51.google.com with SMTP id b57so1523749eek.38 + for ; Sat, 25 Jan 2014 10:22:19 -0800 (PST) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:subject:in-reply-to:references + :user-agent:date:message-id:mime-version:content-type; + bh=z74TPMS2B9PaAc9rC0Rwg893m0GzUdgFw8MnDBYbG6Q=; + b=YNr6kkTBuwP05QGBW0UctQWPrGxicAveOkMsSUl3xNioI2Bjpm/npF9B+vAE4IjR+1 + Ko3ucf0yG47A66EXU7Zhzqlhg5dBod9CGFElgs3eZ+8v8QtTVcjkKSqq4gFBrNTGXL3j + jwjaVIAdsRCwa7jrbVfYYv8bhiVS8QllXVV1GD5/Q9qLkYacdJwnrrj/b/RvxWpcFwmZ + S3rzs9yvwghyPUtubd4BEKAMSS14eNCXcnW7e9miqfeaJ+dgPPQZMxECQP9ysFmCVIj/ + OcaGpKkwRnKw35WSdZ+/nomFp2lYQBebZ7usHK/HHH4iBGlW43aepGT23wohG8lOSdJ2 + lQnQ== +X-Gm-Message-State: + ALoCoQlcZfp+A4ydKuqp5xWlMhw6hkwe4BNGDjq7/ZFtlDUk4RlcvPq2WPXojHAPErwHi9SqtgUQ +X-Received: by 10.14.126.1 with SMTP id a1mr14117550eei.81.1390674139556; + Sat, 25 Jan 2014 10:22:19 -0800 (PST) +Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi. + [88.195.111.91]) by mx.google.com with ESMTPSA id + b41sm18760342eef.16.2014.01.25.10.22.17 for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Sat, 25 Jan 2014 10:22:18 -0800 (PST) +From: Jani Nikula +To: David Bremner , + Austin Clements , notmuch@notmuchmail.org +Subject: Re: [PATCH 0/5] lib: make folder: prefix literal +In-Reply-To: <87lhy4nglq.fsf@zancas.localnet> +References: + <87y525m649.fsf@awakening.csail.mit.edu> + <87r47wfltb.fsf@nikula.org> <87iot8f4vg.fsf@nikula.org> + <87lhy4nglq.fsf@zancas.localnet> +User-Agent: Notmuch/0.17+44~ge3b4cd9 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +Date: Sat, 25 Jan 2014 20:22:16 +0200 +Message-ID: <87fvobgbvr.fsf@nikula.org> +MIME-Version: 1.0 +Content-Type: text/plain +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, 25 Jan 2014 18:22:29 -0000 + +On Sat, 25 Jan 2014, David Bremner wrote: +> Jani Nikula writes: +> +>> On Sat, 25 Jan 2014, Jani Nikula wrote: +>>> Perhaps we need to have two prefixes, one of which is the literal +>>> filesystem folder and another which hides the implementation details, +>>> like I mentioned in my mail to Peter [1]. But consider this: my proposed +>>> implementation does cover *all* use cases. +>> +>> Here's a thought. With boolean prefix folder:, we can devise a scheme +>> where the folder: query defines what is to be matched. +>> +>> For example: +>> +>> folder:foo match files in foo, foo/new, and foo/cur. +>> folder:foo/ match all files in all subdirectories under foo (this +>> would handle Tomi's use case), including foo/new and +>> foo/cur. +> +> handling hierarchies sounds useful and natural +> +>> folder:foo/. match in foo only, and specifically not in foo/cur or foo/new. +>> folder:foo/new match in foo/new, and specifically not in foo/cur (this +>> allows distinguishing between messages in cur and new). +> +> is "new" special cased here? or do you rely on it being a leaf +> directory? + +A little bit of both I guess; not too bad. + +An alternative might be to make the variant without the trailing / +recursive, so folder:foo would match all files in all subdirectories +under foo, including foo/new and foo/cur. This would be more compatible +with the current folder: prefix too. + +Then, if you wanted to match without recursion, you'd have to have +"folder:foo/. OR folder:foo/new OR folder:foo/cur" assuming new and cur +are leaf nodes, and if not, with "/." at the end. + +But you'd have to decide what to do with "folder:foo/" which would then +match nothing. + +There's definitely room for thoughts and discussion. + +>> folder:/ match everything. +>> folder:/. match in top level maildir only. +>> folder:"" match in top level maildir, including cur/new. +> +> I could certainly support this UI, assuming the database bloat is not +> too bad. +> +> I started to wonder about using 3 prefixes instead, but then I read your +> message again and a light went on. ;). + +\o/ + + +BR, +Jani.