Re: [PATCH 0/3] ruby: get rid of Tags object

2023-04-02 Thread Felipe Contreras
On Sun, Apr 2, 2023 at 5:18 PM David Bremner  wrote:
>
> Felipe Contreras  writes:
>
> > We don't need a Tags enumerable object only for a small number of strings, 
> > we
> > can just get them directly.
> >
> > This fixes an interaction problem where we might request two tags iterables
> > from the same message:
> >
> >   tags_0 = notmuch_message_get_tags(message);
>
> I have applied this series to master.
>
> By the way I noticed that the formatting of the old bindings code does
> not match the output of uncrustify -c ./devel/uncrustify/cfg $file.
> This is not a serious problem, but it does make the review process a bit
> noisy (since my clumsy script reformats every file touched by a given
> commit). Do you have any objection to my just going through and
> reformatting the bindings code with uncrustify at some point? It can be
> done as patches also, but it's a bit silly because there can be many
> small diffs.

I have no problem with changing the format either in one go or as
separate patches.

*Except* for `sp_not`: `if (! cond)` makes my eyes bleed. For me unary
operators act on the thing next to them, so a space before that makes
it less clear, not more.

Given that I'm the one that has worked on these bindings the most, and
probably will be the one that works on them the most in the future, I
would appreciate that small compromise on the coding style.

Cheers.

-- 
Felipe Contreras
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH 0/3] ruby: get rid of Tags object

2023-04-02 Thread David Bremner
Felipe Contreras  writes:

> We don't need a Tags enumerable object only for a small number of strings, we
> can just get them directly.
>
> This fixes an interaction problem where we might request two tags iterables
> from the same message:
>
>   tags_0 = notmuch_message_get_tags(message);

I have applied this series to master.

By the way I noticed that the formatting of the old bindings code does
not match the output of uncrustify -c ./devel/uncrustify/cfg $file.
This is not a serious problem, but it does make the review process a bit
noisy (since my clumsy script reformats every file touched by a given
commit). Do you have any objection to my just going through and
reformatting the bindings code with uncrustify at some point? It can be
done as patches also, but it's a bit silly because there can be many
small diffs.

d

___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[PATCH 0/3] ruby: get rid of Tags object

2023-03-22 Thread Felipe Contreras
We don't need a Tags enumerable object only for a small number of strings, we
can just get them directly.

This fixes an interaction problem where we might request two tags iterables
from the same message:

  tags_0 = notmuch_message_get_tags(message);
  // Store it for later
  tags_1 = notmuch_message_get_tags(message);
  // Traverse it

This iterator is meant to be transient and works only once, so we better just
iterate it once.

Felipe Contreras (3):
  ruby: add tags helper
  ruby: tags: return string array directly
  ruby: remove Tags object

 bindings/ruby/database.c |  2 +-
 bindings/ruby/defs.h |  6 +
 bindings/ruby/init.c | 14 ---
 bindings/ruby/message.c  |  2 +-
 bindings/ruby/messages.c |  2 +-
 bindings/ruby/tags.c | 54 
 bindings/ruby/thread.c   |  2 +-
 7 files changed, 10 insertions(+), 72 deletions(-)

-- 
2.39.2.13.g1fb56cf030

___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org