Re: Do path: searches handle spaces correctly?

2014-09-23 Thread David Bremner
Keith Amidon cama...@picnicpark.org writes:


 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.

Yes, it makes sense to add such a section.

d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Do path: searches handle spaces correctly?

2014-09-22 Thread David Bremner
Keith Amidon ke...@awakenetworks.com writes:


 notmuch search --output=files path:'dir/INBOX/INBOX/Sent Items'

 I don't get any results, but it seems like the two results above should
 be shown, right?  Am I doing something wrong here?  If it looks like I'm
 doing it correctly, what can I do to help troubleshoot the issue?

Note that path:, unlike folder:, does not add the maildir subdirs. Dunno
if that's the only issue you are having, but I guess it's one.

d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Do path: searches handle spaces correctly?

2014-09-22 Thread Austin Clements
Quoth Keith Amidon on Sep 22 at  7:42 am:
 On Mon, 2014-09-22 at 11:20 +0200, David Bremner wrote:
  Keith Amidon ke...@awakenetworks.com writes:
  
   notmuch search --output=files path:'dir/INBOX/INBOX/Sent Items'
  
   I don't get any results, but it seems like the two results above should
   be shown, right?  Am I doing something wrong here?  If it looks like I'm
   doing it correctly, what can I do to help troubleshoot the issue?
  
  Note that path:, unlike folder:, does not add the maildir subdirs. Dunno
  if that's the only issue you are having, but I guess it's one.
 
 Darn it!  I made a mistake in my original email.  In the test I was
 doing I actually had:
 
 notmuch search --output=files path:'dir/INBOX/INBOX/Sent Items/**'
 
 which I believe should have picked up all the subdirectory paths.  I
 just retested to make sure that it still didn't work, and it doesn't.
 
 Am I still missing something?   Thanks for the help, Keith

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.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Do path: searches handle spaces correctly?

2014-09-22 Thread Keith Amidon
On Mon, 2014-09-22 at 15:06 +, 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

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch