Re: [PATCH v2] emacs: prefer notmuch-emacs-version in User-Agent: header

2015-04-05 Thread Mark Walters
On Sat, 21 Mar 2015, Tomi Ollila wrote: > Now that we have `notmuch-emacs-version' defined in notmuch emacs MUA > use that as a part of User-Agent: header to provide more accurate > version information when sending emails. > > In case some incomplete installation of notmuch emacs MUA is used and

Re: [PATCH] emacs: Added "is:" style completion to notmuch-read-query.

2015-04-05 Thread Mark Walters
Hi > From: Charles Celerier > > The notmuch-search-terms man page states that "tag:" is equivalent > to "is:". Completion for "is:" style searches is now supported > in the Emacs interface. > > Amended by David Bremner: combine lexical-let and let into > lexical-let* This version looks good to

[PATCH 2/4] cli: refactor notmuch_help_command

2015-04-05 Thread David Bremner
Create a new private entry point _help_for so that we can call help without simulating a command line invokation to set up the arguments. --- notmuch.c | 26 ++ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/notmuch.c b/notmuch.c index 31672c3..bff941f 10064

[PATCH 3/4] cli: define shared options, use for --help and --version

2015-04-05 Thread David Bremner
Unfortunately it seems trickier to support --config globally --- notmuch-client.h | 2 ++ notmuch-compact.c | 4 notmuch-count.c | 3 +++ notmuch-dump.c| 3 +++ notmuch-insert.c | 3 +++ notmuch-new.c | 3 +++ notmuch-reply.c | 3 +++ notmuch-search.c | 3 +++ notmuch-s

argument parsing refactor, add shared options

2015-04-05 Thread David Bremner
As part of ongoing hacking on Austin's revision tracking patches, I wanted to add an option to (almost) all subcommands. One thing led to another and this series emerged. By itself, the gain in functionality is probably not worthwhile (yay, we can type notmuch subcommand --version), but internally

[PATCH 1/4] cli: ignore config argument of notmuch_help_command

2015-04-05 Thread David Bremner
We call it with NULL at one point anyway, so it needs to work with NULL. Since the only place we use talloc is right before exec, there is no harm in always using NULL. --- notmuch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notmuch.c b/notmuch.c index a5b2877..3167

[PATCH 4/4] cli: add standard option processing to config and setup

2015-04-05 Thread David Bremner
In particular this fixes a recently encountered bug where the "--config" argument to "notmuch setup" is silently ignored, which the unpleasant consequence of overwriting the users config file. --- notmuch-config.c | 12 notmuch-setup.c | 12 2 files changed, 24 insertion

Re: [PATCH 4/4] cli: add standard option processing to config and setup

2015-04-05 Thread David Bremner
David Bremner writes: > In particular this fixes a recently encountered bug where the > "--config" argument to "notmuch setup" is silently ignored, which the > unpleasant consequence of overwriting the users config file. Urgh. I had a longish cover letter for this series but somehow mashing butt

Revision tracking, round 2

2015-04-05 Thread David Bremner
There is lots to tidy up here, but the series has balooned to 12 patches since since Austin posted id:1413181203-1676-1-git-send-email-acleme...@csail.mit.edu So I figure I better post it to get some feedback. These are unmodified from Austin's post [WIP2 01/12] lib: Only sync modified m

[WIP2 12/12] cli: add global option "--db-revision"

2015-04-05 Thread David Bremner
The function notmuch_exit_if_unmatched_db_revision is split from notmuch_process_shared_options because it needs an open notmuch database. --- notmuch-client.h | 5 + notmuch-compact.c | 4 notmuch-config.c | 4 notmuch-count.c | 2 ++ notmuch-dump.c| 2 ++ notmuch-inser

[WIP2 03/12] lib: API to retrieve database revision and UUID

2015-04-05 Thread David Bremner
From: 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

[WIP2 04/12] cli: add type introspection to sprinter type

2015-04-05 Thread David Bremner
This will make it easier to skip generating certain output for the text format. --- sprinter-json.c | 1 + sprinter-sexp.c | 1 + sprinter-text.c | 1 + sprinter.h | 10 ++ 4 files changed, 13 insertions(+) diff --git a/sprinter-json.c b/sprinter-json.c index 0a07790..8e5ffbe 1006

[WIP2 02/12] lib: Add per-message last modification tracking

2015-04-05 Thread David Bremner
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 modification of each message.

[WIP2 06/12] cli/show: add extra element to structured output for metadata

2015-04-05 Thread David Bremner
Initially this will contain the database uuid and last revision, and a query_type describing the remaining elements The changes to emacs/notmuch-tree.el and test/* are to (temporarily) force these to continue to use the old format. One non-trivial thing already tested is that the text and mbox fo

[WIP2 01/12] lib: Only sync modified message documents

2015-04-05 Thread David Bremner
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. We only modify messa

[WIP2 11/12] emacs: convert notmuch-tree to format-version 3

2015-04-05 Thread David Bremner
This is similarly trivial conversion to that applied to notmuch-search, and is subject to the same objections --- emacs/notmuch-tree.el | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el index ca5f9b6..bae3de0 100644 --- a/

[WIP2 05/12] cli: add two sprinter utility functions

2015-04-05 Thread David Bremner
These are called directly, rather than via a vtable. They will help add common metadata to search/show/reply --- devel/schemata | 1 + sprinter-utils.c | 41 + sprinter.h | 7 +++ 3 files changed, 49 insertions(+) create mode 100644 sprinter-u

[WIP2 08/12] cli/show: add lastmod to structured output

2015-04-05 Thread David Bremner
Here again we restrict a few tests to version 2, to keep them passing. --- devel/schemata | 2 ++ lib/message.cc | 20 lib/notmuch.h | 8 notmuch-show.c | 7 +++ test/T190-multipart.sh | 6 +++--- test/T220-reply.sh | 2 +-

[WIP2 07/12] lib: Add "lastmod:" queries for filtering by last modification

2015-04-05 Thread David Bremner
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 --git a/doc/man7/not

[PATCH] custom search prefix

2015-04-05 Thread Sebastian Fischmeister
--- emacs/notmuch.el | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index ab00454..c9cd31a 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -851,6 +851,12 @@ See `notmuch-tag' for information on the format of TAG-CHANGES."

[PATCH] custom search prefix

2015-04-05 Thread Sebastian Fischmeister
Hi, I found this handy to provide a specific prefix for searches. For example, when you always want to search only the last 2 years of emails, then you can set the variable notmuch-query-prefix to "date:2y..now ". Sebastian Sebastian Fischmeister (1): custom prefix emacs/notmuch.el | 8 +

[PATCH v2] emacs: prefer notmuch-emacs-version in User-Agent: header

2015-04-05 Thread Mark Walters
On Sat, 21 Mar 2015, Tomi Ollila wrote: > Now that we have `notmuch-emacs-version' defined in notmuch emacs MUA > use that as a part of User-Agent: header to provide more accurate > version information when sending emails. > > In case some incomplete installation of notmuch emacs MUA is used and

[PATCH] emacs: Added "is:" style completion to notmuch-read-query.

2015-04-05 Thread Mark Walters
Hi > From: Charles Celerier > > The notmuch-search-terms man page states that "tag:" is equivalent > to "is:". Completion for "is:" style searches is now supported > in the Emacs interface. > > Amended by David Bremner: combine lexical-let and let into > lexical-let* This version looks good to

[PATCH] custom search prefix

2015-04-05 Thread Sebastian Fischmeister
--- emacs/notmuch.el | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index ab00454..c9cd31a 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -851,6 +851,12 @@ See `notmuch-tag' for information on the format of TAG-CHANGES."

[PATCH] custom search prefix

2015-04-05 Thread Sebastian Fischmeister
Hi, I found this handy to provide a specific prefix for searches. For example, when you always want to search only the last 2 years of emails, then you can set the variable notmuch-query-prefix to "date:2y..now ". Sebastian Sebastian Fischmeister (1): custom prefix emacs/notmuch.el | 8 +