[PATCH] go: Update to the current notmuch_database_find_message API

2012-05-04 Thread David Bremner
Austin Clements  writes:

> The signature of notmuch_database_find_message was changed in 02a30767
> to report errors and the Go bindings were never updated.  This brings
> the Go bindings in sync with that change and at least makes them
> compile with Go r60.3, the last release before Go 1.

pushed.

d


Re: [PATCH] go: Update to the current notmuch_database_find_message API

2012-05-04 Thread David Bremner
Austin Clements  writes:

> The signature of notmuch_database_find_message was changed in 02a30767
> to report errors and the Go bindings were never updated.  This brings
> the Go bindings in sync with that change and at least makes them
> compile with Go r60.3, the last release before Go 1.

pushed.

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


[PATCH] go: Update to the current notmuch_database_find_message API

2012-04-30 Thread Sebastien Binet

Justus,

Justus Winter <4winter at informatik.uni-hamburg.de> writes:

> Quoting David Bremner (2012-04-30 13:53:47)
>> Austin Clements  writes:
>> 
>> > The signature of notmuch_database_find_message was changed in 02a30767
>> > to report errors and the Go bindings were never updated.  This brings
>> > the Go bindings in sync with that change and at least makes them
>> > compile with Go r60.3, the last release before Go 1.
>> 
>> I don't have any easy way to test this, since the current versions in 
>> Debian are all based on Go 1.  On the other hand I guess it doesn't make
>> things worse.  Anybody have any objections to this patch?
>
> lgtm.
>
>> In the long run we have to decide what to do about these bindings. Seb
>> (or anyone else) are you interested in porting them to Go 1 and
>> maintaining them?  Otherwise it may be time to deprecate them.
>
> I care enough for the go environment to keep the go bindings
> working. I've updated the bindings, the build infrastructure and the
> notmuch-addrlookup utility to go 1. I'll send a patch series as a
> followup that is meant to be applied upon Austins patch.
>
> The last patch in the series is a cleanup of the source code done with
> the gofmt utility. Go is somewhat strict in its coding conventions,
> but there is a utility that magically formats code. This makes the go
> code in the wild remarkably consistent. We should stick to the
> conventions too, hence this patch even if it breaks git blame
> somewhat.
>
> I haven't tested the bindings in depth, but the notmuch-addrlookup
> utility seems to be working fine.

kudos for picking this up.
I must say I don't use these go bindings in anger anymore: this was
mainly a test project for go.
(I am still a happy go user as well as a notmuch one, though, but I
prefer bbdb to notmuch-addrlookup)

-s

-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: 



[PATCH] go: Update to the current notmuch_database_find_message API

2012-04-30 Thread Justus Winter
Quoting David Bremner (2012-04-30 13:53:47)
> Austin Clements  writes:
> 
> > The signature of notmuch_database_find_message was changed in 02a30767
> > to report errors and the Go bindings were never updated.  This brings
> > the Go bindings in sync with that change and at least makes them
> > compile with Go r60.3, the last release before Go 1.
> 
> I don't have any easy way to test this, since the current versions in 
> Debian are all based on Go 1.  On the other hand I guess it doesn't make
> things worse.  Anybody have any objections to this patch?

lgtm.

> In the long run we have to decide what to do about these bindings. Seb
> (or anyone else) are you interested in porting them to Go 1 and
> maintaining them?  Otherwise it may be time to deprecate them.

I care enough for the go environment to keep the go bindings
working. I've updated the bindings, the build infrastructure and the
notmuch-addrlookup utility to go 1. I'll send a patch series as a
followup that is meant to be applied upon Austins patch.

The last patch in the series is a cleanup of the source code done with
the gofmt utility. Go is somewhat strict in its coding conventions,
but there is a utility that magically formats code. This makes the go
code in the wild remarkably consistent. We should stick to the
conventions too, hence this patch even if it breaks git blame
somewhat.

I haven't tested the bindings in depth, but the notmuch-addrlookup
utility seems to be working fine.

Cheers,
Justus


Re: [PATCH] go: Update to the current notmuch_database_find_message API

2012-04-30 Thread Sebastien Binet

Justus,

Justus Winter <4win...@informatik.uni-hamburg.de> writes:

> Quoting David Bremner (2012-04-30 13:53:47)
>> Austin Clements  writes:
>> 
>> > The signature of notmuch_database_find_message was changed in 02a30767
>> > to report errors and the Go bindings were never updated.  This brings
>> > the Go bindings in sync with that change and at least makes them
>> > compile with Go r60.3, the last release before Go 1.
>> 
>> I don't have any easy way to test this, since the current versions in 
>> Debian are all based on Go 1.  On the other hand I guess it doesn't make
>> things worse.  Anybody have any objections to this patch?
>
> lgtm.
>
>> In the long run we have to decide what to do about these bindings. Seb
>> (or anyone else) are you interested in porting them to Go 1 and
>> maintaining them?  Otherwise it may be time to deprecate them.
>
> I care enough for the go environment to keep the go bindings
> working. I've updated the bindings, the build infrastructure and the
> notmuch-addrlookup utility to go 1. I'll send a patch series as a
> followup that is meant to be applied upon Austins patch.
>
> The last patch in the series is a cleanup of the source code done with
> the gofmt utility. Go is somewhat strict in its coding conventions,
> but there is a utility that magically formats code. This makes the go
> code in the wild remarkably consistent. We should stick to the
> conventions too, hence this patch even if it breaks git blame
> somewhat.
>
> I haven't tested the bindings in depth, but the notmuch-addrlookup
> utility seems to be working fine.

kudos for picking this up.
I must say I don't use these go bindings in anger anymore: this was
mainly a test project for go.
(I am still a happy go user as well as a notmuch one, though, but I
prefer bbdb to notmuch-addrlookup)

-s



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


Re: [PATCH] go: Update to the current notmuch_database_find_message API

2012-04-30 Thread Justus Winter
Quoting David Bremner (2012-04-30 13:53:47)
> Austin Clements  writes:
> 
> > The signature of notmuch_database_find_message was changed in 02a30767
> > to report errors and the Go bindings were never updated.  This brings
> > the Go bindings in sync with that change and at least makes them
> > compile with Go r60.3, the last release before Go 1.
> 
> I don't have any easy way to test this, since the current versions in 
> Debian are all based on Go 1.  On the other hand I guess it doesn't make
> things worse.  Anybody have any objections to this patch?

lgtm.

> In the long run we have to decide what to do about these bindings. Seb
> (or anyone else) are you interested in porting them to Go 1 and
> maintaining them?  Otherwise it may be time to deprecate them.

I care enough for the go environment to keep the go bindings
working. I've updated the bindings, the build infrastructure and the
notmuch-addrlookup utility to go 1. I'll send a patch series as a
followup that is meant to be applied upon Austins patch.

The last patch in the series is a cleanup of the source code done with
the gofmt utility. Go is somewhat strict in its coding conventions,
but there is a utility that magically formats code. This makes the go
code in the wild remarkably consistent. We should stick to the
conventions too, hence this patch even if it breaks git blame
somewhat.

I haven't tested the bindings in depth, but the notmuch-addrlookup
utility seems to be working fine.

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


[PATCH] go: Update to the current notmuch_database_find_message API

2012-04-30 Thread David Bremner
Austin Clements  writes:

> The signature of notmuch_database_find_message was changed in 02a30767
> to report errors and the Go bindings were never updated.  This brings
> the Go bindings in sync with that change and at least makes them
> compile with Go r60.3, the last release before Go 1.

I don't have any easy way to test this, since the current versions in 
Debian are all based on Go 1.  On the other hand I guess it doesn't make
things worse.  Anybody have any objections to this patch?

In the long run we have to decide what to do about these bindings. Seb
(or anyone else) are you interested in porting them to Go 1 and
maintaining them?  Otherwise it may be time to deprecate them.

d


Re: [PATCH] go: Update to the current notmuch_database_find_message API

2012-04-30 Thread David Bremner
Austin Clements  writes:

> The signature of notmuch_database_find_message was changed in 02a30767
> to report errors and the Go bindings were never updated.  This brings
> the Go bindings in sync with that change and at least makes them
> compile with Go r60.3, the last release before Go 1.

I don't have any easy way to test this, since the current versions in 
Debian are all based on Go 1.  On the other hand I guess it doesn't make
things worse.  Anybody have any objections to this patch?

In the long run we have to decide what to do about these bindings. Seb
(or anyone else) are you interested in porting them to Go 1 and
maintaining them?  Otherwise it may be time to deprecate them.

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


[PATCH] go: Update to the current notmuch_database_find_message API

2012-04-28 Thread Austin Clements
The signature of notmuch_database_find_message was changed in 02a30767
to report errors and the Go bindings were never updated.  This brings
the Go bindings in sync with that change and at least makes them
compile with Go r60.3, the last release before Go 1.
---
 bindings/go/pkg/notmuch.go |   13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/bindings/go/pkg/notmuch.go b/bindings/go/pkg/notmuch.go
index c6844ef..8fe400b 100644
--- a/bindings/go/pkg/notmuch.go
+++ b/bindings/go/pkg/notmuch.go
@@ -306,20 +306,21 @@ func (self *Database) RemoveMessage(fname string) Status {
  * * An out-of-memory situation occurs
  * * A Xapian exception occurs
  */
-func (self *Database) FindMessage(message_id string) *Message {
+func (self *Database) FindMessage(message_id string) (*Message, Status) {

var c_msg_id *C.char = C.CString(message_id)
defer C.free(unsafe.Pointer(c_msg_id))

if c_msg_id == nil {
-   return nil
+   return nil, STATUS_OUT_OF_MEMORY
}

-   msg := C.notmuch_database_find_message(self.db, c_msg_id)
-   if msg == nil {
-   return nil
+   msg := &Message{message:nil}
+   st := Status(C.notmuch_database_find_message(self.db, c_msg_id, 
&msg.message))
+   if st != STATUS_SUCCESS {
+   return nil, st
}
-   return &Message{message:msg}
+   return msg, st
 }

 /* Return a list of all tags found in the database.
-- 
1.7.9.1



[PATCH] go: Update to the current notmuch_database_find_message API

2012-04-28 Thread Austin Clements
The signature of notmuch_database_find_message was changed in 02a30767
to report errors and the Go bindings were never updated.  This brings
the Go bindings in sync with that change and at least makes them
compile with Go r60.3, the last release before Go 1.
---
 bindings/go/pkg/notmuch.go |   13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/bindings/go/pkg/notmuch.go b/bindings/go/pkg/notmuch.go
index c6844ef..8fe400b 100644
--- a/bindings/go/pkg/notmuch.go
+++ b/bindings/go/pkg/notmuch.go
@@ -306,20 +306,21 @@ func (self *Database) RemoveMessage(fname string) Status {
  * * An out-of-memory situation occurs
  * * A Xapian exception occurs
  */
-func (self *Database) FindMessage(message_id string) *Message {
+func (self *Database) FindMessage(message_id string) (*Message, Status) {

var c_msg_id *C.char = C.CString(message_id)
defer C.free(unsafe.Pointer(c_msg_id))
 
if c_msg_id == nil {
-   return nil
+   return nil, STATUS_OUT_OF_MEMORY
}
 
-   msg := C.notmuch_database_find_message(self.db, c_msg_id)
-   if msg == nil {
-   return nil
+   msg := &Message{message:nil}
+   st := Status(C.notmuch_database_find_message(self.db, c_msg_id, 
&msg.message))
+   if st != STATUS_SUCCESS {
+   return nil, st
}
-   return &Message{message:msg}
+   return msg, st
 }
 
 /* Return a list of all tags found in the database.
-- 
1.7.9.1

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