[PATCH] emacs: restore tag-changes and query bindings for tag hooks

2021-05-04 Thread Kyle Meyer
Matt Lundin writes: > With the upgrade to notmuch 0.32, functions added to > 'notmuch-after-tag-hook' or 'notmuch-before-tag-hook' no longer have > access to the 'tag-changes' or 'query' variables advertised in the > docstrings of both hooks. If I try to access either variable in a hook >

Bug (emacs): lexical binding breaks tag hooks

2021-05-04 Thread Matt Lundin
With the upgrade to notmuch 0.32, functions added to 'notmuch-after-tag-hook' or 'notmuch-before-tag-hook' no longer have access to the 'tag-changes' or 'query' variables advertised in the docstrings of both hooks. If I try to access either variable in a hook function, emacs throws an error. I

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 the same though. Please

[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 +--

[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 +++---

[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 +++

[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

[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

[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