[notmuch] First attempt to add smart completion in notmuch-search

Subject: [notmuch] First attempt to add smart completion in notmuch-search

Date: Fri, 18 Dec 2009 16:00:49 +0100

To: notmuch@notmuchmail.org


From: racin@free.fr


Here is a first attempt to add "smart completion" to notmuch-search.

What it does is that:

 - It tries to detects when you hit tab to complete a search term
   prefix (like to, from, subject...) , and if so completes your

 - If you try to complete a search term usign a specific prefix (like
   to), it helps you complete it using prefix founds in the messages
   matching the current search string.

The patch has a Emacs-lisp part and a C part.

I'm submitting the patch to know what people think of it, but there
are some things still uncomplete:

 - I think headers should be parsed so that a better output is
   proposed, but I don't know which one yet;

 - There may be performance issues (because fetching headers require
   looking them in each message file), but I'm not sure if this is
   really a problem (since we already fetch headers to display it in
   the summary buffer).

 - I have a problem that notmuch-search-query-string is buffer-local
   and I can't access it from the minibuffer, which I don't know how
   to solve properly

 - There are still some glitches with the "".

 - There may be many other improvements that I haven't thought of.

Anyway, I hope it's useful; I'll continue working on it when I come
back from Holidays.

Thanks for your input,