[PATCH 3/3] notmuch-show: detect xapian exception in query

2014-01-24 Thread Jani Nikula
On Thu, 23 Jan 2014, David Bremner wrote: > We want to return an error status, not 0 or (worse) segfault. > --- > notmuch-show.c| 6 +- > test/T520-show.sh | 1 - > 2 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/notmuch-show.c b/notmuch-show.c > index 528694b..b162738 1

[PATCH] lib: update documentation for notmuch_database_get_directory

2014-01-24 Thread David Bremner
Clarify that using the directory after destroying the corresponding database is not permitted. This is implicit in the description of notmuch_database_destroy, but it doesn't hurt to be explicit, and we do express similar "ownership" relationships at other places in the docs. --- lib/notmuch.h |

[PATCH 2/3] lib: make notmuch_threads_valid return FALSE when passed NULL

2014-01-24 Thread Jani Nikula
On Thu, 23 Jan 2014, David Bremner wrote: > Without this patch, the example code in the header docs crashes for certain > invalid queries (see id:871u00oimv.fsf at approx.mit.edu) > --- > lib/notmuch.h | 2 ++ > lib/query.cc | 3 +++ > 2 files changed, 5 insertions(+) > > diff --git a/lib/notmuc

[PATCH 2/2] python: annotate all calls into libnotmuch with types

2014-01-24 Thread David Bremner
Justus Winter <4winter at informatik.uni-hamburg.de> writes: > #0 0x7f996ad021d5 in __GI_raise (sig=sig at entry=6) at > ../nptl/sysdeps/unix/sysv/linux/raise.c:56 > 56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. > (gdb) bt > #0 0x7f996ad021d5 in __GI_raise

segfault if notmuch-show query has spurious .. (w/ v0.17)

2014-01-24 Thread David Bremner
Sanjoy Mahajan writes: > Probably because I kept using notmuch-emacs .elc code from 0.16 after > notmuch got upgraded to 0.17 (I rarely restart emacs), my Emacs > interface to notmuch started generating queries that caused Xapian > exceptions and segfaults. Here's one: > > $ notmuch show '( FW

Round 2: fix for notmuch show segfault

2014-01-24 Thread Tomi Ollila
On Thu, Jan 23 2014, Mark Walters wrote: > This looks good and works (tested without patch 2/3). I don't have a > view on whether we should do the second patch or just update the docs. Looks good. for patch #2 I'd check which one is more consistent with other code constructs used & library inter

[PATCH 3/3] notmuch-show: detect xapian exception in query

2014-01-24 Thread David Bremner
Jani Nikula writes: > > This should just return 1 or something. See how the function eventually > returns res != NOTMUCH_STATUS_SUCCESS instead of notmuch_status_t. And > threads == NULL is not guaranteed to mean an exception occurred anyway. > > Otherwise the patch LGTM, and is in line with the e

[PATCH] test: make test_emacs call post-command-hook

2014-01-24 Thread Tomi Ollila
On Fri, Jan 24 2014, David Bremner wrote: > From: Mark Walters > > The unread/read changes will use the post-command-hook. test_emacs > does not call the post-command-hook. This adds a notmuch-test-progn > which takes a list of commands as argument and executes them in turn > but runs the post-c

[PATCH 0/5] lib: make folder: prefix literal

2014-01-24 Thread David Bremner
Austin Clements writes: > On Thu, 09 Jan 2014, Jani Nikula wrote: > > I strongly disagree with requiring the cur/new component. The cur/new > directory is an internal implementation detail of Maildir (and a rather > broken one at that) and no more a part of the "folder" of a piece of > mail tha

[PATCH] lib: update documentation for notmuch_database_get_directory

2014-01-24 Thread David Bremner
Clarify that using the directory after destroying the corresponding database is not permitted. This is implicit in the description of notmuch_database_destroy, but it doesn't hurt to be explicit, and we do express similar "ownership" relationships at other places in the docs. --- lib/notmuch.h |

Re: [PATCH 2/2] python: annotate all calls into libnotmuch with types

2014-01-24 Thread David Bremner
Justus Winter <4win...@informatik.uni-hamburg.de> writes: > #0 0x7f996ad021d5 in __GI_raise (sig=sig@entry=6) at > ../nptl/sysdeps/unix/sysv/linux/raise.c:56 > 56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. > (gdb) bt > #0 0x7f996ad021d5 in __GI_raise (sig=s

[PATCH 2/2] python: annotate all calls into libnotmuch with types

2014-01-24 Thread Justus Winter
Hi :) Quoting David Bremner (2014-01-24 14:17:27) > Justus Winter <4winter at informatik.uni-hamburg.de> writes: > > > Quoting Justus Winter (2011-12-07 19:49:31) > > > And another one: > [stack trace snipped] > > #69 0x004e10be in PyRun_SimpleFileExFlags (fp=0xb99c10, > > filename=, cl

Re: segfault if notmuch-show query has spurious .. (w/ v0.17)

2014-01-24 Thread David Bremner
Sanjoy Mahajan writes: > Probably because I kept using notmuch-emacs .elc code from 0.16 after > notmuch got upgraded to 0.17 (I rarely restart emacs), my Emacs > interface to notmuch started generating queries that caused Xapian > exceptions and segfaults. Here's one: > > $ notmuch show '( FW

[PATCH] test: make test_emacs call post-command-hook

2014-01-24 Thread Tomi Ollila
On Thu, Jan 23 2014, Mark Walters wrote: >> What do you think about this alternate version? it allows >> notmuch-test-progn to have the same syntax as progn. It seems about >> the same level of complexity to me; fwiw I prefer the let over the >> dolist/setq. > > This looks much nicer: a macro is

Re: [PATCH 3/3] notmuch-show: detect xapian exception in query

2014-01-24 Thread David Bremner
Jani Nikula writes: > > This should just return 1 or something. See how the function eventually > returns res != NOTMUCH_STATUS_SUCCESS instead of notmuch_status_t. And > threads == NULL is not guaranteed to mean an exception occurred anyway. > > Otherwise the patch LGTM, and is in line with the e

[PATCH 2/5] test: fix insert folder: searches

2014-01-24 Thread Austin Clements
This is the other reason I disagree with including cur/new. If we strip it, people's existing folder: searches will mostly continue to work. If we include it, such saved searches, scripted searches, and post-new hooks are guaranteed to break. On Thu, 09 Jan 2014, Jani Nikula wrote: > folder: is

[PATCH 1/5] lib: make folder: prefix literal

2014-01-24 Thread Austin Clements
On Thu, 09 Jan 2014, Jani Nikula wrote: > In xapian terms, convert folder: prefix from probabilistic to boolean > prefix. This change constitutes a database change: bump the database > version and add database upgrade support. > --- > lib/database.cc | 39 - > lib/message.cc

[PATCH 0/5] lib: make folder: prefix literal

2014-01-24 Thread Austin Clements
On Thu, 09 Jan 2014, Jani Nikula wrote: > Hi all, this series makes the folder: search prefix literal, or switches > it from a probabilistic prefix to a boolean prefix. With this, you have > to give the path from the maildir root to the folder you want in full, > including the maildir cur/new comp

Re: [PATCH 0/5] lib: make folder: prefix literal

2014-01-24 Thread David Bremner
Austin Clements writes: > On Thu, 09 Jan 2014, Jani Nikula wrote: > > I strongly disagree with requiring the cur/new component. The cur/new > directory is an internal implementation detail of Maildir (and a rather > broken one at that) and no more a part of the "folder" of a piece of > mail tha

Re: [PATCH 2/5] test: fix insert folder: searches

2014-01-24 Thread Austin Clements
This is the other reason I disagree with including cur/new. If we strip it, people's existing folder: searches will mostly continue to work. If we include it, such saved searches, scripted searches, and post-new hooks are guaranteed to break. On Thu, 09 Jan 2014, Jani Nikula wrote: > folder: is

Re: [PATCH 1/5] lib: make folder: prefix literal

2014-01-24 Thread Austin Clements
On Thu, 09 Jan 2014, Jani Nikula wrote: > In xapian terms, convert folder: prefix from probabilistic to boolean > prefix. This change constitutes a database change: bump the database > version and add database upgrade support. > --- > lib/database.cc | 39 - > lib/message.cc

Re: [PATCH 0/5] lib: make folder: prefix literal

2014-01-24 Thread Austin Clements
On Thu, 09 Jan 2014, Jani Nikula wrote: > Hi all, this series makes the folder: search prefix literal, or switches > it from a probabilistic prefix to a boolean prefix. With this, you have > to give the path from the maildir root to the folder you want in full, > including the maildir cur/new comp

Re: [PATCH 3/3] notmuch-show: detect xapian exception in query

2014-01-24 Thread Jani Nikula
On Thu, 23 Jan 2014, David Bremner wrote: > We want to return an error status, not 0 or (worse) segfault. > --- > notmuch-show.c| 6 +- > test/T520-show.sh | 1 - > 2 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/notmuch-show.c b/notmuch-show.c > index 528694b..b162738 1

Re: [PATCH 2/3] lib: make notmuch_threads_valid return FALSE when passed NULL

2014-01-24 Thread Jani Nikula
On Thu, 23 Jan 2014, David Bremner wrote: > Without this patch, the example code in the header docs crashes for certain > invalid queries (see id:871u00oimv@approx.mit.edu) > --- > lib/notmuch.h | 2 ++ > lib/query.cc | 3 +++ > 2 files changed, 5 insertions(+) > > diff --git a/lib/notmuch.h

[PATCH] test: make test_emacs call post-command-hook

2014-01-24 Thread David Bremner
From: Mark Walters The unread/read changes will use the post-command-hook. test_emacs does not call the post-command-hook. This adds a notmuch-test-progn which takes a list of commands as argument and executes them in turn but runs the post-command-hook after each one. The caller can batch opera

[PATCH 1/2] notmuch dump: default to batch-tag format.

2014-01-24 Thread Tomi Ollila
On Thu, Jan 23 2014, David Bremner wrote: > Although we didn't formally deprecate the old format, the new one has > been available for a year. > --- These 2 patches LGTM +1 Tomi

[PATCH 6/7] cli: add --quiet option to notmuch new

2014-01-24 Thread Jani Nikula
On Fri, 24 Jan 2014, Mark Walters wrote: > I am not sure I like doing the database upgrade with no comment to the > user at all. I think --quiet should mean we don't write to stdout at all. So the question becomes, is the database upgrade worth warning about in stderr? > In fact I am not sure I

Re: Round 2: fix for notmuch show segfault

2014-01-24 Thread Tomi Ollila
On Thu, Jan 23 2014, Mark Walters wrote: > This looks good and works (tested without patch 2/3). I don't have a > view on whether we should do the second patch or just update the docs. Looks good. for patch #2 I'd check which one is more consistent with other code constructs used & library inter

Re: [PATCH] test: make test_emacs call post-command-hook

2014-01-24 Thread Tomi Ollila
On Fri, Jan 24 2014, David Bremner wrote: > From: Mark Walters > > The unread/read changes will use the post-command-hook. test_emacs > does not call the post-command-hook. This adds a notmuch-test-progn > which takes a list of commands as argument and executes them in turn > but runs the post-c

notmuch-emacs bug report -- infinite looping trying to select next message

2014-01-24 Thread David Bremner
Michael Hudson-Doyle writes: > The attached gzipped mbox appears to trip up the emacs interface. The > problem seems to come from the message with id > CAGNsrLCWv6=36q+q+5Hc_SzgdZ2ergeKkapT7T3xXvim=2cK+A at mail.gmail.com. > I can't reproduce this bug in current git, so I'm going to assume some

Bug?: notmuch-search-show-thread shows several threads; only one containing matching messages

2014-01-24 Thread David Bremner
Mark Walters writes: > Hi > > I have looked at this and I think this is not notmuch's fault: I think > it is a mua doing strange things: > > One of the mails has an in-reply-to header which looks like > > In-reply-to: Message from Carsten Dominik of > "Tue, 15 Mar 2011 12:18:51 BST."

[PATCH 2/2] python: annotate all calls into libnotmuch with types

2014-01-24 Thread David Bremner
Patrick Totzke writes: > This commit breaks raising XapianErrors for me. > > If I lock the index with some `notmuch tag +test '*'` > and try to write to it in alot, i get a segfault and > the following on stderr: > > Xapian exception occurred opening database: Unable to get write lock on > /home/

[PATCH 2/2] python: annotate all calls into libnotmuch with types

2014-01-24 Thread David Bremner
Justus Winter <4winter at informatik.uni-hamburg.de> writes: > Quoting Justus Winter (2011-12-07 19:49:31) > And another one: [stack trace snipped] > #69 0x004e10be in PyRun_SimpleFileExFlags (fp=0xb99c10, > filename=, closeit=1, flags=0x7fffc13a1f60) at > ../Python/pythonrun.c:936 > #7

[PATCH 1/2] notmuch dump: default to batch-tag format.

2014-01-24 Thread David Bremner
Tomi Ollila writes: > On Thu, Jan 23 2014, David Bremner wrote: > >> Although we didn't formally deprecate the old format, the new one has >> been available for a year. >> --- > > These 2 patches LGTM +1 > > Tomi Pushed. d

[PATCH 6/7] cli: add --quiet option to notmuch new

2014-01-24 Thread Mark Walters
Hi I am working my way through this series in a rather random order. I am not sure I like doing the database upgrade with no comment to the user at all. In fact I am not sure I like doing the upgrade without being specifically told to (e.g. it does not give the user a clear chance to backup the

Re: [PATCH 2/2] python: annotate all calls into libnotmuch with types

2014-01-24 Thread Justus Winter
Hi :) Quoting David Bremner (2014-01-24 14:17:27) > Justus Winter <4win...@informatik.uni-hamburg.de> writes: > > > Quoting Justus Winter (2011-12-07 19:49:31) > > > And another one: > [stack trace snipped] > > #69 0x004e10be in PyRun_SimpleFileExFlags (fp=0xb99c10, > > filename=, close

[PATCH] test: make test_emacs call post-command-hook

2014-01-24 Thread David Bremner
From: Mark Walters The unread/read changes will use the post-command-hook. test_emacs does not call the post-command-hook. This adds a notmuch-test-progn which takes a list of commands as argument and executes them in turn but runs the post-command-hook after each one. The caller can batch opera

Re: [PATCH] test: make test_emacs call post-command-hook

2014-01-24 Thread Tomi Ollila
On Thu, Jan 23 2014, Mark Walters wrote: >> What do you think about this alternate version? it allows >> notmuch-test-progn to have the same syntax as progn. It seems about >> the same level of complexity to me; fwiw I prefer the let over the >> dolist/setq. > > This looks much nicer: a macro is

Re: notmuch-emacs bug report -- infinite looping trying to select next message

2014-01-24 Thread David Bremner
Michael Hudson-Doyle writes: > The attached gzipped mbox appears to trip up the emacs interface. The > problem seems to come from the message with id > CAGNsrLCWv6=36q+q+5Hc_SzgdZ2ergeKkapT7T3xXvim=2c...@mail.gmail.com. > I can't reproduce this bug in current git, so I'm going to assume somethi

Re: Bug?: notmuch-search-show-thread shows several threads; only one containing matching messages

2014-01-24 Thread David Bremner
Mark Walters writes: > Hi > > I have looked at this and I think this is not notmuch's fault: I think > it is a mua doing strange things: > > One of the mails has an in-reply-to header which looks like > > In-reply-to: Message from Carsten Dominik of > "Tue, 15 Mar 2011 12:18:51 BST."

Re: [PATCH 2/2] python: annotate all calls into libnotmuch with types

2014-01-24 Thread David Bremner
Patrick Totzke writes: > This commit breaks raising XapianErrors for me. > > If I lock the index with some `notmuch tag +test '*'` > and try to write to it in alot, i get a segfault and > the following on stderr: > > Xapian exception occurred opening database: Unable to get write lock on > /home/

Re: [PATCH 2/2] python: annotate all calls into libnotmuch with types

2014-01-24 Thread David Bremner
Justus Winter <4win...@informatik.uni-hamburg.de> writes: > Quoting Justus Winter (2011-12-07 19:49:31) > And another one: [stack trace snipped] > #69 0x004e10be in PyRun_SimpleFileExFlags (fp=0xb99c10, > filename=, closeit=1, flags=0x7fffc13a1f60) at > ../Python/pythonrun.c:936 > #70 0

Re: [PATCH 1/2] notmuch dump: default to batch-tag format.

2014-01-24 Thread David Bremner
Tomi Ollila writes: > On Thu, Jan 23 2014, David Bremner wrote: > >> Although we didn't formally deprecate the old format, the new one has >> been available for a year. >> --- > > These 2 patches LGTM +1 > > Tomi Pushed. d ___ notmuch mailing list n

Re: [PATCH 6/7] cli: add --quiet option to notmuch new

2014-01-24 Thread Jani Nikula
On Fri, 24 Jan 2014, Mark Walters wrote: > I am not sure I like doing the database upgrade with no comment to the > user at all. I think --quiet should mean we don't write to stdout at all. So the question becomes, is the database upgrade worth warning about in stderr? > In fact I am not sure I

Re: [PATCH 1/2] notmuch dump: default to batch-tag format.

2014-01-24 Thread Tomi Ollila
On Thu, Jan 23 2014, David Bremner wrote: > Although we didn't formally deprecate the old format, the new one has > been available for a year. > --- These 2 patches LGTM +1 Tomi ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/

Re: [PATCH 6/7] cli: add --quiet option to notmuch new

2014-01-24 Thread Mark Walters
Hi I am working my way through this series in a rather random order. I am not sure I like doing the database upgrade with no comment to the user at all. In fact I am not sure I like doing the upgrade without being specifically told to (e.g. it does not give the user a clear chance to backup the