Re: [PATCH] WIP: regexp matching in 'subject' and 'from'

2016-06-11 Thread Gaute Hope
Tomi Ollila writes on juni 11, 2016 19:09: On Sat, Jun 11 2016, Gaute Hope wrote: Maybe we could check if the search string contains a regexp and decide whether to pre-process it on the background of that? I think that would make the interface more user-friendly. You'd just always use search wh

Re: [PATCH] WIP: regexp matching in 'subject' and 'from'

2016-06-11 Thread Tomi Ollila
On Sat, Jun 11 2016, Gaute Hope wrote: > David Bremner writes on juni 10, 2016 13:09: >> Gaute Hope writes: >> >>> >>> Cool! >>> >>> Would it break a lot of things if you just replace the original prefix? >> >> It would change the matching behaviour. I guess there are people that >> like the c

Re: [PATCH] WIP: regexp matching in 'subject' and 'from'

2016-06-11 Thread David Bremner
Gaute Hope writes: > > Maybe we could check if the search string contains a regexp and decide > whether to pre-process it on the background of that? I think that would > make the interface more user-friendly. You'd just always use search > whether you decide that you need to put in some regexp or

Re: [PATCH] WIP: regexp matching in 'subject' and 'from'

2016-06-11 Thread Gaute Hope
David Bremner writes on juni 10, 2016 13:09: Gaute Hope writes: Cool! Would it break a lot of things if you just replace the original prefix? It would change the matching behaviour. I guess there are people that like the current "sloppy" matching of from: and subject:. In my not-very-scie

[PATCH] WIP: regexp matching in 'subject' and 'from'

2016-06-10 Thread David Bremner
the idea is that you can run % notmuch search re:subject: % notmuch search re:from:' or % notmuch search subject:"your usual phrase search" % notmuch search from:"usual phrase search" This should also work with bindings, since it extends the query parser. This is trivial to extend for other va

Re: [PATCH] WIP: regexp matching in 'subject' and 'from'

2016-06-10 Thread David Bremner
Tomi Ollila writes: > On Fri, Jun 10 2016, David Bremner wrote: > >> David Bremner writes: >> and of course everywhere it says #ifdef HAVE_XAPIAN_FIELD_PROCESSOR, is >> should say #if. > > ... is there a static code analyzer which notices such a mistakes... ? It seems tough for a static analy

Re: [PATCH] WIP: regexp matching in 'subject' and 'from'

2016-06-10 Thread Tomi Ollila
On Fri, Jun 10 2016, David Bremner wrote: > David Bremner writes: > >> +#ifdef HAVE_XAPIAN_FIELD_PROCESSOR >> +delete notmuch->from_re_field_processor; >> +notmuch->from_re_field_processor = NULL; >> +delete notmuch->subject_re_field_processor; >> +notmuch->subject_re_field_proce

Re: [PATCH] WIP: regexp matching in 'subject' and 'from'

2016-06-10 Thread David Bremner
Gaute Hope writes: > > Cool! > > Would it break a lot of things if you just replace the original prefix? It would change the matching behaviour. I guess there are people that like the current "sloppy" matching of from: and subject:. In my not-very-scientific tests, it is a factor of 5 to 10 tim

Re: [PATCH] WIP: regexp matching in 'subject' and 'from'

2016-06-10 Thread Gaute Hope
David Bremner writes on juni 10, 2016 4:28: the idea is that you can run % notmuch search subject_re: % notmuch search from_re:' or % notmuch search subject:"your usual phrase search" % notmuch search from:"usual phrase search" This should also work with bindings, since it extends the query p

Re: [PATCH] WIP: regexp matching in 'subject' and 'from'

2016-06-09 Thread David Bremner
David Bremner writes: > +#ifdef HAVE_XAPIAN_FIELD_PROCESSOR > +delete notmuch->from_re_field_processor; > +notmuch->from_re_field_processor = NULL; > +delete notmuch->subject_re_field_processor; > +notmuch->subject_re_field_processor = NULL; > +#endif and of course everywhere it

[PATCH] WIP: regexp matching in 'subject' and 'from'

2016-06-09 Thread David Bremner
the idea is that you can run % notmuch search subject_re: % notmuch search from_re:' or % notmuch search subject:"your usual phrase search" % notmuch search from:"usual phrase search" This should also work with bindings, since it extends the query parser. This is trivial to extend for other va