[PATCH v2 6/8] pick: Use list form of tag-changes in test

2013-10-22 Thread Austin Clements
Currently we support both string and list forms of tag-changes for historical reasons. This is about to change, so fix pick's tests that use the legacy string form of tag-changes. --- contrib/notmuch-pick/test/emacs-pick | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH v2 4/8] emacs: Use interactive specifications for tag changes in search

2013-10-22 Thread Austin Clements
This is similar to the previous commit, but applies to search. Search is somewhat more complicated because its tagging operations can also apply to a region. Hence, this lifts interactive prompting into a helper function. This also takes advantage of the new ability to provide a prompt to

[PATCH v2 3/8] emacs: Use interactive specifications for tag changes in show

2013-10-22 Thread Austin Clements
This modifies all tagging operations in show to call `notmuch-read-tag-changes' in their interactive specification to input tag changes, rather than depending on lower-level functions to prompt for tag changes regardless of their calling context. Besides being more Elispy and providing a more

[PATCH v2 2/8] emacs: Take prompt and current tags in `notmuch-read-tag-changes'

2013-10-22 Thread Austin Clements
This modifies the interface of `notmuch-read-tag-changes' to take an optional prompt string as well as a list of existing tags instead of a query. This list of tags is used to populate the tag removal completions and lets the caller compute these in a more efficient/consistent manner than

[PATCH v2 1/8] emacs: Fix misuse of `notmuch-tag'

2013-10-22 Thread Austin Clements
The calling convention for `notmuch-tag' changed in commit 97aa3c06 to take a list of tag changes instead of a argument, but the call from `notmuch-search-tag-all' still passed a argument. This happened to work for interactive calls because tag-changes would be nil, so the `apply' call would

[PATCH v2 0/8] Improve tag change completion

2013-10-22 Thread Austin Clements
This is v2 of id:1382471457-26056-1-git-send-email-amdragon at mit.edu. It improves some documentation strings, fixes one bug, and elimintes some redundant code. The diff from v1 is below. diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index ef77839..f66d669 100644 ---

[PATCH 0/8] Improve tag change completion

2013-10-22 Thread Austin Clements
uch-read-tag-changes'. Since it's redundant, I've removed it. > But that was all I found. All tests pass and everything I try behaves > exactly as expected. > > Best wishes > > Mark > > > On Tue, 22 Oct 2013, Austin Clements wrote: > > This series improves tag change co

[PATCH 8/8] emacs: Remove interactive behavior of `notmuch-tag'

2013-10-22 Thread Austin Clements
We no longer use this, since we've lifted all interactive behavior to the appropriate interactive entry points. Because of this, `notmuch-tag' also no longer needs to return the tag changes list, since the caller always passes it in. --- emacs/notmuch-tag.el | 19 --- 1 file

[PATCH 7/8] pick: Use interactive specifications for tag changes

2013-10-22 Thread Austin Clements
--- contrib/notmuch-pick/notmuch-pick.el | 36 +--- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index 8f504ed..13682ea 100644 --- a/contrib/notmuch-pick/notmuch-pick.el

[PATCH 6/8] pick: Use list form of tag-changes in test

2013-10-22 Thread Austin Clements
Currently we support both string and list forms of tag-changes for historical reasons. This is about to change, so fix pick's tests that use the legacy string form of tag-changes. --- contrib/notmuch-pick/test/emacs-pick | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH 5/8] pick: Fix incorrect use of `notmuch-pick-tag'

2013-10-22 Thread Austin Clements
`notmuch-pick-tag' takes a list of tag changes, but `notmuch-pick-archive-message' passes it a argument. This happens to work if `notmuch-archive-tags' contains a single tag (which it usually does), but will break if it does not. --- contrib/notmuch-pick/notmuch-pick.el | 3 +-- 1 file changed,

[PATCH 4/8] emacs: Use interactive specifications for tag changes in search

2013-10-22 Thread Austin Clements
This is similar to the previous commit, but applies to search. Search is somewhat more complicated because its tagging operations can also apply to a region. Hence, this lifts interactive prompting into a helper function. This also takes advantage of the new ability to provide a prompt to

[PATCH 3/8] emacs: Use interactive specifications for tag changes in show

2013-10-22 Thread Austin Clements
This modifies all tagging operations in show to call `notmuch-read-tag-changes' in their interactive specification to input tag changes, rather than depending on lower-level functions to prompt for tag changes regardless of their calling context. Besides being more Elispy and providing a more

[PATCH 2/8] emacs: Take prompt and current tags in `notmuch-read-tag-changes'

2013-10-22 Thread Austin Clements
This modifies the interface of `notmuch-read-tag-changes' to take an optional prompt string as well as a list of existing tags instead of a query. This list of tags is used to populate the tag removal completions and lets the caller compute these in a more efficient/consistent manner than

[PATCH 1/8] emacs: Fix misuse of `notmuch-tag'

2013-10-22 Thread Austin Clements
The calling convention for `notmuch-tag' changed in commit 97aa3c06 to take a list of tag changes instead of a argument, but the call from `notmuch-search-tag-all' still passed a argument. This happened to work for interactive calls because tag-changes would be nil, so the `apply' call would

[PATCH 0/8] Improve tag change completion

2013-10-22 Thread Austin Clements
This series improves tag change completion in various ways for commands like +, -, and *. >From a user perspective, this provides command-specific prompts like "Tag message" and "Tag all" instead of the generic "Tag" prompt, and bases tag removal completions on the tags that are in the buffer,

[PATCH 2/8] emacs: Take prompt and current tags in `notmuch-read-tag-changes'

2013-10-22 Thread Austin Clements
This modifies the interface of `notmuch-read-tag-changes' to take an optional prompt string as well as a list of existing tags instead of a query. This list of tags is used to populate the tag removal completions and lets the caller compute these in a more efficient/consistent manner than

[PATCH 6/8] pick: Use list form of tag-changes in test

2013-10-22 Thread Austin Clements
Currently we support both string and list forms of tag-changes for historical reasons. This is about to change, so fix pick's tests that use the legacy string form of tag-changes. --- contrib/notmuch-pick/test/emacs-pick | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH 3/8] emacs: Use interactive specifications for tag changes in show

2013-10-22 Thread Austin Clements
This modifies all tagging operations in show to call `notmuch-read-tag-changes' in their interactive specification to input tag changes, rather than depending on lower-level functions to prompt for tag changes regardless of their calling context. Besides being more Elispy and providing a more

[PATCH 1/8] emacs: Fix misuse of `notmuch-tag'

2013-10-22 Thread Austin Clements
The calling convention for `notmuch-tag' changed in commit 97aa3c06 to take a list of tag changes instead of a rest argument, but the call from `notmuch-search-tag-all' still passed a rest argument. This happened to work for interactive calls because tag-changes would be nil, so the `apply' call

[PATCH 0/8] Improve tag change completion

2013-10-22 Thread Austin Clements
This series improves tag change completion in various ways for commands like +, -, and *. From a user perspective, this provides command-specific prompts like Tag message and Tag all instead of the generic Tag prompt, and bases tag removal completions on the tags that are in the buffer, rather

[PATCH 5/8] pick: Fix incorrect use of `notmuch-pick-tag'

2013-10-22 Thread Austin Clements
`notmuch-pick-tag' takes a list of tag changes, but `notmuch-pick-archive-message' passes it a rest argument. This happens to work if `notmuch-archive-tags' contains a single tag (which it usually does), but will break if it does not. --- contrib/notmuch-pick/notmuch-pick.el | 3 +-- 1 file

[PATCH 4/8] emacs: Use interactive specifications for tag changes in search

2013-10-22 Thread Austin Clements
This is similar to the previous commit, but applies to search. Search is somewhat more complicated because its tagging operations can also apply to a region. Hence, this lifts interactive prompting into a helper function. This also takes advantage of the new ability to provide a prompt to

[PATCH 8/8] emacs: Remove interactive behavior of `notmuch-tag'

2013-10-22 Thread Austin Clements
We no longer use this, since we've lifted all interactive behavior to the appropriate interactive entry points. Because of this, `notmuch-tag' also no longer needs to return the tag changes list, since the caller always passes it in. --- emacs/notmuch-tag.el | 19 --- 1 file

Re: [PATCH 0/8] Improve tag change completion

2013-10-22 Thread Austin Clements
tests pass and everything I try behaves exactly as expected. Best wishes Mark On Tue, 22 Oct 2013, Austin Clements amdra...@mit.edu wrote: This series improves tag change completion in various ways for commands like +, -, and *. From a user perspective, this provides command

[PATCH v2 8/8] emacs: Remove interactive behavior of `notmuch-tag'

2013-10-22 Thread Austin Clements
We no longer use this, since we've lifted all interactive behavior to the appropriate interactive entry points. Because of this, `notmuch-tag' also no longer needs to return the tag changes list, since the caller always passes it in. --- emacs/notmuch-tag.el | 19 --- 1 file

[PATCH v2 6/8] pick: Use list form of tag-changes in test

2013-10-22 Thread Austin Clements
Currently we support both string and list forms of tag-changes for historical reasons. This is about to change, so fix pick's tests that use the legacy string form of tag-changes. --- contrib/notmuch-pick/test/emacs-pick | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH v2 0/8] Improve tag change completion

2013-10-22 Thread Austin Clements
This is v2 of id:1382471457-26056-1-git-send-email-amdra...@mit.edu. It improves some documentation strings, fixes one bug, and elimintes some redundant code. The diff from v1 is below. diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index ef77839..f66d669 100644 ---

[PATCH v2 4/8] emacs: Use interactive specifications for tag changes in search

2013-10-22 Thread Austin Clements
This is similar to the previous commit, but applies to search. Search is somewhat more complicated because its tagging operations can also apply to a region. Hence, this lifts interactive prompting into a helper function. This also takes advantage of the new ability to provide a prompt to

[PATCH v2 5/8] pick: Fix incorrect use of `notmuch-pick-tag'

2013-10-22 Thread Austin Clements
`notmuch-pick-tag' takes a list of tag changes, but `notmuch-pick-archive-message' passes it a rest argument. This happens to work if `notmuch-archive-tags' contains a single tag (which it usually does), but will break if it does not. --- contrib/notmuch-pick/notmuch-pick.el | 3 +-- 1 file

[PATCH v2 7/8] pick: Use interactive specifications for tag changes

2013-10-22 Thread Austin Clements
--- contrib/notmuch-pick/notmuch-pick.el | 36 +--- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index 8f504ed..13682ea 100644 --- a/contrib/notmuch-pick/notmuch-pick.el

[PATCH v2 3/8] emacs: Use interactive specifications for tag changes in show

2013-10-22 Thread Austin Clements
This modifies all tagging operations in show to call `notmuch-read-tag-changes' in their interactive specification to input tag changes, rather than depending on lower-level functions to prompt for tag changes regardless of their calling context. Besides being more Elispy and providing a more

[PATCH v2 1/8] emacs: Fix misuse of `notmuch-tag'

2013-10-22 Thread Austin Clements
The calling convention for `notmuch-tag' changed in commit 97aa3c06 to take a list of tag changes instead of a rest argument, but the call from `notmuch-search-tag-all' still passed a rest argument. This happened to work for interactive calls because tag-changes would be nil, so the `apply' call

[PATCH v2 2/8] emacs: Take prompt and current tags in `notmuch-read-tag-changes'

2013-10-22 Thread Austin Clements
This modifies the interface of `notmuch-read-tag-changes' to take an optional prompt string as well as a list of existing tags instead of a query. This list of tags is used to populate the tag removal completions and lets the caller compute these in a more efficient/consistent manner than

[PATCH] perf: Clean corpus and caches in distclean, not clean

2013-10-21 Thread Austin Clements
Previously, we cleaned the downloaded performance corpus and the cached indexes on 'make clean'. This seems heavy-handed, since these take a long time to download, unpack, and index. They also aren't make targets to begin with. Move cleaning these to 'make distclean'. This isn't exactly the

[PATCH] perf: Clean corpus and caches in distclean, not clean

2013-10-21 Thread Austin Clements
Previously, we cleaned the downloaded performance corpus and the cached indexes on 'make clean'. This seems heavy-handed, since these take a long time to download, unpack, and index. They also aren't make targets to begin with. Move cleaning these to 'make distclean'. This isn't exactly the

[PATCH v2] emacs: show: use interactive instead of current-prefix-arg

2013-10-13 Thread Austin Clements
LGTM. Quoth Mark Walters on Oct 13 at 8:39 am: > Currently notmuch-show looks at the prefix-arg directly via > current-prefix-arg. This changes it to use the interactive > specification. > > One test (for elide-toggle functionality) set the prefix arg > directly. Update this test to set the new

[PATCH 1/2] emacs: show: use interactive instead of current-prefix-arg

2013-10-13 Thread Austin Clements
Code looks good. Two minor comments below. Quoth Mark Walters on Oct 09 at 9:01 pm: > Currently notmuch-show looks at the prefix-arg directly via > current-prefix-arg. This changes it to use the interactive > specification. > --- > emacs/notmuch-show.el | 12 +++- > emacs/notmuch.el

Re: [PATCH v2] emacs: show: use interactive instead of current-prefix-arg

2013-10-13 Thread Austin Clements
LGTM. Quoth Mark Walters on Oct 13 at 8:39 am: Currently notmuch-show looks at the prefix-arg directly via current-prefix-arg. This changes it to use the interactive specification. One test (for elide-toggle functionality) set the prefix arg directly. Update this test to set the new

Re: [PATCH 1/2] emacs: show: use interactive instead of current-prefix-arg

2013-10-12 Thread Austin Clements
Code looks good. Two minor comments below. Quoth Mark Walters on Oct 09 at 9:01 pm: Currently notmuch-show looks at the prefix-arg directly via current-prefix-arg. This changes it to use the interactive specification. --- emacs/notmuch-show.el | 12 +++- emacs/notmuch.el |

[PATCH WIP] emacs: Sanitize authors and subjects in search and show

2013-10-11 Thread Austin Clements
Authors and subjects can contain embedded, encoded control characters like "\n" and "\t" that mess up display. Transform control characters into spaces everywhere we display them in search and show. --- This could obviously use some tests, but I thought I'd get it out there to see what people

[PATCH WIP] emacs: Sanitize authors and subjects in search and show

2013-10-11 Thread Austin Clements
Authors and subjects can contain embedded, encoded control characters like \n and \t that mess up display. Transform control characters into spaces everywhere we display them in search and show. --- This could obviously use some tests, but I thought I'd get it out there to see what people

[PATCH 00/11] Fix search tagging races

2013-10-09 Thread Austin Clements
ttle discussion of this in my earlier attempt at > fixing this: eg id:87mwy4smad.fsf at qmul.ac.uk > > Best wishes > > Mark > > On Mon, 07 Oct 2013, Austin Clements wrote: > > I was hacking on undo support for notmuch-emacs and sort of > > accidentally wrote this instead.

[PATCH 00/11] Fix search tagging races

2013-10-09 Thread Austin Clements
Quoth Mark Walters on Oct 09 at 8:43 am: > > On Mon, 07 Oct 2013, Austin Clements wrote: > > I was hacking on undo support for notmuch-emacs and sort of > > accidentally wrote this instead. This series fixes a set of > > well-known races where tagging from search-m

[PATCH 08/11] search: Add stable queries to thread search results

2013-10-09 Thread Austin Clements
Quoth Jani Nikula on Oct 09 at 9:41 am: > On Tue, 08 Oct 2013, Austin Clements wrote: > > These queries will match exactly the set of messages currently in the > > thread, even if more messages later arrive. Two queries are provided: > > one for matched messages and one f

[PATCH 07/11] emacs: Use notmuch tag --batch for large tag queries

2013-10-09 Thread Austin Clements
Quoth Mark Walters on Oct 09 at 8:38 am: > > On Wed, 09 Oct 2013, Jani Nikula wrote: > > On Tue, 08 Oct 2013, Austin Clements wrote: > >> (Unfortunately, it's difficult to first demonstrate this problem with > >> a known-broken test because modern Linux kernels ha

[PATCH 07/11] emacs: Use notmuch tag --batch for large tag queries

2013-10-09 Thread Austin Clements
Quoth Mark Walters on Oct 08 at 8:27 am: > On Mon, 07 Oct 2013, Austin Clements wrote: > > (Unfortunately, it's difficult to first demonstrate this problem with > > a known-broken test because modern Linux kernels have argument length > > limits in the megabytes, which ma

[PATCH 02/11] cli: Separate current and deprecated format version

2013-10-09 Thread Austin Clements
Quoth Mark Walters on Oct 08 at 7:48 am: > On Mon, 07 Oct 2013, Austin Clements wrote: > > Previously, the CLI would print a deprecation warning if a client > > requested any format version other than the current one. However, if > > we add fields that are backwards-compati

Re: [PATCH 02/11] cli: Separate current and deprecated format version

2013-10-09 Thread Austin Clements
Quoth Mark Walters on Oct 08 at 7:48 am: On Mon, 07 Oct 2013, Austin Clements amdra...@mit.edu wrote: Previously, the CLI would print a deprecation warning if a client requested any format version other than the current one. However, if we add fields that are backwards-compatible

Re: [PATCH 07/11] emacs: Use notmuch tag --batch for large tag queries

2013-10-09 Thread Austin Clements
Quoth Mark Walters on Oct 08 at 8:27 am: On Mon, 07 Oct 2013, Austin Clements amdra...@mit.edu wrote: (Unfortunately, it's difficult to first demonstrate this problem with a known-broken test because modern Linux kernels have argument length limits in the megabytes, which makes Emacs

Re: [PATCH 07/11] emacs: Use notmuch tag --batch for large tag queries

2013-10-09 Thread Austin Clements
Quoth Mark Walters on Oct 09 at 8:38 am: On Wed, 09 Oct 2013, Jani Nikula j...@nikula.org wrote: On Tue, 08 Oct 2013, Austin Clements amdra...@mit.edu wrote: (Unfortunately, it's difficult to first demonstrate this problem with a known-broken test because modern Linux kernels have

Re: [PATCH 08/11] search: Add stable queries to thread search results

2013-10-09 Thread Austin Clements
Quoth Jani Nikula on Oct 09 at 9:41 am: On Tue, 08 Oct 2013, Austin Clements amdra...@mit.edu wrote: These queries will match exactly the set of messages currently in the thread, even if more messages later arrive. Two queries are provided: one for matched messages and one for unmatched

Re: [PATCH 00/11] Fix search tagging races

2013-10-09 Thread Austin Clements
Quoth Mark Walters on Oct 09 at 8:43 am: On Mon, 07 Oct 2013, Austin Clements amdra...@mit.edu wrote: I was hacking on undo support for notmuch-emacs and sort of accidentally wrote this instead. This series fixes a set of well-known races where tagging from search-mode unexpectedly

Re: [PATCH 00/11] Fix search tagging races

2013-10-09 Thread Austin Clements
id:87mwy4smad@qmul.ac.uk Best wishes Mark On Mon, 07 Oct 2013, Austin Clements amdra...@mit.edu wrote: I was hacking on undo support for notmuch-emacs and sort of accidentally wrote this instead. This series fixes a set of well-known races where tagging from search-mode

[PATCH 4/6] emacs: Support overriding help and describing prefix action

2013-10-07 Thread Austin Clements
Quoth Mark Walters on Oct 06 at 9:14 pm: > > This whole series looks good to me. If you are rolling another version > for any reason I have one trivial comment > > On Sun, 06 Oct 2013, Austin Clements wrote: > > Traditionally, function documentation strings a

[PATCH 7/6] emacs: Improved `notmuch-describe-keymap' documentation

2013-10-07 Thread Austin Clements
--- emacs/notmuch.el | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index e559472..c47c6b5 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -141,10 +141,15 @@ This is basically just `format-kbd-macro' but we also convert

[PATCH 11/11] emacs: Fix search tagging races

2013-10-07 Thread Austin Clements
This fixes races in thread-local and global tagging in notmuch-search (e.g., "+", "-", "a", "*", etc.). Previously, these would modify tags of new messages that arrived after the search. Now they only operate on the messages that were in the threads when the search was performed. This prevents

[PATCH 10/11] emacs: Add known-broken tests for search tagging races

2013-10-07 Thread Austin Clements
These tests check that both thread-local and global search tagging operations are race-free. They are currently known-broken because they aren't race-free. --- test/emacs | 26 ++ 1 file changed, 26 insertions(+) diff --git a/test/emacs b/test/emacs index

[PATCH 09/11] Add TODO about more efficient stable thread queries

2013-10-07 Thread Austin Clements
--- devel/TODO | 6 ++ 1 file changed, 6 insertions(+) diff --git a/devel/TODO b/devel/TODO index 844555e..f212483 100644 --- a/devel/TODO +++ b/devel/TODO @@ -114,6 +114,12 @@ are multiple ideas that might make sense. Some consensus needs to be reached on this issue, and then both reply

[PATCH 08/11] search: Add stable queries to thread search results

2013-10-07 Thread Austin Clements
These queries will match exactly the set of messages currently in the thread, even if more messages later arrive. Two queries are provided: one for matched messages and one for unmatched messages. This can be used to fix race conditions with tagging threads from search results. While tagging

[PATCH 07/11] emacs: Use notmuch tag --batch for large tag queries

2013-10-07 Thread Austin Clements
(Unfortunately, it's difficult to first demonstrate this problem with a known-broken test because modern Linux kernels have argument length limits in the megabytes, which makes Emacs really slow!) --- emacs/notmuch-lib.el | 8 emacs/notmuch-tag.el | 12 ++-- test/emacs

[PATCH 06/11] emacs: Support passing input via `notmuch-call-notmuch-*'

2013-10-07 Thread Austin Clements
This adds support for passing a string to write to notmuch's stdin to `notmuch-call-notmuch-process' and `notmuch-call-notmuch-sexp'. Since this makes both interfaces a little more complicated, it also unifies their documentation better. --- emacs/notmuch-lib.el | 39

[PATCH 05/11] emacs: Move `notmuch-call-notmuch-process' to notmuch-lib

2013-10-07 Thread Austin Clements
Previously, this was in notmuch.el, but all of the other notmuch call wrappers were in notmuch-lib.el. Move `notmuch-call-notmuch-process' to live with its friends. This happens to fix a missing dependency from notmuch-tag.el, which required notmuch-lib, but not notmuch. ---

[PATCH 04/11] test: Fix missing erase-buffer in emacs test

2013-10-07 Thread Austin Clements
The first subprocess error exit code test assumed the *Notmuch errors* buffer would be empty. Rather than assuming, make it so. --- test/emacs | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/emacs b/test/emacs index 5bc3efc..05295af 100755 --- a/test/emacs +++

[PATCH 03/11] lib: Document extent of some return values

2013-10-07 Thread Austin Clements
This documents the extent of the notmuch_messages_t* pointers returned by notmuch_thread_get_toplevel_messages and notmuch_thread_get_messages. --- lib/notmuch.h | 4 1 file changed, 4 insertions(+) diff --git a/lib/notmuch.h b/lib/notmuch.h index 998a4ae..217bf46 100644 --- a/lib/notmuch.h

[PATCH 02/11] cli: Separate current and deprecated format version

2013-10-07 Thread Austin Clements
Previously, the CLI would print a deprecation warning if a client requested any format version other than the current one. However, if we add fields that are backwards-compatible, but want clients to be able to depend on, we need to bump the version, but that doesn't make the older version

[PATCH 01/11] schemata: Disambiguate non-terminal names

2013-10-07 Thread Austin Clements
Previously, the show schema and the search schema used different "thread" non-terminals. While these schemata don't interact, this is still confusing, so rename search's "thread" to "thread_summary". To further limit confusion, prefix all top-level search non-terminals now begin with "search_".

[PATCH 00/11] Fix search tagging races

2013-10-07 Thread Austin Clements
I was hacking on undo support for notmuch-emacs and sort of accidentally wrote this instead. This series fixes a set of well-known races where tagging from search-mode unexpectedly affects messages that arrived after the search was performed (and hence the user doesn't know they're tagging them).

[PATCH 00/11] Fix search tagging races

2013-10-07 Thread Austin Clements
I was hacking on undo support for notmuch-emacs and sort of accidentally wrote this instead. This series fixes a set of well-known races where tagging from search-mode unexpectedly affects messages that arrived after the search was performed (and hence the user doesn't know they're tagging them).

[PATCH 05/11] emacs: Move `notmuch-call-notmuch-process' to notmuch-lib

2013-10-07 Thread Austin Clements
Previously, this was in notmuch.el, but all of the other notmuch call wrappers were in notmuch-lib.el. Move `notmuch-call-notmuch-process' to live with its friends. This happens to fix a missing dependency from notmuch-tag.el, which required notmuch-lib, but not notmuch. ---

[PATCH 07/11] emacs: Use notmuch tag --batch for large tag queries

2013-10-07 Thread Austin Clements
(Unfortunately, it's difficult to first demonstrate this problem with a known-broken test because modern Linux kernels have argument length limits in the megabytes, which makes Emacs really slow!) --- emacs/notmuch-lib.el | 8 emacs/notmuch-tag.el | 12 ++-- test/emacs

[PATCH 09/11] Add TODO about more efficient stable thread queries

2013-10-07 Thread Austin Clements
--- devel/TODO | 6 ++ 1 file changed, 6 insertions(+) diff --git a/devel/TODO b/devel/TODO index 844555e..f212483 100644 --- a/devel/TODO +++ b/devel/TODO @@ -114,6 +114,12 @@ are multiple ideas that might make sense. Some consensus needs to be reached on this issue, and then both reply

[PATCH 06/11] emacs: Support passing input via `notmuch-call-notmuch-*'

2013-10-07 Thread Austin Clements
This adds support for passing a string to write to notmuch's stdin to `notmuch-call-notmuch-process' and `notmuch-call-notmuch-sexp'. Since this makes both interfaces a little more complicated, it also unifies their documentation better. --- emacs/notmuch-lib.el | 39

[PATCH 01/11] schemata: Disambiguate non-terminal names

2013-10-07 Thread Austin Clements
Previously, the show schema and the search schema used different thread non-terminals. While these schemata don't interact, this is still confusing, so rename search's thread to thread_summary. To further limit confusion, prefix all top-level search non-terminals now begin with search_. ---

[PATCH 04/11] test: Fix missing erase-buffer in emacs test

2013-10-07 Thread Austin Clements
The first subprocess error exit code test assumed the *Notmuch errors* buffer would be empty. Rather than assuming, make it so. --- test/emacs | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/emacs b/test/emacs index 5bc3efc..05295af 100755 --- a/test/emacs +++

[PATCH 08/11] search: Add stable queries to thread search results

2013-10-07 Thread Austin Clements
These queries will match exactly the set of messages currently in the thread, even if more messages later arrive. Two queries are provided: one for matched messages and one for unmatched messages. This can be used to fix race conditions with tagging threads from search results. While tagging

[PATCH 02/11] cli: Separate current and deprecated format version

2013-10-07 Thread Austin Clements
Previously, the CLI would print a deprecation warning if a client requested any format version other than the current one. However, if we add fields that are backwards-compatible, but want clients to be able to depend on, we need to bump the version, but that doesn't make the older version

[PATCH 03/11] lib: Document extent of some return values

2013-10-07 Thread Austin Clements
This documents the extent of the notmuch_messages_t* pointers returned by notmuch_thread_get_toplevel_messages and notmuch_thread_get_messages. --- lib/notmuch.h | 4 1 file changed, 4 insertions(+) diff --git a/lib/notmuch.h b/lib/notmuch.h index 998a4ae..217bf46 100644 --- a/lib/notmuch.h

[PATCH 10/11] emacs: Add known-broken tests for search tagging races

2013-10-07 Thread Austin Clements
These tests check that both thread-local and global search tagging operations are race-free. They are currently known-broken because they aren't race-free. --- test/emacs | 26 ++ 1 file changed, 26 insertions(+) diff --git a/test/emacs b/test/emacs index

[PATCH 11/11] emacs: Fix search tagging races

2013-10-07 Thread Austin Clements
This fixes races in thread-local and global tagging in notmuch-search (e.g., +, -, a, *, etc.). Previously, these would modify tags of new messages that arrived after the search. Now they only operate on the messages that were in the threads when the search was performed. This prevents

Re: [PATCH 4/6] emacs: Support overriding help and describing prefix action

2013-10-07 Thread Austin Clements
Quoth Mark Walters on Oct 06 at 9:14 pm: This whole series looks good to me. If you are rolling another version for any reason I have one trivial comment On Sun, 06 Oct 2013, Austin Clements amdra...@mit.edu wrote: Traditionally, function documentation strings are intended primarily

[PATCH 6/6] News for Emacs help improvements

2013-10-06 Thread Austin Clements
--- NEWS | 8 1 file changed, 8 insertions(+) diff --git a/NEWS b/NEWS index 2e845f4..4f3b98a 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,14 @@ New options to better support handling duplicate messages bigger than the number of matching messages due to duplicates (i.e. multiple

[PATCH 5/6] emacs: Improve interactive use documentation

2013-10-06 Thread Austin Clements
This improves the function documentation for many interactive commands, either by improving their documentation string where the improvement also makes sense for programmatic use or by adding a 'notmuch-doc property where it doesn't. For nearly all commands that support a prefix argument, this

[PATCH 4/6] emacs: Support overriding help and describing prefix action

2013-10-06 Thread Austin Clements
Traditionally, function documentation strings are intended primarily for programmers, rather than users. They're written from the perspective of calling the function, not interactively invoking it. They're only ever displayed along with the function prototype (and often refer to argument names).

[PATCH 3/6] emacs: Clean up a few documentation strings

2013-10-06 Thread Austin Clements
Correct some grammatical errors, fix some violations of standard documentation string formatting conventions, and be more precise. --- emacs/notmuch-show.el | 18 ++ emacs/notmuch.el | 10 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git

[PATCH 2/6] emacs: `notmuch-mua-new-reply' is also not interactive

2013-10-06 Thread Austin Clements
Like `notmuch-mua-new-forward-message', this is meant to be invoked programmatically by something that can provide a reasonable query string. In fact, `notmuch-mua-new-reply's interactive specification didn't match its arguments, so it wouldn't have worked interactively. --- emacs/notmuch-mua.el

[PATCH 1/6] emacs: `notmuch-mua-new-forward-message' is not interactive

2013-10-06 Thread Austin Clements
`notmuch-mua-new-forward-message' must be called from a buffer containing a raw RFC2822-formatted message to forward. Hence, it's intended to be invoked programmatically through something else that sets up this buffer (like `notmuch-show-forward-message'), not interactively. Remove its

[PATCH 0/6] emacs: Built-in help improvements and clean up doc strings

2013-10-06 Thread Austin Clements
The first three patches in this series simply fix some function documentation string problems I found while making the other patches. I'm marking them trivial because they don't affect any code. The rest of this series improves a bunch of the built-in Emacs help, accessed through `notmuch-help'

Emacs: how to remove "unread" tag while reading emails

2013-10-05 Thread Austin Clements
Great list. One of the problems with the current approach, which most of these options share, is that there's no feedback. For example, when I enter a thread, I have no idea if the first message was unread or not. I'd like a solution that either naturally doesn't have this problem, that

Re: Emacs: how to remove unread tag while reading emails

2013-10-05 Thread Austin Clements
Great list. One of the problems with the current approach, which most of these options share, is that there's no feedback. For example, when I enter a thread, I have no idea if the first message was unread or not. I'd like a solution that either naturally doesn't have this problem, that

[PATCH 0/6] emacs: Built-in help improvements and clean up doc strings

2013-10-05 Thread Austin Clements
The first three patches in this series simply fix some function documentation string problems I found while making the other patches. I'm marking them trivial because they don't affect any code. The rest of this series improves a bunch of the built-in Emacs help, accessed through `notmuch-help'

[PATCH 2/6] emacs: `notmuch-mua-new-reply' is also not interactive

2013-10-05 Thread Austin Clements
Like `notmuch-mua-new-forward-message', this is meant to be invoked programmatically by something that can provide a reasonable query string. In fact, `notmuch-mua-new-reply's interactive specification didn't match its arguments, so it wouldn't have worked interactively. --- emacs/notmuch-mua.el

[PATCH 6/6] News for Emacs help improvements

2013-10-05 Thread Austin Clements
--- NEWS | 8 1 file changed, 8 insertions(+) diff --git a/NEWS b/NEWS index 2e845f4..4f3b98a 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,14 @@ New options to better support handling duplicate messages bigger than the number of matching messages due to duplicates (i.e. multiple

[PATCH 3/6] emacs: Clean up a few documentation strings

2013-10-05 Thread Austin Clements
Correct some grammatical errors, fix some violations of standard documentation string formatting conventions, and be more precise. --- emacs/notmuch-show.el | 18 ++ emacs/notmuch.el | 10 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git

[PATCH 1/6] emacs: `notmuch-mua-new-forward-message' is not interactive

2013-10-05 Thread Austin Clements
`notmuch-mua-new-forward-message' must be called from a buffer containing a raw RFC2822-formatted message to forward. Hence, it's intended to be invoked programmatically through something else that sets up this buffer (like `notmuch-show-forward-message'), not interactively. Remove its

[PATCH] contrib: pick: use global keymap

2013-09-15 Thread Austin Clements
Quoth Mark Walters on Sep 15 at 9:17 am: > Austin recently introduced a new global keymap. This makes pick use > this global map. > > In most cases pick needs to override this global map because > it wants to close the message pane before doing the action. However, > this documents the

Re: [PATCH] contrib: pick: use global keymap

2013-09-15 Thread Austin Clements
Quoth Mark Walters on Sep 15 at 9:17 am: Austin recently introduced a new global keymap. This makes pick use this global map. In most cases pick needs to override this global map because it wants to close the message pane before doing the action. However, this documents the over-rides and

[PATCH] emacs: bugfix unquoted symbol

2013-09-14 Thread Austin Clements
Definitely LGTM. Quoth Mark Walters on Sep 14 at 9:17 pm: > In the recent changes for search order handling the default-value of > notmuch-search-oldest-first was used. However, default-value needs a > symbol so the symbol-name needs to be quoted. > > This missing quote was causing strange

Re: [PATCH] emacs: bugfix unquoted symbol

2013-09-14 Thread Austin Clements
Definitely LGTM. Quoth Mark Walters on Sep 14 at 9:17 pm: In the recent changes for search order handling the default-value of notmuch-search-oldest-first was used. However, default-value needs a symbol so the symbol-name needs to be quoted. This missing quote was causing strange

[PATCH] emacs: show: stop stderr appearing in buffer

2013-09-12 Thread Austin Clements
Quoth Mark Walters on Sep 12 at 10:33 am: > > Hi > > On Tue, 10 Sep 2013, David Bremner wrote: > >> Ideally, we would put this output in the notmuch errors buffer but the > >> handler is called asynchronously so we don't know when the output will > >> appear. Thus if we put it straight into the

<    3   4   5   6   7   8   9   10   11   12   >