From: Keith Amidon Date: Tue, 23 Sep 2014 05:27:29 +0000 (+1700) Subject: Re: Do path: searches handle spaces correctly? X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=674e959f6de0c91af82a48e2c9e494944fb793be;p=notmuch-archives.git Re: Do path: searches handle spaces correctly? --- diff --git a/9b/e98e3121296919935eb4052f9747697534cc1f b/9b/e98e3121296919935eb4052f9747697534cc1f new file mode 100644 index 000000000..1e7812120 --- /dev/null +++ b/9b/e98e3121296919935eb4052f9747697534cc1f @@ -0,0 +1,84 @@ +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 26F86431FAF + for ; Mon, 22 Sep 2014 22:27:35 -0700 (PDT) +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 MzmTKJXbsZ7D for ; + Mon, 22 Sep 2014 22:27:30 -0700 (PDT) +Received: from picnicpark.org (picnicpark.org [130.94.181.238]) + by olra.theworths.org (Postfix) with ESMTP id 873C3431FAE + for ; Mon, 22 Sep 2014 22:27:30 -0700 (PDT) +Received: (qmail 53178 invoked by uid 13806); 23 Sep 2014 05:27:29 -0000 +Received: from unknown (HELO gw.picnicpark.org) ([108.225.17.54]) + (envelope-sender ) + by 130.94.181.238 (qmail-ldap-1.03) with SMTP + for ; 23 Sep 2014 05:27:29 -0000 +Received: from friend.picnicpark.org (friend.picnicpark.org [192.168.35.1]) + by gw.picnicpark.org (Postfix) with ESMTPSA id 8D71112A0D9D; + Mon, 22 Sep 2014 22:27:29 -0700 (PDT) +Message-ID: <1411450049.1931.93.camel@picnicpark.org> +Subject: Re: Do path: searches handle spaces correctly? +From: Keith Amidon +To: Austin Clements +Date: Mon, 22 Sep 2014 22:27:29 -0700 +In-Reply-To: <20140922150607.GA7970@csail.mit.edu> +References: <878uleklvt.fsf@awakenetworks.com> + <87tx40ggf1.fsf@maritornes.cs.unb.ca> + <1411396931.1931.91.camel@picnicpark.org> + <20140922150607.GA7970@csail.mit.edu> +Content-Type: text/plain; charset="UTF-8" +X-Mailer: Evolution 3.12.5 +Mime-Version: 1.0 +Content-Transfer-Encoding: 7bit +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: Tue, 23 Sep 2014 05:27:35 -0000 + +On Mon, 2014-09-22 at 15:06 +0000, Austin Clements wrote: +> I assume you're doing this from the command line? Does the following +> work? +> +> notmuch search --output=files 'path:"dir/INBOX/INBOX/Sent Items/**"' +> +> Shell quoting and Xapian quoting interact in often confusing ways. In +> your original command line, the single quotes suppress shell argument +> splitting, but never make it to notmuch, so notmuch sees two search +> terms "path:dir/INBOX/INBOX/Sent" and "Items/**". In the command line +> I suggested, the single quotes play the same role, but for the entire +> query. Because of the quoting, notmuch *does* see the inner double +> quotes, which makes the path a single term (note that Xapian only +> accepts double quotes, not single quotes). In general, it's good to +> enclose the entire command line query in single quotes so shell +> parsing doesn't get in the way of query parsing. + +Bingo. That was it. Thanks for clarifying how the quoting interacts. + +What do you think about adding a section to the notmuch-search-terms web +page that talks in more detail about the quoting interactions? If there +were on obvious section about this in the man page it might have helped +me find the issue myself. If this seems like a good idea I'll take a +crack at it later this week when I get time to research the Xapian +quoting in a bit more detail. + + --- Keith +