[WIP PATCH 0/4] Add message revision tracking

2014-10-13 Thread Austin Clements
This implements message revision tracking. This is definitely a work-in-progress, but I wanted to post it since I don't know when I'll be able to work on it next (and maybe someone else can run with it in the mean time). I think this makes all of the necessary library-side changes, but doesn't

[WIP PATCH 3/4] lib: API to retrieve database revision and UUID

2014-10-13 Thread Austin Clements
This exposes the committed database revision to library users along with a UUID that can be used to detect when revision numbers are no longer comparable (e.g., because the database has been replaced). --- lib/database-private.h | 1 + lib/database.cc| 11 +++ lib/notmuch.h

[WIP PATCH 4/4] lib: Add lastmod: queries for filtering by last modification

2014-10-13 Thread Austin Clements
From: Austin Clements amdra...@mit.edu XXX Includes reference to notmuch search --db-revision, which doesn't exist. --- doc/man7/notmuch-search-terms.rst | 8 lib/database-private.h| 1 + lib/database.cc | 4 3 files changed, 13 insertions(+) diff

[WIP PATCH 2/4] lib: Add per-message last modification tracking

2014-10-13 Thread Austin Clements
From: Austin Clements amdra...@mit.edu This adds a new document value that stores the revision of the last modification to message metadata, where the revision number increases monotonically with each database commit. An alternative would be to store the wall-clock time of the last modification

[WIP PATCH 1/4] lib: Only sync modified message documents

2014-10-13 Thread Austin Clements
From: Austin Clements amdra...@mit.edu Previously, we updated the database copy of a message on every call to _notmuch_message_sync, even if nothing had changed. In particular, this always happens on a thaw, so a freeze/thaw pair with no modifications between still caused a database update. We

Re: VIM: search_refresh limits message count to 2 * window.height

2014-10-13 Thread Franz Fellner
The issue is that VIM::Buffer.render yield's itself BEFORE it clears itself. Two quick solutions: 1) Simply manually fixup the mess in StagedRender::initialize after @b.render {do_next } by adding @last_render = @b.count 2) First clear the VIM:Buffer before yielding. This exposes one issue in

Re: [PATCH v3 3/4] cli: Extend the search command for --output={sender, recipients}

2014-10-13 Thread Tomi Ollila
On Mon, Oct 13 2014, Michal Sojka sojk...@fel.cvut.cz wrote: The new outputs allow printing senders, recipients or both of matching messages. The --output option is converted from keyword argument to flags argument, which means that the user can use --output=sender and --output=recipients

[PATCH v3 2/4] cli: Add support for parsing multiple keyword arguments

2014-10-13 Thread Michal Sojka
From: Jani Nikula This allows having multiple --foo=bar --foo=baz options on the command line, with the corresponding values OR'd together. [Test added by Michal Sojka] --- command-line-arguments.c | 6 +- command-line-arguments.h | 1 +

[PATCH v3 0/4] notmuch search --output=sender/recipients

2014-10-13 Thread Michal Sojka
Hi, this is a third version of my adaptation of Jani's patch series adding --output=sender/recipients and related arguments to notmuch search. The 1st patch is the same as in v2 (Marked as OK in id:m24mvht4c4.fsf at guru.guru-group.fi). The 2nd patch is not changed as well, but in v2 it was

[PATCH v3 1/4] cli: Refactor option passing in the search command

2014-10-13 Thread Michal Sojka
Many functions that implement the search command need to access command line options. Instead of passing each option in a separate variable, put them in a structure and pass only this structure. This will become handy in the following patches. --- notmuch-search.c | 122

[PATCH v3 4/4] cli: Add an option to filter our duplicate addresses

2014-10-13 Thread Michal Sojka
This adds a --filter-by option to "notmuch search". It can be used to filter out duplicate addresses in --output=sender/receivers. The code here is an extended version of a patch from Jani Nikula. --- completion/notmuch-completion.bash | 6 ++- completion/notmuch-completion.zsh | 3 +-

[PATCH v3 3/4] cli: Extend the search command for --output={sender, recipients}

2014-10-13 Thread Michal Sojka
The new outputs allow printing senders, recipients or both of matching messages. The --output option is converted from "keyword" argument to "flags" argument, which means that the user can use --output=sender and --output=recipients simultaneously, to print both. Other combinations produce an

[WIP PATCH 0/4] Add message revision tracking

2014-10-13 Thread Austin Clements
This implements message revision tracking. This is definitely a work-in-progress, but I wanted to post it since I don't know when I'll be able to work on it next (and maybe someone else can run with it in the mean time). I think this makes all of the necessary library-side changes, but doesn't

[WIP PATCH 4/4] lib: Add "lastmod:" queries for filtering by last modification

2014-10-13 Thread Austin Clements
From: Austin Clements XXX Includes reference to notmuch search --db-revision, which doesn't exist. --- doc/man7/notmuch-search-terms.rst | 8 lib/database-private.h| 1 + lib/database.cc | 4 3 files changed, 13 insertions(+) diff

[WIP PATCH 3/4] lib: API to retrieve database revision and UUID

2014-10-13 Thread Austin Clements
This exposes the committed database revision to library users along with a UUID that can be used to detect when revision numbers are no longer comparable (e.g., because the database has been replaced). --- lib/database-private.h | 1 + lib/database.cc| 11 +++ lib/notmuch.h

[WIP PATCH 1/4] lib: Only sync modified message documents

2014-10-13 Thread Austin Clements
From: Austin Clements Previously, we updated the database copy of a message on every call to _notmuch_message_sync, even if nothing had changed. In particular, this always happens on a thaw, so a freeze/thaw pair with no modifications between still caused a database update.

[WIP PATCH 2/4] lib: Add per-message last modification tracking

2014-10-13 Thread Austin Clements
From: Austin Clements This adds a new document value that stores the revision of the last modification to message metadata, where the revision number increases monotonically with each database commit. An alternative would be to store the wall-clock time of the last

VIM: search_refresh limits message count to 2 * window.height

2014-10-13 Thread Franz Fellner
The issue is that VIM::Buffer.render yield's itself BEFORE it clears itself. Two quick solutions: 1) Simply manually fixup the mess in StagedRender::initialize after @b.render {do_next } by adding @last_render = @b.count 2) First clear the VIM:Buffer before yielding. This exposes one issue in

[PATCH v3 3/4] cli: Extend the search command for --output={sender, recipients}

2014-10-13 Thread Tomi Ollila
On Mon, Oct 13 2014, Michal Sojka wrote: > The new outputs allow printing senders, recipients or both of matching > messages. The --output option is converted from "keyword" argument to > "flags" argument, which means that the user can use --output=sender and > --output=recipients