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

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

Date: Wed, 2 Dec 2009 15:38:54 +0100

To: Jed Brown

Cc: notmuch@notmuchmail.org

From: Jan Janak


Jed,

On 02-12 14:46, Jed Brown wrote:
> On Wed, 2 Dec 2009 14:18:08 +0100, Jan Janak <jan@ryngle.com> wrote:
> > I haven't been really following this thread in detail. What is that you need
> > from notmuch-select-tag-with-completion? To be able to process a list of tags
> > separated by spaces? Maybe I could help you with that.
> 
> No, it would need to take input separated by spaces, now I just get `[No
> match]' when I try to enter a space.  I think it's just not how
> completing-read works, the idea would be for the user to be able to type
> 
>   shorttag and not long<TAB>
> 
> which would complete to
> 
>   shorttag and not longboringtagname

I see.

> The point of my patch was to be able to filter using arbitrary
> expressions where every non-operator, i.e. `and', `or', `not', `(', and
> `)', is interpreted as a tag name.  Is there an easy way to accept this
> input without sacrificing completion?

I am not completely sure, but there might be a way to do this with some of the
low-level completion functions. For example, the documentation on completion
styles:

http://www.gnu.org/software/emacs/elisp/html_node/Completion-Styles.html#Completion-Styles

mentions in the last paragraph that there is a style which completes each word
in the input separately. This can be enabled with (partial-completion-mode),
and indeed, if I enable this mode, try to visit a file and type ~/.n-c<TAB> then it correctly completes ~/.notmuch-config. 

This seems close enough to what you want and maybe we could somehow make it
work with notmuch, too. This would be interesting to have, because then we
could complete multiple tag names with a single TAB press not only in your
expressions, but everywhere.

Right now we can only add one tag at a time with notmuch-search-add-tag and
similar functions. If we could make partial completion work, we could add
several tags with one command and still have their names completed.

Let me know if you do not plan to work on this and I'll see if I can make it
work.

-Jan

Thread: