[PATCH 1/1] emacs/notmuch-show.el: handle bodypart insert error

2012-10-31 Thread David Bremner
Tomi Ollila  writes:

> When inserting of email bodypart failes, insert a failure message
> to the buffer (and continue) instead of halting the insertion of
> the rest of that email thread in question.

I'm not totally sure about inserting error messages into the buffer, but
it seems like an improvement on what we have, so I'm untagging
needs-review.

Anybody who doesn't like it, speak up ;)

d


[PATCH v6 0/9] notmuch search date:since..until query support

2012-10-31 Thread David Bremner
Jani Nikula  writes:

> Hi all, v6 of [1] with plenty of small changes addressing Austin's
> review [2], [3], [4], and [5]. See my replies to Austin for what I've
> agreed to change, and what I've chosen to ignore and why.
>

Pushed, (with patch 7 out of sequence, sorry about that).

David


[PATCH] emacs: Function to query the list of labels from a thread-id

2012-10-31 Thread David Bremner
Jani Nikula  writes:

> Hi Damien, please send this patch as part of the series adding
> notmuch-labeler. Out of context, without adding any users of the
> function, it's a bit difficult to evaluate.

For what it's worth (and I'm definitely not claiming any kind final word
here) I did tell Damien that he was welcome to send pre-requisite
patches in a seperate series.  Of course, if you feel like you can't
really review what's there (or it's just too much work), that's your
call.

Cheer,

David



[PATCH v6 0/9] notmuch search date:since..until query support

2012-10-31 Thread Tomi Ollila
On Tue, Oct 30 2012, Jani Nikula  wrote:

> Hi all, v6 of [1] with plenty of small changes addressing Austin's
> review [2], [3], [4], and [5]. See my replies to Austin for what I've
> agreed to change, and what I've chosen to ignore and why.
>
> The single biggest change is the requirement to have some delimiter(s)
> between keywords, which allowed simplification of keyword
> matching. Consequently match_keyword() and parse_keyword() functions in
> patch 2/9 have changed considerably.
>
> There are a few ways to examine the changes since v5. My public repo at
> [6] has branches topic-parse-time-string-v5 (rebased to master) and
> topic-parse-time-string-v6, and [7] should provide a fancy colorful diff
> between the two. The same but less fancy diff is also at the end of this
> cover letter.
>
> Change by change commits to the parser and test tool can also be found
> at [8]. The source files there are copied verbatim to patches 2/9 and
> 3/9.

LGTM

>
> BR,
> Jani.
>

Tomi

> [1] id:cover.1350854171.git.jani at nikula.org
> [2] id:20121022081444.GM14861 at mit.edu for patch 2/9
> [3] id:20121023042326.GP14861 at mit.edu for patch 4/9
> [4] id:20121023045255.GQ14861 at mit.edu for patch 6/9
> [5] id:20121024210841.GU14861 at mit.edu for patch 8/9
> [6] https://gitorious.org/jani/notmuch
> [7] 
> https://gitorious.org/jani/notmuch/commit/06c76eb4181bc88eccabc419c690046682125d7a/diffs/ef5e8d111748784433f4b80c9e5378f0c1a57319
> [8] https://gitorious.org/parse-time-string/parse-time-string
>
> Jani Nikula (9):
>   build: drop the -Wswitch-enum warning
>   parse-time-string: add a date/time parser to notmuch
>   test: add new test tool parse-time for date/time parser
>   test: add smoke tests for the date/time parser module
>   build: build parse-time-string as part of the notmuch lib and static
> cli
>   lib: add date range query support
>   test: add tests for date:since..until range queries
>   man: document the date:since..until range queries
>   NEWS: date range search support
>
>  Makefile  |2 +-
>  Makefile.local|2 +-
>  NEWS  |   12 +
>  configure |2 +-
>  lib/Makefile.local|3 +-
>  lib/database-private.h|1 +
>  lib/database.cc   |5 +
>  lib/parse-time-vrp.cc |   61 ++
>  lib/parse-time-vrp.h  |   40 +
>  man/man7/notmuch-search-terms.7   |  150 +++-
>  parse-time-string/Makefile|5 +
>  parse-time-string/Makefile.local  |   12 +
>  parse-time-string/README  |9 +
>  parse-time-string/parse-time-string.c | 1503 
> +
>  parse-time-string/parse-time-string.h |  102 +++
>  test/Makefile.local   |7 +-
>  test/basic|2 +-
>  test/notmuch-test |2 +
>  test/parse-time-string|   78 ++
>  test/parse-time.c |  314 +++
>  test/search-date  |   21 +
>  21 files changed, 2315 insertions(+), 18 deletions(-)
>  create mode 100644 lib/parse-time-vrp.cc
>  create mode 100644 lib/parse-time-vrp.h
>  create mode 100644 parse-time-string/Makefile
>  create mode 100644 parse-time-string/Makefile.local
>  create mode 100644 parse-time-string/README
>  create mode 100644 parse-time-string/parse-time-string.c
>  create mode 100644 parse-time-string/parse-time-string.h
>  create mode 100755 test/parse-time-string
>  create mode 100644 test/parse-time.c
>  create mode 100755 test/search-date
>
> -- 
> 1.7.10.4


[PATCH] fix notmuch_database_open call in addrlookup

2012-10-31 Thread James Vasile
What's the best way to submit changes to addrlookup?  Right now, it is
out of date vs the latest libnotmuch.  The addrlookup repo is vala code
but the wiki [1] points to a generated c file [2].

[1] http://github.com/spaetz/vala-notmuch/raw/static-sources/src/addrlookup.c
[2] http://notmuchmail.org/emacstips/

At any rate, a patch to that c file is below.  If you upgraded notmuch
and now addrlookup gives errors about not finding libnotmuch.so.2, this
patch might be what you need.





In the latest version of notmuch in git, notmuch_database_open returns a
status and takes what used to be the return value as a reference
parameter.  This patch adjusts code to pass the db pointer in a
parameter and accept the status as return value.  We don't do anything
with the status at present.

---
 addrlookup.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/addrlookup.c b/addrlookup.c
index 5f724ef..aed77e7 100644
--- a/addrlookup.c
+++ b/addrlookup.c
@@ -804,12 +804,14 @@ void address_matcher_run (AddressMatcher* self, const 
gchar* name) {
gchar** _result_;
gint _result__length1;
gint __result__size_;
+   notmuch_status_t status;
+
g_return_if_fail (self != NULL);
_tmp0_ = g_new0 (notmuch_query_t*, 0);
queries = _tmp0_;
queries_length1 = 0;
_queries_size_ = 0;
-   _tmp1_ = notmuch_database_open (self->priv->user_db_path, 
NOTMUCH_DATABASE_MODE_READ_ONLY);
+   status = notmuch_database_open (self->priv->user_db_path, 
NOTMUCH_DATABASE_MODE_READ_ONLY, &_tmp1_);
_notmuch_database_close0 (self->priv->db);
self->priv->db = _tmp1_;
_tmp2_ = g_strconcat ("tag:", self->priv->user_addrbook_tag, NULL);
-- 
1.7.10.4

-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20121031/2e2622ff/attachment.pgp>


[PATCH 2/2] emacs: Improve the regexp used to match id:'s in messages

2012-10-31 Thread Jani Nikula
On Wed, 31 Oct 2012, Austin Clements  wrote:
> This regexp agrees with Xapian query syntax much more closely, though
> we specifically disallow various cases that would be confusing in the
> context of an email body (e.g., punctuation at the end of an id: link
> is not considered part of the id: link because it's probably part of
> the surrounding text).
>
> In particular, this handles id: links that are not surrounded by
> quotes much better, which stash is much more likely to generate now
> that we don't quote id's that don't need to be quoted.  It also
> handles quoted id: links better.
>
> We update the buttonization test to reflect the new pattern.

Hi Austin, all of this looks good as-is, but I propose the changes below
on top. (With the relevant comment changed too.)

BR,
Jani.


diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index e96e099..117eb0e 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1005,7 +1005,7 @@ message at DEPTH in the current thread."
;; next space or ).  We disallow [.,;] as the last character
;; because these are probably part of the surrounding text, and not
;; part of the id.  This doesn't match single character ids; meh.
-   "\\|[^\"[:space:])][^[:space:])]*[^[:space:]).,;]"
+   "\\|[^\"[:space:])][^[:space:])]*[^])[:space:].,:;?!]"
"\\)")
   "The regexp used to match id: links in messages.")

diff --git a/test/emacs-show b/test/emacs-show
index e16483c..e2d7c70 100755
--- a/test/emacs-show
+++ b/test/emacs-show
@@ -109,7 +109,12 @@ test_expect_equal_file OUTPUT 
$EXPECTED/notmuch-show-indent-thread-content-off
 test_begin_subtest "id buttonization"
 add_message '[body]="
 id:abc
-id:abc.def. id:abc,def, id:abc;def;
+id:abc.def. id:abc,def, id:abc;def; id:abc:def:
+id:foo at bar.?baz? id:foo at bar!.baz!
+(id:foo at bar.baz) [id:foo at bar.baz]
+id:foo at bar.baz...
+id:2+2=5
+id:=_-:/.[]@$%+
 id:abc)def
 id:ab\"c def
 id:\"abc\"def
@@ -131,7 +136,12 @@ To: Notmuch Test Suite 
 Date: Fri, 05 Jan 2001 15:43:57 +

 <>
-<>. <>, <>;
+<>. <>, <>; <>:
+<>? <>!
+(<>) [<>]
+<>...
+<>

[PATCH v6 0/9] notmuch search date:since..until query support

2012-10-31 Thread Austin Clements
LGTM.

Quoth Jani Nikula on Oct 30 at 10:32 pm:
> Hi all, v6 of [1] with plenty of small changes addressing Austin's
> review [2], [3], [4], and [5]. See my replies to Austin for what I've
> agreed to change, and what I've chosen to ignore and why.
> 
> The single biggest change is the requirement to have some delimiter(s)
> between keywords, which allowed simplification of keyword
> matching. Consequently match_keyword() and parse_keyword() functions in
> patch 2/9 have changed considerably.
> 
> There are a few ways to examine the changes since v5. My public repo at
> [6] has branches topic-parse-time-string-v5 (rebased to master) and
> topic-parse-time-string-v6, and [7] should provide a fancy colorful diff
> between the two. The same but less fancy diff is also at the end of this
> cover letter.
> 
> Change by change commits to the parser and test tool can also be found
> at [8]. The source files there are copied verbatim to patches 2/9 and
> 3/9.


Re: [PATCH 2/2] emacs: Improve the regexp used to match id:'s in messages

2012-10-31 Thread Jani Nikula
On Wed, 31 Oct 2012, Austin Clements amdra...@mit.edu wrote:
 This regexp agrees with Xapian query syntax much more closely, though
 we specifically disallow various cases that would be confusing in the
 context of an email body (e.g., punctuation at the end of an id: link
 is not considered part of the id: link because it's probably part of
 the surrounding text).

 In particular, this handles id: links that are not surrounded by
 quotes much better, which stash is much more likely to generate now
 that we don't quote id's that don't need to be quoted.  It also
 handles quoted id: links better.

 We update the buttonization test to reflect the new pattern.

Hi Austin, all of this looks good as-is, but I propose the changes below
on top. (With the relevant comment changed too.)

BR,
Jani.


diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index e96e099..117eb0e 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1005,7 +1005,7 @@ message at DEPTH in the current thread.
;; next space or ).  We disallow [.,;] as the last character
;; because these are probably part of the surrounding text, and not
;; part of the id.  This doesn't match single character ids; meh.
-   \\|[^\[:space:])][^[:space:])]*[^[:space:]).,;]
+   \\|[^\[:space:])][^[:space:])]*[^])[:space:].,:;?!]
\\))
   The regexp used to match id: links in messages.)
 
diff --git a/test/emacs-show b/test/emacs-show
index e16483c..e2d7c70 100755
--- a/test/emacs-show
+++ b/test/emacs-show
@@ -109,7 +109,12 @@ test_expect_equal_file OUTPUT 
$EXPECTED/notmuch-show-indent-thread-content-off
 test_begin_subtest id buttonization
 add_message '[body]=
 id:abc
-id:abc.def. id:abc,def, id:abc;def;
+id:abc.def. id:abc,def, id:abc;def; id:abc:def:
+id:foo@bar.?baz? id:foo@bar!.baz!
+(id:f...@bar.baz) [id:f...@bar.baz]
+id:f...@bar.baz...
+id:2+2=5
+id:=_-:/.[]@$%+
 id:abc)def
 id:ab\c def
 id:\abc\def
@@ -131,7 +136,12 @@ To: Notmuch Test Suite test_su...@notmuchmail.org
 Date: Fri, 05 Jan 2001 15:43:57 +
 
 id:abc
-id:abc.def. id:abc,def, id:abc;def;
+id:abc.def. id:abc,def, id:abc;def; id:abc:def:
+id:foo@bar.?baz? id:foo@bar!.baz!
+(id:f...@bar.baz) [id:f...@bar.baz]
+id:f...@bar.baz...
+id:2+2=5
+id:=_-:/.[]@$%+
 id:abc)def
 id:abc def
 id:abcdef
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH v6 0/9] notmuch search date:since..until query support

2012-10-31 Thread Tomi Ollila
On Tue, Oct 30 2012, Jani Nikula j...@nikula.org wrote:

 Hi all, v6 of [1] with plenty of small changes addressing Austin's
 review [2], [3], [4], and [5]. See my replies to Austin for what I've
 agreed to change, and what I've chosen to ignore and why.

 The single biggest change is the requirement to have some delimiter(s)
 between keywords, which allowed simplification of keyword
 matching. Consequently match_keyword() and parse_keyword() functions in
 patch 2/9 have changed considerably.

 There are a few ways to examine the changes since v5. My public repo at
 [6] has branches topic-parse-time-string-v5 (rebased to master) and
 topic-parse-time-string-v6, and [7] should provide a fancy colorful diff
 between the two. The same but less fancy diff is also at the end of this
 cover letter.

 Change by change commits to the parser and test tool can also be found
 at [8]. The source files there are copied verbatim to patches 2/9 and
 3/9.

LGTM


 BR,
 Jani.


Tomi

 [1] id:cover.1350854171.git.j...@nikula.org
 [2] id:20121022081444.gm14...@mit.edu for patch 2/9
 [3] id:20121023042326.gp14...@mit.edu for patch 4/9
 [4] id:20121023045255.gq14...@mit.edu for patch 6/9
 [5] id:20121024210841.gu14...@mit.edu for patch 8/9
 [6] https://gitorious.org/jani/notmuch
 [7] 
 https://gitorious.org/jani/notmuch/commit/06c76eb4181bc88eccabc419c690046682125d7a/diffs/ef5e8d111748784433f4b80c9e5378f0c1a57319
 [8] https://gitorious.org/parse-time-string/parse-time-string

 Jani Nikula (9):
   build: drop the -Wswitch-enum warning
   parse-time-string: add a date/time parser to notmuch
   test: add new test tool parse-time for date/time parser
   test: add smoke tests for the date/time parser module
   build: build parse-time-string as part of the notmuch lib and static
 cli
   lib: add date range query support
   test: add tests for date:since..until range queries
   man: document the date:since..until range queries
   NEWS: date range search support

  Makefile  |2 +-
  Makefile.local|2 +-
  NEWS  |   12 +
  configure |2 +-
  lib/Makefile.local|3 +-
  lib/database-private.h|1 +
  lib/database.cc   |5 +
  lib/parse-time-vrp.cc |   61 ++
  lib/parse-time-vrp.h  |   40 +
  man/man7/notmuch-search-terms.7   |  150 +++-
  parse-time-string/Makefile|5 +
  parse-time-string/Makefile.local  |   12 +
  parse-time-string/README  |9 +
  parse-time-string/parse-time-string.c | 1503 
 +
  parse-time-string/parse-time-string.h |  102 +++
  test/Makefile.local   |7 +-
  test/basic|2 +-
  test/notmuch-test |2 +
  test/parse-time-string|   78 ++
  test/parse-time.c |  314 +++
  test/search-date  |   21 +
  21 files changed, 2315 insertions(+), 18 deletions(-)
  create mode 100644 lib/parse-time-vrp.cc
  create mode 100644 lib/parse-time-vrp.h
  create mode 100644 parse-time-string/Makefile
  create mode 100644 parse-time-string/Makefile.local
  create mode 100644 parse-time-string/README
  create mode 100644 parse-time-string/parse-time-string.c
  create mode 100644 parse-time-string/parse-time-string.h
  create mode 100755 test/parse-time-string
  create mode 100644 test/parse-time.c
  create mode 100755 test/search-date

 -- 
 1.7.10.4
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] fix notmuch_database_open call in addrlookup

2012-10-31 Thread James Vasile
What's the best way to submit changes to addrlookup?  Right now, it is
out of date vs the latest libnotmuch.  The addrlookup repo is vala code
but the wiki [1] points to a generated c file [2].

[1] http://github.com/spaetz/vala-notmuch/raw/static-sources/src/addrlookup.c
[2] http://notmuchmail.org/emacstips/

At any rate, a patch to that c file is below.  If you upgraded notmuch
and now addrlookup gives errors about not finding libnotmuch.so.2, this
patch might be what you need.





In the latest version of notmuch in git, notmuch_database_open returns a
status and takes what used to be the return value as a reference
parameter.  This patch adjusts code to pass the db pointer in a
parameter and accept the status as return value.  We don't do anything
with the status at present.

---
 addrlookup.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/addrlookup.c b/addrlookup.c
index 5f724ef..aed77e7 100644
--- a/addrlookup.c
+++ b/addrlookup.c
@@ -804,12 +804,14 @@ void address_matcher_run (AddressMatcher* self, const 
gchar* name) {
gchar** _result_;
gint _result__length1;
gint __result__size_;
+   notmuch_status_t status;
+
g_return_if_fail (self != NULL);
_tmp0_ = g_new0 (notmuch_query_t*, 0);
queries = _tmp0_;
queries_length1 = 0;
_queries_size_ = 0;
-   _tmp1_ = notmuch_database_open (self-priv-user_db_path, 
NOTMUCH_DATABASE_MODE_READ_ONLY);
+   status = notmuch_database_open (self-priv-user_db_path, 
NOTMUCH_DATABASE_MODE_READ_ONLY, _tmp1_);
_notmuch_database_close0 (self-priv-db);
self-priv-db = _tmp1_;
_tmp2_ = g_strconcat (tag:, self-priv-user_addrbook_tag, NULL);
-- 
1.7.10.4



pgpgsD2F4Z6Jo.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH v6 0/9] notmuch search date:since..until query support

2012-10-31 Thread David Bremner
Jani Nikula j...@nikula.org writes:

 Hi all, v6 of [1] with plenty of small changes addressing Austin's
 review [2], [3], [4], and [5]. See my replies to Austin for what I've
 agreed to change, and what I've chosen to ignore and why.


Pushed, (with patch 7 out of sequence, sorry about that).

David
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 1/1] emacs/notmuch-show.el: handle bodypart insert error

2012-10-31 Thread David Bremner
Tomi Ollila tomi.oll...@iki.fi writes:

 When inserting of email bodypart failes, insert a failure message
 to the buffer (and continue) instead of halting the insertion of
 the rest of that email thread in question.

I'm not totally sure about inserting error messages into the buffer, but
it seems like an improvement on what we have, so I'm untagging
needs-review.

Anybody who doesn't like it, speak up ;)

d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] emacs: Function to query the list of labels from a thread-id

2012-10-31 Thread Jani Nikula
On Wed, 31 Oct 2012, David Bremner da...@tethera.net wrote:
 Jani Nikula j...@nikula.org writes:

 Hi Damien, please send this patch as part of the series adding
 notmuch-labeler. Out of context, without adding any users of the
 function, it's a bit difficult to evaluate.

 For what it's worth (and I'm definitely not claiming any kind final word
 here) I did tell Damien that he was welcome to send pre-requisite
 patches in a seperate series.  Of course, if you feel like you can't
 really review what's there (or it's just too much work), that's your
 call.

I don't disagree with sending pre-requisite patches first. And I am
definitely not asking to polish all of the follow up work at once. I
should have made myself more clear about that. But I do think it would
be helpful to see what the added code will be used for. We may be able
to provide better and more productive review of the big picture, instead
of focusing on the details of the small snippet here.

BR,
Jani.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] Add NEWS information about Bcc header in JSON output

2012-10-31 Thread David Bremner
Michal Nazarewicz m...@google.com writes:

 From: Michal Nazarewicz min...@mina86.com

 This commit adds a note to the NEWS file about Bcc header now being
 available in the JSON output (and thus in Emacs) which has been
 implemented by commit ffb629cc5d2c2d1505eb5aefcf04fb4d0af6c0c8.
 ---

Thanks for that, but you seem to have an old version there; currently we
are adding news after 0.14. Do you mind updating? 

Thanks,

David
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch