Re: BUG: ruby segfault in notmuch_rb_tags_each

2023-03-22 Thread Felipe Contreras
least it can be reproduced! > > Pinging Felipe to see if he has any ideas. Gmail didn't raise this to my inbox. Great. -- Felipe Contreras ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org

Re: BUG: ruby segfault in notmuch_rb_tags_each

2023-03-22 Thread Felipe Contreras
you can try this workaround in the Message constructor of notmuch-vim: @tags = msg.tags.map(&:to_s) I'm attaching a simple script that reproduces the issue. Cheers. -- Felipe Contreras simple.rb Description: application/ruby ___ notmuch mailing

[PATCH 3/3] ruby: remove Tags object

2023-03-22 Thread Felipe Contreras
Not used anymore now that we return an array of strings directly. Signed-off-by: Felipe Contreras --- bindings/ruby/defs.h | 7 -- bindings/ruby/init.c | 14 --- bindings/ruby/tags.c | 55 3 files changed, 76 deletions(-) diff --git

[PATCH 2/3] ruby: tags: return string array directly

2023-03-22 Thread Felipe Contreras
Signed-off-by: Felipe Contreras --- bindings/ruby/tags.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bindings/ruby/tags.c b/bindings/ruby/tags.c index cc6ea59e..cad17d4c 100644 --- a/bindings/ruby/tags.c +++ b/bindings/ruby/tags.c @@ -23,7 +23,12 @@ VALUE

[PATCH 1/3] ruby: add tags helper

2023-03-22 Thread Felipe Contreras
Right now it doesn't do much, but it will help for further reorganization. Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 2 +- bindings/ruby/defs.h | 3 +++ bindings/ruby/message.c | 2 +- bindings/ruby/messages.c | 2 +- bindings/ruby/tags.c | 6 ++ bindings/ruby

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

2023-03-22 Thread Felipe Contreras
= 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

[PATCH v2] ruby: cleanup object_destroy()

2021-08-03 Thread Felipe Contreras
, so nothing was returned (void). All the destroy functions are void, and that's what we want. Signed-off-by: Felipe Contreras --- Rebased on top of latest master. bindings/ruby/defs.h | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bindings/ruby/defs.h b/bindings

Re: [ANN] notmuch-vim 0.7 released

2021-07-09 Thread Felipe Contreras
On Thu, Jul 8, 2021 at 12:51 AM Ralph Seichter wrote: > > * Felipe Contreras: > > > https://github.com/felipec/notmuch-vim > > > > I stopped working on it in 2014, but I'm back. > > Welcome back. This is an interesting plugin for sure. I'd like to > package

Re: [ANN] notmuch-vim 0.7 released

2021-07-09 Thread Felipe Contreras
Hi, On Fri, Jul 9, 2021 at 12:50 PM Steve Litt wrote: > Felipe Contreras said on Wed, 07 Jul 2021 23:21:42 -0500 > >notmuch-vim is a fully-functional mail user agent implemented in vim. > >It uses as inspiration other text-based MUAs such as mutt and sup, but > >it's bette

[ANN] notmuch-vim 0.7 released

2021-07-07 Thread Felipe Contreras
/felipec/notmuch-vim I stopped working on it in 2014, but I'm back. Enjoy. 4 Aaron Borden 27 Felipe Contreras 1 Franz Fellner 1 John Gliksberg 1 Jules Aguillon -- Felipe Contreras ___ notmuch mailing list -- notmuch

[PATCH 2/2] ruby: cleanup object_destroy()

2021-07-06 Thread Felipe Contreras
, so nothing was returned (void). All the destroy functions are void, and that's what we want. Signed-off-by: Felipe Contreras --- bindings/ruby/defs.h | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h index daac13ab..b3f0621c

[PATCH 1/2] ruby: split database close and destroy

2021-07-06 Thread Felipe Contreras
Mirrors the C API: 7864350c (Split notmuch_database_close into two functions, 2012-04-25). Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 19 ++- bindings/ruby/defs.h | 3 +++ bindings/ruby/init.c | 1 + 3 files changed, 22 insertions(+), 1 deletion

[PATCH 0/2] ruby: sync database close/destroy

2021-07-06 Thread Felipe Contreras
Sychronize with notmuch API, where notmuch_database_close is different from notmuch_database_destroy. At least since a long time ago. Felipe Contreras (2): ruby: split database close and destroy ruby: cleanup object_destroy() bindings/ruby/database.c | 19 ++- bindings/ruby

[PATCH v2 3/3] ruby: make db.config return an enumerator

2021-06-29 Thread Felipe Contreras
=> # This allows us to do: db.config.to_a db.config.to_h db.config.each { |k, v| ... } And of course what is already possible: db.config { |k, v| ... } Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bindings/r

[PATCH v2 2/3] ruby: add db.config

2021-06-29 Thread Felipe Contreras
In order to use notmuch_config_get_pairs. Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 31 +++ bindings/ruby/defs.h | 4 bindings/ruby/init.c | 1 + test/T395-ruby.sh| 8 4 files changed, 44 insertions(+) diff --git

[PATCH v2 1/3] ruby: add new Database.open_with_config

2021-06-29 Thread Felipe Contreras
In order to make use of notmuch_database_open_with_config. Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 62 bindings/ruby/defs.h | 6 bindings/ruby/init.c | 1 + test/T395-ruby.sh| 6 4 files changed, 75

[PATCH v2 0/3] ruby: add latest config API

2021-06-29 Thread Felipe Contreras
style update to one test. Felipe Contreras (3): ruby: add new Database.open_with_config ruby: add db.config ruby: make db.config return an enumerator bindings/ruby/database.c | 95 bindings/ruby/defs.h | 10 + bindings/ruby/init.c | 2

Re: [PATCH v2 1/2] ruby: add keyword arguments to db.query

2021-06-28 Thread Felipe Contreras
On Sun, Jun 27, 2021 at 12:18 PM David Bremner wrote: > > Felipe Contreras writes: > > > That way we don't need pass them to the query object ourselves. > > I have applied this change to master. As we discussed previously, I > prefer to leave the sort order explicit in

Re: [PATCH 1/3] ruby: add new Database.open_with_config

2021-06-27 Thread Felipe Contreras
On Sun, Jun 27, 2021 at 1:02 PM David Bremner wrote: > > Felipe Contreras writes: > > > +ret = notmuch_database_open_with_config (database_path, mode, > > + config_path, profile, , > > +

[PATCH] perf-test: fix for verbose

2021-06-26 Thread Felipe Contreras
Signed-off-by: Felipe Contreras --- I don't know how $verbose is supposed to be set, but when I manually did it didn't work. performance-test/perf-test-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/performance-test/perf-test-lib.sh b/performance-test/perf-test

[PATCH] perf-test: add ruby test

2021-06-26 Thread Felipe Contreras
Simply list the message-id of all the messages in a loop 100 times. Suggested-by: David Bremner Signed-off-by: Felipe Contreras --- performance-test/T05-ruby.sh | 24 1 file changed, 24 insertions(+) create mode 100755 performance-test/T05-ruby.sh diff --git

Re: [PATCH 2/2] ruby: enable garbage collection using talloc

2021-06-26 Thread Felipe Contreras
On Sat, Jun 26, 2021 at 2:54 PM David Bremner wrote: > > Felipe Contreras writes: > > >> > >> One issue to double check: in a few places we explicitely _don't_ use > >> talloc. What happens when those objects are passed to talloc_steal? > > &

Re: [PATCH 2/2] ruby: enable garbage collection using talloc

2021-06-26 Thread Felipe Contreras
On Fri, Jun 11, 2021 at 3:54 AM David Bremner wrote: > > David Bremner writes: > > > Felipe Contreras writes: > > > >> We basically steal all the objects from their notmuch parents, therefore > >> they are completely under Ruby's gc control. > >>

Re: [PATCH 2/2] ruby: enable garbage collection using talloc

2021-06-26 Thread Felipe Contreras
On Thu, Jun 10, 2021 at 7:46 PM David Bremner wrote: > > Felipe Contreras writes: > > > We basically steal all the objects from their notmuch parents, therefore > > they are completely under Ruby's gc control. > > > > The order at which these objects a

Re: [PATCH 3/3] test: ruby: simplify basic tests

2021-06-07 Thread Felipe Contreras
On Mon, Jun 7, 2021 at 6:53 PM David Bremner wrote: > > Felipe Contreras writes: > > >> > >> Is this assuming that the sort order in the CLI is the same as in the > >> library / bindings? that seems a bit fragile if so. > > > > Both the CLI and th

Re: How to recover from this permanent fatal error?

2021-06-07 Thread Felipe Contreras
Olly Betts wrote: > On Sun, Jun 06, 2021 at 07:48:39AM -0500, Felipe Contreras wrote: > > On Sun, Jun 6, 2021 at 5:08 AM Olly Betts wrote: > > > > > You could try commenting out the body of GlassTable::set_overwritten() > > > in xapian-core/backends/glass/glass_t

Re: How to recover from this permanent fatal error?

2021-06-06 Thread Felipe Contreras
lt-xapian-check: DatabaseError: Block 152676: used more than once in the Btree -- Felipe Contreras ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org

Re: How to recover from this permanent fatal error?

2021-06-05 Thread Felipe Contreras
On Sat, Jun 5, 2021 at 8:45 PM Olly Betts wrote: > > On Sat, Jun 05, 2021 at 09:39:28AM -0500, Felipe Contreras wrote: > > On Fri, Jun 4, 2021 at 9:43 PM Olly Betts wrote: > > > I'd suggest trying this simple tool I wrote that can probably rescue the > > > tags

Re: How to recover from this permanent fatal error?

2021-06-05 Thread Felipe Contreras
On Fri, Jun 4, 2021 at 9:43 PM Olly Betts wrote: > > On Fri, Jun 04, 2021 at 08:40:56PM -0500, Felipe Contreras wrote: > > On Fri, Jun 4, 2021 at 8:37 PM David Bremner wrote: > > > Felipe Contreras writes: > > > > > > I can't use notmuch anymore, I g

Re: [PATCH] completion: remove "setup" from the list of possible completions

2021-06-05 Thread Felipe Contreras
quot; is completed. The user can change this and show all commands with: zstyle ':completion:*:*:git:*' tag-order 'all-commands' So really, we can have the best of both worlds. All you have to do is decide what kind of configuration you want. Cheers. -- Felipe Contreras

Re: How to recover from this permanent fatal error?

2021-06-04 Thread Felipe Contreras
On Fri, Jun 4, 2021 at 8:37 PM David Bremner wrote: > Felipe Contreras writes: > > I can't use notmuch anymore, I get this error: > > > > A Xapian exception occurred opening database: The revision being read > > has been discarded - you should call Xapian::Datab

How to recover from this permanent fatal error?

2021-06-04 Thread Felipe Contreras
got the issue. All I can find about the issue is that somebody reported the exact same message to the mailing list (id:87txmb4xyz@mcs.anl.gov), but did not receive any feedback. Ideas? -- Felipe Contreras ___ notmuch mailing list -- notmuch

Re: [PATCH v2 0/2] ruby: improve db.query

2021-06-04 Thread Felipe Contreras
On Sun, May 23, 2021 at 9:19 PM Felipe Contreras wrote: > > I find it a bit annoying to have to modify the query object to add > options when Notmuch::Database.query() can do that just fine. > > This series also adds a mapping to the notmuch_exclude_t enum in order > to

Re: [PATCH 2/3] ruby: add db.config

2021-06-03 Thread Felipe Contreras
On Thu, Jun 3, 2021 at 10:29 PM Felipe Contreras wrote: > --- a/test/T395-ruby.sh > +++ b/test/T395-ruby.sh > @@ -88,4 +88,11 @@ test_ruby < puts Notmuch::Database.open_with_config.path > EOF > > +test_begin_subtest "config" > +notmuch config list |

[PATCH 3/3] ruby: make db.config return an enumerator

2021-06-03 Thread Felipe Contreras
=> # This allows us to do: db.config.to_a db.config.to_h db.config.each { |k, v| ... } And of course what is already possible: db.config { |k, v| ... } Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bindings/r

[PATCH 2/3] ruby: add db.config

2021-06-03 Thread Felipe Contreras
In order to use notmuch_config_get_pairs. Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 31 +++ bindings/ruby/defs.h | 4 bindings/ruby/init.c | 1 + test/T395-ruby.sh| 7 +++ 4 files changed, 43 insertions(+) diff --git

[PATCH 1/3] ruby: add new Database.open_with_config

2021-06-03 Thread Felipe Contreras
In order to make use of notmuch_database_open_with_config. Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 62 bindings/ruby/defs.h | 6 bindings/ruby/init.c | 1 + test/T395-ruby.sh| 6 4 files changed, 75

[PATCH 0/3] ruby: add latest config API

2021-06-03 Thread Felipe Contreras
and it's not too overly complicated, the notmuch API already has much better constucts. This patch series allows the user to simply do: $db = Notmuch::Database.open_with_config $config = $db.config.to_h And much more. Felipe Contreras (3): ruby: add new Database.open_with_config ruby: add

Re: [PATCH 0/2] ruby: enable garbage collection

2021-05-27 Thread Felipe Contreras
On Sat, May 22, 2021 at 5:49 AM David Bremner wrote: > > Felipe Contreras writes: > > > Ruby is a gc language, we shouldn't be doing workaround to free memory when > > Ruby is perfectly > > capable of doing so. > > > > The problem is that talloc want

Re: [PATCH v3] test: replace notmuch_passwd_sanitize() with _libconfig_sanitize()

2021-05-23 Thread Felipe Contreras
On Fri, May 21, 2021 at 1:22 PM Tomi Ollila wrote: > > On Fri, May 21 2021, Felipe Contreras wrote: > > > On Thu, May 20, 2021 at 2:43 AM Tomi Ollila wrote: > >> > >> On Wed, May 19 2021, Felipe Contreras wrote: > >> > >> > On Wed, May 19, 20

Re: [PATCH 2/3] ruby: add keyword arguments to db.query

2021-05-23 Thread Felipe Contreras
On Sun, May 23, 2021 at 7:29 AM David Bremner wrote: > > Felipe Contreras writes: > > > That way we don't need pass them to the query object ourselves. > > LGTM, but when I tried to resolve the conflicts I messed something up > and the ruby sort test(s) started failing.

[PATCH v2 2/2] test: ruby: simplify basic tests

2021-05-23 Thread Felipe Contreras
We don't need to check for the order here, that is done in another test. Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index e828efed..9298bc9e 100755 --- a/test/T395

[PATCH v2 1/2] ruby: add keyword arguments to db.query

2021-05-23 Thread Felipe Contreras
That way we don't need pass them to the query object ourselves. Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 47 +--- bindings/ruby/defs.h | 2 +- bindings/ruby/init.c | 2 +- test/T395-ruby.sh| 18 +++ 4 files

[PATCH v2 0/2] ruby: improve db.query

2021-05-23 Thread Felipe Contreras
on master of May 23. Felipe Contreras (2): ruby: add keyword arguments to db.query test: ruby: simplify basic tests bindings/ruby/database.c | 47 +--- bindings/ruby/defs.h | 2 +- bindings/ruby/init.c | 2 +- test/T395-ruby.sh| 30

Re: [PATCH 3/3] test: ruby: simplify basic tests

2021-05-23 Thread Felipe Contreras
On Sun, May 23, 2021 at 7:32 AM David Bremner wrote: > > Felipe Contreras writes: > > > We don't need to check for the order here, that is done in another test. > > > > Signed-off-by: Felipe Contreras > > --- > > test/T395-ruby.sh | 12

Re: [PATCH v3] test: replace notmuch_passwd_sanitize() with _libconfig_sanitize()

2021-05-21 Thread Felipe Contreras
On Thu, May 20, 2021 at 2:43 AM Tomi Ollila wrote: > > On Wed, May 19 2021, Felipe Contreras wrote: > > > On Wed, May 19, 2021 at 12:34 PM Tomi Ollila wrote: > > > >> Haha, as we do _libconfig_sanitize < OUTPUT > OUTPUT.clean > >> reading python sc

Re: [PATCH v3] test: replace notmuch_passwd_sanitize() with _libconfig_sanitize()

2021-05-19 Thread Felipe Contreras
On Wed, May 19, 2021 at 12:34 PM Tomi Ollila wrote: > Haha, as we do _libconfig_sanitize < OUTPUT > OUTPUT.clean > reading python script from stdin don't work (perl has __DATA__ ;). > (bitten again, I did and tested the change... :D). That can be fixed with: python /dev/fd/3 3<

Re: [PATCH v3] test: replace notmuch_passwd_sanitize() with _libconfig_sanitize()

2021-05-19 Thread Felipe Contreras
l = l.replace(".(none)", "", 1).replace(".localdomain", "", 1) > +elif l[:3] == "a: ": > +sq = chr(39) # single quote > +l = l.replace(sq + name, sq + "USER_FULL_NAME", 1) Then we can simply do: l.replace("'" + name, "'USER_FULL_NAME", 1) The rest looks fine to me. -- Felipe Contreras ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org

Re: [PATCH v2] test: replace notmuch_passwd_sanitize() with _libconfig_sanitize()

2021-05-17 Thread Felipe Contreras
to check for that, even better if we generate the proper output: if name: l = l.replace(name, "USER_FULL_NAME") else: l = "a: \'USER_FULL_NAME\'\\n" This makes the test pass with no geckos name, but we need to use bash strings: $'string'. Otherwise we would need to do something much more weird. Cheers. -- Felipe Contreras ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org

[PATCH 1/2] ruby: create an actual wrapper struct

2021-05-17 Thread Felipe Contreras
pointer (e.g. notmuch_database_t). This struct is tied to the Ruby object, and is freed when the Ruby object is freed by the garbage collector. We do nothing with this wrapper, so no functionality should be changed. Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 2 +- bindings

[PATCH 2/2] ruby: enable garbage collection using talloc

2021-05-17 Thread Felipe Contreras
. Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 2 +- bindings/ruby/defs.h | 11 +++ bindings/ruby/extconf.rb | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c index 66100de2..3737be17 100644

[PATCH 0/2] ruby: enable garbage collection

2021-05-17 Thread Felipe Contreras
conclussion. On the other hand the talloc_steal approach works perfectly fine. Felipe Contreras (2): ruby: create an actual wrapper struct ruby: enable garbage collection using talloc bindings/ruby/database.c | 2 +- bindings/ruby/defs.h | 42 +++- bindings

Re: [PATCH] ruby: improve compilation with CFLAGS

2021-05-16 Thread Felipe Contreras
On Mon, May 17, 2021 at 12:48 AM Felipe Contreras wrote: > > The ruby MakeMakefile generates a makefile that is suboptimal, which has > CFLAGS like this: > > CFLAGS = $(CCDLFLAGS) -march=x86-64 -mtune=generic \ > -O2 -pipe -fno-plt -fPIC $(ARCH_FLAG) > > This w

[PATCH] ruby: improve compilation with CFLAGS

2021-05-16 Thread Felipe Contreras
the necessary flags in the parent Makefile so everyone is happy. Signed-off-by: Felipe Contreras --- bindings/Makefile.local | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/Makefile.local b/bindings/Makefile.local index bc960bbc..3672e69f 100644 --- a/bindings

[PATCH v2 6/6] test: split emacs functionality to its own file

2021-05-15 Thread Felipe Contreras
This way it's easier to identify the tests that do require emacs stuff. Signed-off-by: Felipe Contreras --- test/T160-json.sh | 1 + test/T170-sexp.sh | 1 + test/T310-emacs.sh | 1 + test/T320-emacs-large-search-buffer.sh

[PATCH v2 5/6] test: emacs: fix a couple of shellcheck complaints

2021-05-15 Thread Felipe Contreras
sh line 21: test_require_external_prereq ${TEST_EMACSCLIENT} || ret=1 ^-^ SC2086: Double quote to prevent globbing and word splitting. Did you mean: test_require_external_prereq "${TEST_EMACSCLIENT}" || ret=1 Signed-off-by: Felipe

[PATCH v2 4/6] test: emacs: check for configured emacs

2021-05-15 Thread Felipe Contreras
Commit d59d9c81 (test: Make the emacsclient binary user-configurable, 2012-11-27) modified the prereq check for the configured emacsclient, but we probably want to do the same for emacs itself. Signed-off-by: Felipe Contreras --- test/test-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v2 3/6] test: emacs: simplify missing dependencies check

2021-05-15 Thread Felipe Contreras
No functional changes. Signed-off-by: Felipe Contreras --- test/test-lib.sh | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index c1395c87..e1a597f7 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -115,9 +115,11

[PATCH v2 1/6] test: trivial style cleanups

2021-05-15 Thread Felipe Contreras
Signed-off-by: Felipe Contreras --- test/T000-basic.sh | 2 +- test/T070-insert.sh | 2 +- test/T590-thread-breakage.sh | 10 +- test/export-dirs.sh | 2 +- test/test-lib.sh | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff

[PATCH v2 0/6] test: several cleanups

2021-05-15 Thread Felipe Contreras
. Felipe Contreras (6): test: trivial style cleanups test: more style fixes test: emacs: simplify missing dependencies check test: emacs: check for configured emacs test: emacs: fix a couple of shellcheck complaints test: split emacs functionality to its own file test/T000-basic.sh

[PATCH v2 2/6] test: more style fixes

2021-05-15 Thread Felipe Contreras
In order to fit the git coding style. Signed-off-by: Felipe Contreras --- test/T140-excludes.sh | 3 +- test/T190-multipart.sh | 3 +- test/T490-parse-time-string.sh | 6 +-- test/export-dirs.sh| 3 +- test/test-lib-common.sh| 6 +-- test/test-lib.sh

Re: [PATCH v2 10/10] ruby: new notmuch_rb_object_destroy() helper

2021-05-12 Thread Felipe Contreras
On Wed, May 12, 2021 at 5:10 PM David Bremner wrote: > > Felipe Contreras writes: > > > +static inline notmuch_status_t > > +notmuch_rb_object_destroy (VALUE rb_object, const rb_data_type_t *type) > > +{ > > +void *nm_obje

Re: [PATCH v2 08/10] ruby: move towards more modern RTypedData

2021-05-12 Thread Felipe Contreras
Struct, and the information is stored in a struct rb_data_type_t, rather than passed as arguments. Check_Type is replaced with Check_TypedStruct, which is a wrapper for rb_check_typeddata (with casts). -- Felipe Contreras ___ notmuch mailing list -- notmuch@notmuchma

Re: [PATCH v2 04/10] ruby: simplify data get helper

2021-05-12 Thread Felipe Contreras
On Wed, May 12, 2021 at 4:59 PM David Bremner wrote: > > Felipe Contreras writes: > > > The type is not actually needed. > > > > Signed-off-by: Felipe Contreras > > --- > > bindings/ruby/defs.h | 22 +++--- > > 1 file changed, 1

Re: Is there a reason why the trashed flag is not synced?

2021-05-12 Thread Felipe Contreras
hed flag in IMAP. I'm not actually deleting anything, I just don't want to see those messages in my notmuch client (thanks to excluded_tags). -- Felipe Contreras ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org

Re: Is there a reason why the trashed flag is not synced?

2021-05-09 Thread Felipe Contreras
On Sun, May 9, 2021 at 4:38 AM David Bremner wrote: > Felipe Contreras writes: > > I understand deleting files is complex, but what's wrong with simply > > tagging the T (trashed) messages as 'deleted'? > > > > I'm using synchronize_flags=true. > > Th

Re: nmbug update

2021-05-08 Thread Felipe Contreras
then > let me know and I can provide you with a copy of the current source. Would you consider moving to a different web framework? If so, I could take a bite creating such a site, except probably with a Ruby framework. Cheers. -- Felipe Contreras ___

Re: The future of Ruby bindings

2021-05-08 Thread Felipe Contreras
On Fri, Apr 30, 2021 at 5:14 PM Felipe Contreras wrote: > I understand why Ali Polatel did commit c7893408 (ruby: Kill garbage > collection related cruft., 2010-05-26); because the order of the object > destruction cannot be ensured in Ruby, however, there's ways to > workaround that

Re: [PATCH v2 00/10] ruby: object cleanups

2021-05-04 Thread Felipe Contreras
On Tue, May 4, 2021 at 3:17 AM Felipe Contreras wrote: > > This superseeds my previous series [1] with much more cleanups. > > An important new change is the move towards RTypedData, which is way superior > to the old RData > objects. > > Everything should work basically

[PATCH v2 10/10] ruby: new notmuch_rb_object_destroy() helper

2021-05-04 Thread Felipe Contreras
Using the rb_data_type_t data we can call the correct notmuch destroy function. Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 6 +- bindings/ruby/defs.h | 14 ++ bindings/ruby/directory.c | 7 +-- bindings/ruby/filenames.c | 7 +-- bindings/ruby

[PATCH v2 09/10] ruby: add all data types

2021-05-04 Thread Felipe Contreras
Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 16 bindings/ruby/defs.h | 37 +++-- bindings/ruby/directory.c | 4 ++-- bindings/ruby/init.c | 16 bindings/ruby/message.c | 6 +++--- bindings/ruby

[PATCH v2 08/10] ruby: move towards more modern RTypedData

2021-05-04 Thread Felipe Contreras
Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 2 +- bindings/ruby/defs.h | 6 -- bindings/ruby/init.c | 4 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c index b9ad3373..bb4273e6 100644

[PATCH v2 07/10] ruby: create Data_Wrap_Notmuch_Object helper

2021-05-04 Thread Felipe Contreras
This makes the code more maintainable and will help in further patches. No functional changes. Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 14 +++--- bindings/ruby/defs.h | 3 +++ bindings/ruby/directory.c | 4 ++-- bindings/ruby/message.c | 6

[PATCH v2 06/10] ruby: add unlikely hint

2021-05-04 Thread Felipe Contreras
The error path is very unlikely. Signed-off-by: Felipe Contreras --- bindings/ruby/defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h index ae3ea101..12538a3a 100644 --- a/bindings/ruby/defs.h +++ b/bindings/ruby/defs.h

[PATCH v2 05/10] ruby: fetch class name in case of error

2021-05-04 Thread Felipe Contreras
There is not much point in complicating the code for error messages that can be easily constructed. Before: database closed (RuntimeError) After: Notmuch::Database object destroyed (RuntimeError) Signed-off-by: Felipe Contreras --- bindings/ruby/defs.h | 30

[PATCH v2 04/10] ruby: simplify data get helper

2021-05-04 Thread Felipe Contreras
The type is not actually needed. Signed-off-by: Felipe Contreras --- bindings/ruby/defs.h | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h index 46e2caf8..8fb47b4c 100644 --- a/bindings/ruby/defs.h +++ b

[PATCH v2 03/10] ruby: improve general data get helper

2021-05-04 Thread Felipe Contreras
There's no need to do Check_Type, Data_Get_Struct calls rb_data_object_get(), which already does that. Signed-off-by: Felipe Contreras --- bindings/ruby/defs.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h index e95ea239

[PATCH v2 02/10] ruby: improve all Data_Get_Notmuch_* helpers

2021-05-04 Thread Felipe Contreras
There's no need to repeat the same code over and over. Signed-off-by: Felipe Contreras --- bindings/ruby/defs.h | 81 1 file changed, 22 insertions(+), 59 deletions(-) diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h index 48544ca2..e95ea239

[PATCH v2 01/10] ruby: add missing Data_Get_Notmuch helpers

2021-05-04 Thread Felipe Contreras
Apparently commit 5c9e3855 (ruby: Don't barf if an object is destroyed more than once, 2010-05-26) missed these two. Signed-off-by: Felipe Contreras --- bindings/ruby/directory.c | 2 +- bindings/ruby/threads.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings

[PATCH v2 00/10] ruby: object cleanups

2021-05-04 Thread Felipe Contreras
This superseeds my previous series [1] with much more cleanups. An important new change is the move towards RTypedData, which is way superior to the old RData objects. Everything should work basically the same though. [1] id: 20210503075457.649056-1-felipe.contre...@gmail.com Felipe Contreras

[PATCH 3/3] ruby: simplify data get helper

2021-05-03 Thread Felipe Contreras
The type is not actually needed. Signed-off-by: Felipe Contreras --- bindings/ruby/defs.h | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h index 46e2caf8..edbcc729 100644 --- a/bindings/ruby/defs.h +++ b

[PATCH 1/3] ruby: improve all Data_Get_Notmuch_* helpers

2021-05-03 Thread Felipe Contreras
There's no need to repeat the same code over and over. Signed-off-by: Felipe Contreras --- bindings/ruby/defs.h | 81 1 file changed, 22 insertions(+), 59 deletions(-) diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h index 48544ca2..e95ea239

[PATCH 0/3] ruby: cleanups

2021-05-03 Thread Felipe Contreras
This are simple cleanups that should not have any functional changes. Felipe Contreras (3): ruby: improve all Data_Get_Notmuch_* helpers ruby: improve general data get helper ruby: simplify data get helper bindings/ruby/defs.h | 84 1 file

[PATCH 2/3] ruby: improve general data get helper

2021-05-03 Thread Felipe Contreras
There's no need to do Check_Type, Data_Get_Struct calls rb_data_object_get(), which already does that. Signed-off-by: Felipe Contreras --- bindings/ruby/defs.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h index e95ea239

Re: [PATCH 5/9] test: ruby: simplify test_ruby()

2021-05-02 Thread Felipe Contreras
On Sun, May 2, 2021 at 6:02 AM David Bremner wrote: > > Felipe Contreras writes: > > > We always do test_expect_equal_file, so do it in test_ruby() directly. > > > > The only subtest where we don't (get non-existent file) can be easily > > modified. > >

Re: [PATCH] Vim: Fix a deprecated call to the 'mail' gem

2021-05-02 Thread Felipe Contreras
eld to Mail::Field.new is deprecated and will > >> be removed in Mail 2.8.0. Use Mail::Field.parse instead. > > I believe this problem was fixed in a different way by Felipe's patch > applied as 8af4cd16 Indeed, but Jules' patch may be a bett

[PATCH 2/3] ruby: add keyword arguments to db.query

2021-05-01 Thread Felipe Contreras
That way we don't need pass them to the query object ourselves. Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 47 +--- bindings/ruby/defs.h | 2 +- bindings/ruby/init.c | 2 +- test/T395-ruby.sh| 18 +++ 4 files

[PATCH 3/3] test: ruby: simplify basic tests

2021-05-01 Thread Felipe Contreras
We don't need to check for the order here, that is done in another test. Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index e828efed..9298bc9e 100755 --- a/test/T395

[PATCH 1/3] ruby: use notmuch_exclude_t enum

2021-05-01 Thread Felipe Contreras
It exists since 2013, let's allow it to be used in Ruby. Signed-off-by: Felipe Contreras --- bindings/ruby/init.c | 24 bindings/ruby/query.c | 8 +--- test/T395-ruby.sh | 17 + 3 files changed, 46 insertions(+), 3 deletions(-) diff --git

[PATCH 0/3] ruby: improve db.query

2021-05-01 Thread Felipe Contreras
test cleanups [1]. [1] id:20210501115923.483816-1-felipe.contre...@gmail.com Felipe Contreras (3): ruby: use notmuch_exclude_t enum ruby: add keyword arguments to db.query test: ruby: simplify basic tests bindings/ruby/database.c | 47 +--- bindings/ruby

[PATCH 9/9] test: ruby: simplify output comparison

2021-05-01 Thread Felipe Contreras
Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index 30168109..597330d3 100755 --- a/test/T395-ruby.sh +++ b/test/T395-ruby.sh @@ -20,22 +20,22 @@ test_ruby

[PATCH 8/9] test: ruby: don't use instance variables

2021-05-01 Thread Felipe Contreras
Local variables are perfectly fine. Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index f5a8d245..30168109 100755 --- a/test/T395-ruby.sh +++ b/test/T395

[PATCH 7/9] test: ruby: use much more standard Ruby idioms

2021-05-01 Thread Felipe Contreras
Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index f871ddd9..f5a8d245 100755 --- a/test/T395-ruby.sh +++ b/test/T395-ruby.sh @@ -24,7 +24,7 @@ notmuch search

[PATCH 6/9] test: ruby: use much more standard puts

2021-05-01 Thread Felipe Contreras
Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index 55bf4c2b..f871ddd9 100755 --- a/test/T395-ruby.sh +++ b/test/T395-ruby.sh @@ -25,7 +25,7 @@ test_ruby <<&qu

[PATCH 5/9] test: ruby: simplify test_ruby()

2021-05-01 Thread Felipe Contreras
We always do test_expect_equal_file, so do it in test_ruby() directly. The only subtest where we don't (get non-existent file) can be easily modified. Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git

[PATCH 0/9] test: ruby: several cleanups and simplifications

2021-05-01 Thread Felipe Contreras
I found a lot of areas of improvement in the Ruby tests, so I decided to clean them up. With these changes the tests are now much simpler and follow more closely the typical Ruby idioms. Felipe Contreras (9): test: move test_ruby() inside the only client test: ruby: refactor test_ruby

[PATCH 3/9] test: ruby: simplify MAIL_DIR check

2021-05-01 Thread Felipe Contreras
Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index 1d27e191..94fab106 100755 --- a/test/T395-ruby.sh +++ b/test/T395-ruby.sh @@ -12,10 +12,7 @@ test_ruby() { ( cat

[PATCH 2/9] test: ruby: refactor test_ruby()

2021-05-01 Thread Felipe Contreras
There's no point in repeating the same initialization in all the tests. Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 48 +++ 1 file changed, 11 insertions(+), 37 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index

[PATCH 4/9] test: ruby: simplify MAIL_DIR initialization

2021-05-01 Thread Felipe Contreras
There's no need to complicate the script passing the MAIL_DIR environment variable. Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index 94fab106..67d6e205 100755 --- a/test

[PATCH 1/9] test: move test_ruby() inside the only client

2021-05-01 Thread Felipe Contreras
Not much point in polluting the main library, and also will be useful to modify it in tandem with the tests. Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 4 test/test-lib.sh | 4 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395

  1   2   3   4   5   6   >