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 44245429E22 for ; Sun, 20 Feb 2011 11:52:44 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 o+F704HYlbPC for ; Sun, 20 Feb 2011 11:52:41 -0800 (PST) Received: from defaultvalue.org (defaultvalue.org [70.85.129.156]) by olra.theworths.org (Postfix) with ESMTP id DB003431FB6 for ; Sun, 20 Feb 2011 11:52:41 -0800 (PST) Received: from omen.defaultvalue.org (localhost [127.0.0.1]) by defaultvalue.org (Postfix) with ESMTP id 1F67E90D35; Sun, 20 Feb 2011 13:52:59 -0600 (CST) Received: from raven.defaultvalue.org (raven.defaultvalue.org [192.168.1.7]) by omen.defaultvalue.org (Postfix) with ESMTP id 172A05022F; Sun, 20 Feb 2011 13:52:41 -0600 (CST) Received: by raven.defaultvalue.org (Postfix, from userid 1000) id 003077BA2C5; Sun, 20 Feb 2011 13:52:40 -0600 (CST) From: Rob Browning To: Austin Clements Subject: Re: Folder search semantics References: <1295165458-9573-1-git-send-email-amdragon@mit.edu> <20110202050336.GB28537@mit.edu> <87sjw6hx2l.fsf@yoom.home.cworth.org> <20110203061429.GD28537@mit.edu> Date: Sun, 20 Feb 2011 13:52:40 -0600 In-Reply-To: <20110203061429.GD28537@mit.edu> (Austin Clements's message of "Thu, 3 Feb 2011 01:14:29 -0500") Message-ID: <87r5b24h6f.fsf@raven.defaultvalue.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) 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: Sun, 20 Feb 2011 19:52:44 -0000 Austin Clements writes: > As a consequence, all folders are subfolders of the inbox. With > recursive search, a search for your inbox folder returns *all* of your > messages. I wasn't trying to say that we shouldn't support recursive > search (I'm all for flexibility), but it's a confusing default for > Maildir++ because of this. > > Maildir++ has the added twist that the inbox folder has no name. As a > result, currently notmuch can't search for a Maildir++ inbox folder, > which needs to be addressed somehow. The least surprising approach > would compatibility with the Maildir++ convention of calling the > top-level folder INBOX, the subfolder INBOX.work, etc. Just adding my agreement here. With recursion and no anchors, "folder:" really won't work for the inbox for Maildir++. > Maildir++ issues aside, I submit that rooted, non-recursive folder > searches are a more natural default with a more conventional syntactic > extension to non-rooted/recursive searches. In > id:87aaiy3u65.fsf@yoom.home.cworth.org, you mentioned that you > implemented non-rooted folder search to mimic subject search. But file > system paths are not natural language like subject lines. File system > paths are hierarchical and rooted. > > Of course, special query operators like ^ and $ can mitigate this, but > these queries *aren't* regexps and, furthermore, people don't usually > apply regexps to file names. They apply globs. Glob syntax has the > added benefit of congruity with Xapian wildcard syntax. This naturally > leads to a rooted, non-recursive syntax by default (like globs), where a > * at the end means recursive and a * at the beginning means non-rooted. > In fact, we could easily generalize this to arbitrary shell globs. I agree with all of this. Something like fnmatch() sounds appropriate to me. In fact, I'd suggest that we implement this very much like fnmatch() with folder references like paths -- where "/" is always the separator, regardless of how things are handled in the underlying storage. So depending on the backend, foo/bar could refer to "Maildir/foo/bar" or "Maildir/.foo.bar". And personally, I think I'd prefer that folder: be anchored by default, so that folder:work means "the top-level folder named work", but it's not a big deal to me as long as there's a fairly easy way to specify exactly what I want. -- Rob Browning rlb @defaultvalue.org and @debian.org GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4