[PATCH] sprinters: bugfix when NULL passed for a string.

2012-08-07 Thread Austin Clements
LGTM. This won't commute with [0], since that introduces broken tests that are fixed by this patch. I think we should remove the fields in the JSON header object for missing headers (except perhaps From and Date, if those really are mandatory headers), but I think we should do that after the

[PATCH v2] test: Add test for messages with missing headers

2012-08-07 Thread Austin Clements
Currently the JSON tests for search and show are broken because notmuch attempts to dereference a NULL pointer. --- This version fixes the "Show: text" test so that it sanitize its output and doesn't hard-code my test paths. test/missing-headers | 162

[PATCH] sprinters: bugfix when NULL passed for a string.

2012-08-07 Thread Mark Walters
The string function in a sprinter may be called with a NULL string pointer (eg if a header is absent). This causes a segfault. We fix this by checking for a null pointer in the string functions and update the sprinter documentation. At the moment some output when format=text is done directly

[PATCH] notmuch-show: add notmuch-show-auto-mark-read option

2012-08-07 Thread Tomi Ollila
On Tue, Aug 07 2012, Mark Walters wrote: > On Tue, 07 Aug 2012, Michal Nazarewicz wrote: [ ... ] >> Mark Walters writes: >>> As an alternative approach would allowing a list of tags (or even tag >>> changes) to apply when a message is "read" do what you want and be more >>> flexible? >> >>

[PATCH] emacs: notmuch search bugfix

2012-08-07 Thread Tomi Ollila
On Tue, Aug 07 2012, Mark Walters wrote: > The recent change to use json for notmuch-search.el introduced a bug > in the code for keeping position on refresh. The problem is a > comparison between (plist-get result :thread) and a thread-id returned > by notmuch-search-find-thread-id: the latter

[PATCH] notmuch-show: add notmuch-show-auto-mark-read option

2012-08-07 Thread Tomi Ollila
On Tue, Aug 07 2012, Mark Walters wrote: > On Mon, 06 Aug 2012, Michal Nazarewicz wrote: >> From: Michal Nazarewicz >> >> Setting `notmuch-show-auto-mark-read' to nil stops notmuch-show from marking >> the message as read (by removing the unread tag). Inteded for people who >> like to mark

[PATCH] sprinters: bugfix when NULL passed for a string.

2012-08-07 Thread Jameson Graef Rollins
with this solution as is. I definitely agree we need tests for this. jamie. -- next part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120807/26ae83fd/attachment.pgp>

[PATCH] notmuch-show: add notmuch-show-auto-mark-read option

2012-08-07 Thread Michal Nazarewicz
A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120807/5a60dc84/attachment-0001.pgp>

[PATCH] notmuch-show: add notmuch-show-auto-mark-read option

2012-08-07 Thread Michal Nazarewicz
hread. -- Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o ..o | Computer Science, Micha? ?mina86? Nazarewicz(o o) ooo +--ooO--(_)--Ooo-- -- next part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120807/657154a7/attachment.pgp>

[PATCH v2] emacs: notmuch search bugfix

2012-08-07 Thread Mark Walters
The recent change to use json for notmuch-search.el introduced a bug in the code for keeping position on refresh. The problem is a comparison between (plist-get result :thread) and a thread-id returned by notmuch-search-find-thread-id: the latter is prefixed with "thread:" We fix this by adding

‘class Xapian::Database’ has no member named ‘close’

2012-08-07 Thread Michal Nazarewicz
crubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120807/95f32f6e/attachment-0001.pgp>

[PATCH] test: Add test for messages with missing headers

2012-08-07 Thread Austin Clements
Currently the JSON tests for search and show are broken because notmuch attempts to dereference a NULL pointer. --- Things to bikeshed: * Should we include From and Subject in the headers object when there are no from or subject headers? Currently the schema says that everything but those

[PATCH] cli: Remove now-unused json.c

2012-08-07 Thread Mark Walters
+1 Mark On Tue, 07 Aug 2012, Austin Clements wrote: > The string buffer quoting functions in json.c have been superseded by > the new sprinter interface and are no longer used. Remove them. > --- > Makefile.local |1 - > json.c | 109 >

[PATCH] reply: Convert JSON format to use sprinter

2012-08-07 Thread Mark Walters
On Tue, 07 Aug 2012, Austin Clements wrote: > Almost all of reply was already being formatted using the sprinter. > This patch converts the top-level dictionary to use the sprinter > interface. > --- > > One last sprinter piece that had slipped through the cracks. Looks good to me +1 Mark >

[PATCH] notmuch-show: add notmuch-show-auto-mark-read option

2012-08-07 Thread Mark Walters
On Tue, 07 Aug 2012, Michal Nazarewicz wrote: >> On Mon, 06 Aug 2012, Michal Nazarewicz wrote: >>> @@ -1374,9 +1382,11 @@ current thread." >>>"Are the headers of the current message visible?" >>>(notmuch-show-get-prop :headers-visible)) >>> >>> -(defun notmuch-show-mark-read () >>> -

[PATCH] emacs: notmuch search bugfix

2012-08-07 Thread Mark Walters
The recent change to use json for notmuch-search.el introduced a bug in the code for keeping position on refresh. The problem is a comparison between (plist-get result :thread) and a thread-id returned by notmuch-search-find-thread-id: the latter is prefixed with "thread:" We fix this by adding

[PATCH] notmuch-show: add notmuch-show-auto-mark-read option

2012-08-07 Thread Mark Walters
On Mon, 06 Aug 2012, Michal Nazarewicz wrote: > From: Michal Nazarewicz > > Setting `notmuch-show-auto-mark-read' to nil stops notmuch-show from marking > the message as read (by removing the unread tag). Inteded for people who > like to mark messages read explicitly. > --- >

[PATCH] cli: Remove now-unused json.c

2012-08-07 Thread Tomi Ollila
On Tue, Aug 07 2012, Austin Clements wrote: > The string buffer quoting functions in json.c have been superseded by > the new sprinter interface and are no longer used. Remove them. > --- +1 Tomi > Makefile.local |1 - > json.c | 109 >

[PATCH] reply: Convert JSON format to use sprinter

2012-08-07 Thread Tomi Ollila
On Tue, Aug 07 2012, Austin Clements wrote: > Almost all of reply was already being formatted using the sprinter. > This patch converts the top-level dictionary to use the sprinter > interface. > --- LGTM. Tomi > > One last sprinter piece that had slipped through the cracks. > >

[PATCH v2] emacs: notmuch search bugfix

2012-08-07 Thread Austin Clements
On Tue, 07 Aug 2012, Mark Walters wrote: > The recent change to use json for notmuch-search.el introduced a bug > in the code for keeping position on refresh. The problem is a > comparison between (plist-get result :thread) and a thread-id returned > by notmuch-search-find-thread-id: the latter

[PATCH] emacs: notmuch search bugfix

2012-08-07 Thread Austin Clements
Quoth Mark Walters on Aug 07 at 4:40 pm: > > The recent change to use json for notmuch-search.el introduced a bug > in the code for keeping position on refresh. The problem is a > comparison between (plist-get result :thread) and a thread-id returned > by notmuch-search-find-thread-id: the

Vim plugins

2012-08-07 Thread Anton Khirnov
On Tue, 7 Aug 2012 09:35:02 +0100 (BST), Sepp Tannhuber wrote: > That's strange. I suppose there must be a function called > ? NMVimpy > in one of your scripts. But > ? grep -R NMVimpy * > in your notmuch directory does not find anything. I am completely at a loss. >

[PATCH 1/4] show: indicate length of omitted body content (json)

2012-08-07 Thread Austin Clements
Quoting Peter Wang : > On Mon, 6 Aug 2012 12:47:10 -0400, Austin Clements > wrote: >> What's the overall goal of adding this? Are you planning to add size >> information to one of the frontends? > > Yes, to my frontend. > >>> > diff --git a/devel/schemata b/devel/schemata >> > index

Vim plugins

2012-08-07 Thread Sepp Tannhuber
That's strange. I suppose there must be a function called ? NMVimpy in one of your scripts. But ? grep -R NMVimpy * in your notmuch directory does not find anything. I am completely at a loss. - Urspr?ngliche Message - Von: Anton Khirnov An: Sepp Tannhuber ; "notmuch at notmuchmail.org"

[PATCH] cli: Remove now-unused json.c

2012-08-07 Thread Austin Clements
The string buffer quoting functions in json.c have been superseded by the new sprinter interface and are no longer used. Remove them. --- Makefile.local |1 - json.c | 109 2 files changed, 110 deletions(-) delete mode 100644

Segmentation fault in notmuch search --format=json

2012-08-07 Thread Mark Walters
On Tue, 07 Aug 2012, Ben Gamari wrote: > It seems some messages trigger a segmentation fault in > `do_search_threads()`. It appears the problem occurs (at least) when > `authors` is NULL. Hi thanks for the bug report and detailed debugging. I think I can see the problem and there is a test patch

Vim plugins

2012-08-07 Thread Anton Khirnov
On Mon, 6 Aug 2012 23:29:08 +0100 (BST), Sepp Tannhuber wrote: > Hi Anton, > > thanks for answering. Finally I found it. My next problem is that I have > absolutely no idea how to use it. > I followed the instructions I have found in this mailing list and copied the > syntax files into my

Segmentation fault in notmuch search --format=json

2012-08-07 Thread Ben Gamari
It seems some messages trigger a segmentation fault in `do_search_threads()`. It appears the problem occurs (at least) when `authors` is NULL. Program received signal SIGSEGV, Segmentation fault. 0x00415aa3 in json_string (sp=0x646c70, val=0x0) at sprinter-json.c:121 121

Segmentation fault in notmuch search --format=json

2012-08-07 Thread Jameson Graef Rollins
n this case was one with no subject. > Finally, I think nothing in json.c is used anymore so perhaps it > could be removed. Agreed. jamie. -- next part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not

Small bug in json-search changes

2012-08-07 Thread Mark Walters
Hi I have found a small bug in the recent changes to notmuch search to use the JSON output. If you refresh the search buffer "point" does not stay on the same thread. I think the problem is that notmuch-search-refresh-view calls notmuch search with target-thread set to

Vim plugins

2012-08-07 Thread Sepp Tannhuber
Hi Anton, thanks for answering. Finally I found it. My next problem is that I have absolutely no idea how to use it. I followed the instructions I have found in this mailing list and copied the syntax files into my ~/.vim/syntax and the two plugin files?into my ~/.vim/plugin folders. Then I

Re: Segmentation fault in notmuch search --format=json

2012-08-07 Thread Mark Walters
On Tue, 07 Aug 2012, Ben Gamari bgamari.f...@gmail.com wrote: It seems some messages trigger a segmentation fault in `do_search_threads()`. It appears the problem occurs (at least) when `authors` is NULL. Hi thanks for the bug report and detailed debugging. I think I can see the problem and

Re: Segmentation fault in notmuch search --format=json

2012-08-07 Thread Jameson Graef Rollins
On Tue, Aug 07 2012, Mark Walters markwalters1...@gmail.com wrote: On Tue, 07 Aug 2012, Ben Gamari bgamari.f...@gmail.com wrote: It seems some messages trigger a segmentation fault in `do_search_threads()`. It appears the problem occurs (at least) when `authors` is NULL. Hi thanks for the

Re: Vim plugins

2012-08-07 Thread Sepp Tannhuber
That's strange. I suppose there must be a function called   NMVimpy in one of your scripts. But   grep -R NMVimpy * in your notmuch directory does not find anything. I am completely at a loss. - Ursprüngliche Message - Von: Anton Khirnov an...@khirnov.net An: Sepp Tannhuber

Re: Vim plugins

2012-08-07 Thread Anton Khirnov
On Tue, 7 Aug 2012 09:35:02 +0100 (BST), Sepp Tannhuber sepp.tannhu...@yahoo.de wrote: That's strange. I suppose there must be a function called   NMVimpy in one of your scripts. But   grep -R NMVimpy * in your notmuch directory does not find anything. I am completely at a loss.

Re: Segmentation fault in notmuch search --format=json

2012-08-07 Thread Austin Clements
Quoth Mark Walters on Aug 07 at 8:07 am: On Tue, 07 Aug 2012, Ben Gamari bgamari.f...@gmail.com wrote: It seems some messages trigger a segmentation fault in `do_search_threads()`. It appears the problem occurs (at least) when `authors` is NULL. Hi thanks for the bug report and detailed

[PATCH] reply: Convert JSON format to use sprinter

2012-08-07 Thread Austin Clements
Almost all of reply was already being formatted using the sprinter. This patch converts the top-level dictionary to use the sprinter interface. --- One last sprinter piece that had slipped through the cracks. notmuch-reply.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff

[PATCH] cli: Remove now-unused json.c

2012-08-07 Thread Austin Clements
The string buffer quoting functions in json.c have been superseded by the new sprinter interface and are no longer used. Remove them. --- Makefile.local |1 - json.c | 109 2 files changed, 110 deletions(-) delete mode 100644

Re: [PATCH] reply: Convert JSON format to use sprinter

2012-08-07 Thread Tomi Ollila
On Tue, Aug 07 2012, Austin Clements amdra...@mit.edu wrote: Almost all of reply was already being formatted using the sprinter. This patch converts the top-level dictionary to use the sprinter interface. --- LGTM. Tomi One last sprinter piece that had slipped through the cracks.

Re: [PATCH] cli: Remove now-unused json.c

2012-08-07 Thread Tomi Ollila
On Tue, Aug 07 2012, Austin Clements amdra...@mit.edu wrote: The string buffer quoting functions in json.c have been superseded by the new sprinter interface and are no longer used. Remove them. --- +1 Tomi Makefile.local |1 - json.c | 109

Re: [PATCH 1/4] show: indicate length of omitted body content (json)

2012-08-07 Thread Peter Wang
On Mon, 6 Aug 2012 12:47:10 -0400, Austin Clements amdra...@mit.edu wrote: What's the overall goal of adding this? Are you planning to add size information to one of the frontends? Yes, to my frontend. diff --git a/devel/schemata b/devel/schemata index 9cb25f5..3df2764 100644 ---

Re: [PATCH 1/4] show: indicate length of omitted body content (json)

2012-08-07 Thread Austin Clements
Quoting Peter Wang noval...@gmail.com: On Mon, 6 Aug 2012 12:47:10 -0400, Austin Clements amdra...@mit.edu wrote: What's the overall goal of adding this? Are you planning to add size information to one of the frontends? Yes, to my frontend. diff --git a/devel/schemata b/devel/schemata

Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option

2012-08-07 Thread Mark Walters
On Mon, 06 Aug 2012, Michal Nazarewicz m...@google.com wrote: From: Michal Nazarewicz min...@mina86.com Setting `notmuch-show-auto-mark-read' to nil stops notmuch-show from marking the message as read (by removing the unread tag). Inteded for people who like to mark messages read explicitly.

‘class Xapian::Database’ has no member named ‘close’

2012-08-07 Thread Michal Nazarewicz
Hi guys, when I'm trying to build notmuch on Ubuntu Lucid, I'm getting the following error: lib/database.cc: In function ‘void notmuch_database_close(notmuch_database_t*)’: lib/database.cc:767: error: ‘class Xapian::Database’ has no member named ‘close’ I'm solving that by: diff --git

Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option

2012-08-07 Thread Michal Nazarewicz
On Mon, 06 Aug 2012, Michal Nazarewicz m...@google.com wrote: @@ -1374,9 +1382,11 @@ current thread. Are the headers of the current message visible? (notmuch-show-get-prop :headers-visible)) -(defun notmuch-show-mark-read () - Mark the current message as read. -

[PATCH] emacs: notmuch search bugfix

2012-08-07 Thread Mark Walters
The recent change to use json for notmuch-search.el introduced a bug in the code for keeping position on refresh. The problem is a comparison between (plist-get result :thread) and a thread-id returned by notmuch-search-find-thread-id: the latter is prefixed with thread: We fix this by adding an

Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option

2012-08-07 Thread Mark Walters
On Tue, 07 Aug 2012, Michal Nazarewicz m...@google.com wrote: On Mon, 06 Aug 2012, Michal Nazarewicz m...@google.com wrote: @@ -1374,9 +1382,11 @@ current thread. Are the headers of the current message visible? (notmuch-show-get-prop :headers-visible)) -(defun notmuch-show-mark-read

Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option

2012-08-07 Thread Tomi Ollila
On Tue, Aug 07 2012, Mark Walters markwalters1...@gmail.com wrote: On Mon, 06 Aug 2012, Michal Nazarewicz m...@google.com wrote: From: Michal Nazarewicz min...@mina86.com Setting `notmuch-show-auto-mark-read' to nil stops notmuch-show from marking the message as read (by removing the unread

Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option

2012-08-07 Thread Michal Nazarewicz
From: Michal Nazarewicz min...@mina86.com @@ -1383,8 +1390,9 @@ current thread. (notmuch-show-get-prop :headers-visible)) (defun notmuch-show-mark-read () - Mark the current message as read. - (notmuch-show-tag-message -unread)) + Apply `notmuch-show-mark-read-tags' to the

Re: [PATCH] reply: Convert JSON format to use sprinter

2012-08-07 Thread Mark Walters
On Tue, 07 Aug 2012, Austin Clements amdra...@mit.edu wrote: Almost all of reply was already being formatted using the sprinter. This patch converts the top-level dictionary to use the sprinter interface. --- One last sprinter piece that had slipped through the cracks. Looks good to me +1

Re: [PATCH] cli: Remove now-unused json.c

2012-08-07 Thread Mark Walters
+1 Mark On Tue, 07 Aug 2012, Austin Clements amdra...@mit.edu wrote: The string buffer quoting functions in json.c have been superseded by the new sprinter interface and are no longer used. Remove them. --- Makefile.local |1 - json.c | 109

Re: [PATCH] emacs: notmuch search bugfix

2012-08-07 Thread Austin Clements
Quoth Mark Walters on Aug 07 at 4:40 pm: The recent change to use json for notmuch-search.el introduced a bug in the code for keeping position on refresh. The problem is a comparison between (plist-get result :thread) and a thread-id returned by notmuch-search-find-thread-id: the latter is

Re: [PATCH] emacs: notmuch search bugfix

2012-08-07 Thread Tomi Ollila
On Tue, Aug 07 2012, Mark Walters wrote: The recent change to use json for notmuch-search.el introduced a bug in the code for keeping position on refresh. The problem is a comparison between (plist-get result :thread) and a thread-id returned by notmuch-search-find-thread-id: the latter is

[PATCH v2] emacs: notmuch search bugfix

2012-08-07 Thread Mark Walters
The recent change to use json for notmuch-search.el introduced a bug in the code for keeping position on refresh. The problem is a comparison between (plist-get result :thread) and a thread-id returned by notmuch-search-find-thread-id: the latter is prefixed with thread: We fix this by adding an

Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option

2012-08-07 Thread Tomi Ollila
On Tue, Aug 07 2012, Mark Walters markwalters1...@gmail.com wrote: On Tue, 07 Aug 2012, Michal Nazarewicz m...@google.com wrote: [ ... ] Mark Walters markwalters1...@gmail.com writes: As an alternative approach would allowing a list of tags (or even tag changes) to apply when a message is

Re: [PATCH v2] emacs: notmuch search bugfix

2012-08-07 Thread Austin Clements
On Tue, 07 Aug 2012, Mark Walters markwalters1...@gmail.com wrote: The recent change to use json for notmuch-search.el introduced a bug in the code for keeping position on refresh. The problem is a comparison between (plist-get result :thread) and a thread-id returned by

[PATCH] sprinters: bugfix when NULL passed for a string.

2012-08-07 Thread Mark Walters
The string function in a sprinter may be called with a NULL string pointer (eg if a header is absent). This causes a segfault. We fix this by checking for a null pointer in the string functions and update the sprinter documentation. At the moment some output when format=text is done directly

[PATCH] test: Add test for messages with missing headers

2012-08-07 Thread Austin Clements
Currently the JSON tests for search and show are broken because notmuch attempts to dereference a NULL pointer. --- Things to bikeshed: * Should we include From and Subject in the headers object when there are no from or subject headers? Currently the schema says that everything but those

Re: [PATCH] test: Add test for messages with missing headers

2012-08-07 Thread Mark Walters
Hi This generally looks good but there is a bug in the test from a hardcoded /tmp/ path (see below). And as confirmation with the patch in id:874noe1o0r@qmul.ac.uk the tests (modulo the test bug) pass. On Tue, 07 Aug 2012, Austin Clements amdra...@mit.edu wrote: Currently the JSON tests

Re: [PATCH 1/4] show: indicate length of omitted body content (json)

2012-08-07 Thread Mark Walters
I like this (and agree with Austin and you that text and json can diverge). I just hacked something together which uses this and makes the emacs front-end display the content-length on part buttons and as someone who uses notmuch over ssh that is nice. I have two minor queries: do you think

[PATCH v2] test: Add test for messages with missing headers

2012-08-07 Thread Austin Clements
Currently the JSON tests for search and show are broken because notmuch attempts to dereference a NULL pointer. --- This version fixes the Show: text test so that it sanitize its output and doesn't hard-code my test paths. test/missing-headers | 162

Re: [PATCH] sprinters: bugfix when NULL passed for a string.

2012-08-07 Thread Jameson Graef Rollins
On Tue, Aug 07 2012, Mark Walters markwalters1...@gmail.com wrote: The string function in a sprinter may be called with a NULL string pointer (eg if a header is absent). This causes a segfault. We fix this by checking for a null pointer in the string functions and update the sprinter

Re: [PATCH] sprinters: bugfix when NULL passed for a string.

2012-08-07 Thread Austin Clements
LGTM. This won't commute with [0], since that introduces broken tests that are fixed by this patch. I think we should remove the fields in the JSON header object for missing headers (except perhaps From and Date, if those really are mandatory headers), but I think we should do that after the