[PATCH] emacs: functions to import sender or recipient into BBDB

2013-04-06 Thread David Bremner
David Bremner  writes:

> Daniel Bergey  writes:
>>
>> From a show buffer, notmuch-bbdb/snarf-from imports the sender into
>> bbdb.  notmuch-bbdb/snarf-to imports all recipients.  Newly imported
>> contacts are reported in the minibuffer / Messages buffer.
>>
>> Both functions use the BBDB parser to recognize email address formats.
>
> Pushed, 
>
> d

And reverted. It was causing a build failure.

d


Integrating notmuch with gnus?

2013-04-06 Thread Rainer M. Krug
Istvan Marko  writes:

> "Rainer M. Krug"  writes:
>
>> Hi
>>
>> I started using gnus for my emails, but definitely want to continue
>> using notmuch for indexing and searching.
>>
>> Is there a way of using notmuch as the search backend for gnus? Is
>> there more info around then on
>> http://www.emacswiki.org/emacs/NotMuch#toc1 ?
>
> nnir (gnus search backend) supports notmuch out of the box. If I
> remember right all you have to do is:
>
> (setq nnir-search-engine 'notmuch)
>
> Or customize nnir-method-default-engines.
<#secure method=pgpmime mode=sign>

Interesting - didn't fint that info in the manual, but I'll try it out -
would be reay brilliant if it worked.

Cheers,

Rainer

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  Rainer at krugs.de

Skype:  RMkrug


[PATCH] cli: mime node: fix compiler warning when building against gmime 2.4

2013-04-06 Thread Jani Nikula
commit d487ef9e58bcd193118f19f771d5ef3984616be5
Author: Jani Nikula 
Date:   Sat Mar 30 15:53:16 2013 +0200

cli: mime node: abstract decryption and signature verification

introduced a compiler warning, reported by Mark Walters, when building
against gmime 2.4:

mime-node.c:224:9: warning: assignment discards ?const? qualifier from
pointer target type [enabled by default]

Pass the non-const signature validity to the destructor to fix this.

---

Not even compile tested as I don't have gmime 2.4 on any
systems... Mark, please build and run the tests with this. Thanks.
---
 mime-node.c |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/mime-node.c b/mime-node.c
index 851f963..fd9e4a4 100644
--- a/mime-node.c
+++ b/mime-node.c
@@ -217,11 +217,12 @@ _signature_validity_free (GMimeSignatureValidity **proxy)

 /* Set up signature validity destructor (GMime 2.4) */
 static void
-set_signature_validity_destructor (mime_node_t *node)
+set_signature_validity_destructor (mime_node_t *node,
+  GMimeSignatureValidity *sig_validity)
 {
 GMimeSignatureValidity **proxy = talloc (node, GMimeSignatureValidity *);
 if (proxy) {
-   *proxy = node->sig_validity;
+   *proxy = sig_validity;
talloc_set_destructor (proxy, _signature_validity_free);
 }
 }
@@ -232,12 +233,14 @@ node_verify (mime_node_t *node, GMimeObject *part,
 notmuch_crypto_context_t *cryptoctx)
 {
 GError *err = NULL;
+GMimeSignatureValidity *sig_validity;

 node->verify_attempted = TRUE;
-node->sig_validity = g_mime_multipart_signed_verify
+sig_validity = g_mime_multipart_signed_verify
(GMIME_MULTIPART_SIGNED (part), cryptoctx, );
-if (node->sig_validity) {
-   set_signature_validity_destructor (node);
+node->sig_validity = sig_validity;
+if (sig_validity) {
+   set_signature_validity_destructor (node, sig_validity);
 } else {
fprintf (stderr, "Failed to verify signed part: %s\n",
 err ? err->message : "no error explanation given");
-- 
1.7.10.4



[PATCH] emacs: add missing paren to fix defun in notmuch-address.el.

2013-04-06 Thread Karl Fogel
This patch fixes a trivial missing-paren problem in notmuch-address.el
(and reindents the following defun accordingly).  I'm not subscribed
to this list, so please keep me CC'd on any followups.

Best,
-Karl

-- next part --
A non-text attachment was scrubbed...
Name: 0001-emacs-add-missing-paren-to-close-notmuch-bbdb-snarf-.patch
Type: text/x-diff
Size: 1620 bytes
Desc: Trivial fix to restore missing paren in notmuch-address.el.
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20130406/cbb9aa39/attachment.patch>


[PATCH] lib: Add a new prefix "list" to the search-terms syntax

2013-04-06 Thread David Bremner
"Alexey I. Froloff"  writes:
> +
> +/* Description may be RFC2047 encoded */
> +char *decoded_desc = g_mime_utils_header_decode_phrase(description);

Surprisingly, the docs claim g_mime_utils_header_decode_phrase has no
error conditions, so I guess this is OK.

> +
> +_notmuch_message_gen_terms(message, "list", list_id);
> +
> +if (decoded_desc)
> + _notmuch_message_gen_terms(message, "list", decoded_desc);
> 

On the other hand, _notmuch_message_gen_terms does return a status. I
agree that currently this status is not useful, but that could change in
the future.  I also agree that the existing code does the same thing in
a few places, but I think it's better not to introduce more.

We'll need a test or two before we introduce a core change.

Any objections to the list: syntax?  The only issue I see is that at
some point we will probably add a generic header search syntax, and this
implicitly says list-id is more important/common than other headers.

d




[PATCH 3/3] nmbug-status: only import notmuch when needed

2013-04-06 Thread David Bremner
Jani Nikula  writes:

> Make it possible to use the script to query search views without
> notmuch python bindings installed.

Pushed 2 and 3

d


[PATCH] emacs: functions to import sender or recipient into BBDB

2013-04-06 Thread David Bremner
Daniel Bergey  writes:
>
> From a show buffer, notmuch-bbdb/snarf-from imports the sender into
> bbdb.  notmuch-bbdb/snarf-to imports all recipients.  Newly imported
> contacts are reported in the minibuffer / Messages buffer.
>
> Both functions use the BBDB parser to recognize email address formats.

Pushed, 

d


Re: [PATCH 3/3] nmbug-status: only import notmuch when needed

2013-04-06 Thread David Bremner
Jani Nikula j...@nikula.org writes:

 Make it possible to use the script to query search views without
 notmuch python bindings installed.

Pushed 2 and 3

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


[PATCH] cli: mime node: fix compiler warning when building against gmime 2.4

2013-04-06 Thread Jani Nikula
commit d487ef9e58bcd193118f19f771d5ef3984616be5
Author: Jani Nikula j...@nikula.org
Date:   Sat Mar 30 15:53:16 2013 +0200

cli: mime node: abstract decryption and signature verification

introduced a compiler warning, reported by Mark Walters, when building
against gmime 2.4:

mime-node.c:224:9: warning: assignment discards ‘const’ qualifier from
pointer target type [enabled by default]

Pass the non-const signature validity to the destructor to fix this.

---

Not even compile tested as I don't have gmime 2.4 on any
systems... Mark, please build and run the tests with this. Thanks.
---
 mime-node.c |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/mime-node.c b/mime-node.c
index 851f963..fd9e4a4 100644
--- a/mime-node.c
+++ b/mime-node.c
@@ -217,11 +217,12 @@ _signature_validity_free (GMimeSignatureValidity **proxy)
 
 /* Set up signature validity destructor (GMime 2.4) */
 static void
-set_signature_validity_destructor (mime_node_t *node)
+set_signature_validity_destructor (mime_node_t *node,
+  GMimeSignatureValidity *sig_validity)
 {
 GMimeSignatureValidity **proxy = talloc (node, GMimeSignatureValidity *);
 if (proxy) {
-   *proxy = node-sig_validity;
+   *proxy = sig_validity;
talloc_set_destructor (proxy, _signature_validity_free);
 }
 }
@@ -232,12 +233,14 @@ node_verify (mime_node_t *node, GMimeObject *part,
 notmuch_crypto_context_t *cryptoctx)
 {
 GError *err = NULL;
+GMimeSignatureValidity *sig_validity;
 
 node-verify_attempted = TRUE;
-node-sig_validity = g_mime_multipart_signed_verify
+sig_validity = g_mime_multipart_signed_verify
(GMIME_MULTIPART_SIGNED (part), cryptoctx, err);
-if (node-sig_validity) {
-   set_signature_validity_destructor (node);
+node-sig_validity = sig_validity;
+if (sig_validity) {
+   set_signature_validity_destructor (node, sig_validity);
 } else {
fprintf (stderr, Failed to verify signed part: %s\n,
 err ? err-message : no error explanation given);
-- 
1.7.10.4

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


Re: [PATCH] lib: Add a new prefix list to the search-terms syntax

2013-04-06 Thread David Bremner
Alexey I. Froloff ra...@raorn.name writes:
 +
 +/* Description may be RFC2047 encoded */
 +char *decoded_desc = g_mime_utils_header_decode_phrase(description);

Surprisingly, the docs claim g_mime_utils_header_decode_phrase has no
error conditions, so I guess this is OK.

 +
 +_notmuch_message_gen_terms(message, list, list_id);
 +
 +if (decoded_desc)
 + _notmuch_message_gen_terms(message, list, decoded_desc);
 

On the other hand, _notmuch_message_gen_terms does return a status. I
agree that currently this status is not useful, but that could change in
the future.  I also agree that the existing code does the same thing in
a few places, but I think it's better not to introduce more.

We'll need a test or two before we introduce a core change.

Any objections to the list: syntax?  The only issue I see is that at
some point we will probably add a generic header search syntax, and this
implicitly says list-id is more important/common than other headers.

d


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


Re: Integrating notmuch with gnus?

2013-04-06 Thread Rainer M. Krug
Istvan Marko notm...@kismala.com writes:

 Rainer M. Krug rai...@krugs.de writes:

 Hi

 I started using gnus for my emails, but definitely want to continue
 using notmuch for indexing and searching.

 Is there a way of using notmuch as the search backend for gnus? Is
 there more info around then on
 http://www.emacswiki.org/emacs/NotMuch#toc1 ?

 nnir (gnus search backend) supports notmuch out of the box. If I
 remember right all you have to do is:

 (setq nnir-search-engine 'notmuch)

 Or customize nnir-method-default-engines.
#secure method=pgpmime mode=sign

Interesting - didn't fint that info in the manual, but I'll try it out -
would be reay brilliant if it worked.

Cheers,

Rainer

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

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


Re: [PATCH] emacs: functions to import sender or recipient into BBDB

2013-04-06 Thread David Bremner
David Bremner da...@tethera.net writes:

 Daniel Bergey ber...@alum.mit.edu writes:

 From a show buffer, notmuch-bbdb/snarf-from imports the sender into
 bbdb.  notmuch-bbdb/snarf-to imports all recipients.  Newly imported
 contacts are reported in the minibuffer / Messages buffer.

 Both functions use the BBDB parser to recognize email address formats.

 Pushed, 

 d

And reverted. It was causing a build failure.

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