[notmuch] [RFC] Precedence of OR and AND

Subject: [notmuch] [RFC] Precedence of OR and AND

Date: Sun, 22 Nov 2009 22:26:31 +0100

To: notmuch@notmuchmail.org

Cc:

From: Jed Brown


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

Thread: