Re: Complex virtual folder

Erik Hetzner <[email protected]> Fri, 04 Jan 2019 08:21:29 -0800
Newsgroups gmane.mail.wanderlust.general
Message-ID <5c2f880a.1c69fb81.c2cb7.7d89__16179.8430527144$1546618856$gmane$org@mx.google.com>
Hi Greg,

On Thu, 03 Jan 2019 18:52:40 -0800,
"Greg A. Woods" <[email protected]> wrote:
> 
> […]
> 
> I'm not sure I'm reading it entirely correctly, but my understanding is
> that the IMAPv4 SEARCH command uses NPN (normal Polish Notation, aka
> prefix notation), and so the use of parenthesis for grouping is not
> going to work the way elmo-imap4 is doing it.  I.e. it should look a wee
> bit more like lisp than C, and indeed one test confirms:
> 
> . SEARCH (OR KEYWORD NotJunk KEYWORD JunkRecorded)
> * SEARCH 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 88 93 94 95 98 102 103 104 115 116 118 119 122 123 126 127 128 129 130 132 133 134 135 139 140 146 147 149 150 152
> . OK Completed (84 msgs in 0.000 secs)

I believe the intention is to keep the arguments to the OR search
query properly separated when the arguments are themselves complex
queries, e.g.:

[23:52:30] <-- elmo-imap46 uid search CHARSET us-ascii OR  ( body foo ) ( from greg to john )

(A query generate with: V OR body foo AND from greg to john)

It may not be the best (or even correct) way to do this. I wrote this
code, but I believe I inherited the basic logic.

The problem may have to do more with whitespace than with parentheses.
This session is from connecting directly to gmail:

. SEARCH OR (from john) (from greg)
* SEARCH 2
. OK SEARCH completed (Success)
. SEARCH OR ( from john ) ( from greg )
. BAD Could not parse command

best, Erik