[notmuch] [RFC] Precedence of OR and AND

Bart Trojanowski bart at jukie.net
Sun Nov 22 13:36:49 PST 2009

Wouldn't this problem be solved by each filter appending a bracketed
version of your filter?

You start with tag:inbox and you filter on "term1 or term2" you'd get:

        tag:inbox and (term1 or term2)

Doing it again would result in...

        tag:inbox and (term1 or term2) and (term3 or term4)

To me, it would seem the most intuitive solution.

Actually, I think I'll add that to notmuch.vim right now. :)


* Jed Brown <jed at 59A2.org> [091122 16:26]:
> Currently OR binds more weakly than AND, which is natural in most
> contexts, but I think it is rarely desirably for this sort of search.
> Suppose I am in looking at my inbox and decide to filter by
>   term1 OR term2
> Notmuch makes the query
>   tag:inbox AND term1 OR term2
> which is actually
>   (tag:inbox AND term1) OR term2
> and not at all what I wanted.  Adding the necessary parentheses to
> notmuch-search-filter is trivial but it requires more parentheses for
> the overwhelming majority of searches that I think are more common.
> Are most searches indeed closer to conjunctive form?
> Should OR bind tighter than AND?
> Jed
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

				WebSig: http://www.jukie.net/~bart/sig/

More information about the notmuch mailing list