Re: [notmuch] [PATCH] Make search filters handle disjunctive queries.

Subject: Re: [notmuch] [PATCH] Make search filters handle disjunctive queries.

Date: Mon, 23 Nov 2009 19:48:46 +0100

To: Keith Packard, notmuch@notmuchmail.org, cworth@cworth.org

Cc:

From: Jed Brown


On Mon, 23 Nov 2009 10:26:47 -0800, Keith Packard <keithp@keithp.com> wrote:

> Remember to split patches which do more than one thing into separate
> commits.

These are variants of the same operation, but I'll split in the future.

> > +  (let ((grouped-query (if (string-match-p notmuch-search-disjunctive-regexp query) (concat "( " query " )") query)))
> > +    (notmuch-search (concat notmuch-search-query-string " and " grouped-query) notmuch-search-oldest-first)))
> 
> Is there some reason not to just always add the parens?

That's what I did initially, but it's messy to look at in the mode line
after applying successive filters.

> This seems useful; how does it deal with the tag completion stuff?

It doesn't do anything special, but I haven't been following that
carefully.  My thought was that eventually the regular interactive
search and filters, would have semantic completion, e.g. the user enters

  tag:ab<TAB>

and tags would be completed, but they could also do

  from:long.unwieldy.addr<TAB>

In filter-by-tag, the natural thing would be to only complete tags, the
user would be on their own to spell out AND, OR, and NOT.  Unfortunately
I'm not familiar enough with elisp to implement this quickly.

A closely related issue is managing the address book.  I guess the usual
advice is to use BBDB.  I don't know if it's better to hook into that or
for Notmuch to have it's own lightweight approach.  I could imagine
harvesting addresses of everyone I've sent mail to and giving me a
semi-automated way to merge addresses that are likely to point to the
same person.


Jed

Thread: