]> granicus.if.org Git - neomutt/commit
Searching with a window over notmuch vfolders
authorBernard Pratz <guyzmo+github+pub@m0g.net>
Sun, 15 Jan 2017 19:53:09 +0000 (19:53 +0000)
committerRichard Russon <rich@flatcap.org>
Wed, 18 Jan 2017 16:41:33 +0000 (16:41 +0000)
commitcf8ed69d54112af02f086f83ef8361bbaef423fc
tree6653bff2965b078888a64412e8c289a121433306
parent485e47f2b849d0eff9b101f28ec15d63bcda501b
Searching with a window over notmuch vfolders

following up on #278

Instead of adding a new command for searches that will result in
windowed searches, this commit patches a lower function of the search
mechanism, the `get_query_string()` function.

There, any search is buffered in the `nm_query_window_current_search`
global variable. And a newly introduced non-exposed function
`window_query_from_query` is taking a `data->db_query` and adds a
`date:` field implementing the window.

That function won't add a `date:` field if there's no duration set or if
there's already a date field in the query (to avoid risks of an empty
intersection).

To disable the feature, just set `nm_query_window_duration` to `0`.

Finally, only two public functions are exposed:

- `vfolder-window-forward`
- `vfolder-window-backward`

to slide the window over the search.

The improvements over #278 implementation is that now it's working with
any search done with notmuch, whether it's a `virtual-mailbox` or using
the `vfolder-from-query` command.

Have been removed:

- `windowed-vfolder-from-query`

Have been renamed:

- `windowed-vfolder-forward` -> `vfolder-window-forward`
- `windowed-vfolder-backward` -> `vfolder-window-backward`
OPS.NOTMUCH
curs_main.c
doc/manual.xml.head
doc/muttrc.notmuch
doc/vimrc.notmuch
functions.h
globals.h
init.h
mutt_notmuch.c
mutt_notmuch.h