[notmuch] Thoughts on notmuch and Lua

Subject: [notmuch] Thoughts on notmuch and Lua

Date: Thu, 14 Jan 2010 10:47:13 +0200

To: notmuch@notmuchmail.org

Cc:

From: Ali Polatel


Before trying to implement anything I decided to send a mail to the list
to ask people's opinion.

What's the problem?
===================
Notmuch isn't very configurable.

How can Lua integration solve this?
===================================
Here are initial thoughts on how to integrate Lua with notmuch.
Any comments appreciated.

1. Configuration file:
The configuration file can be a Lua script that allows more dynamic
configuration. Here's an example:

# notmuch configuration file:
config = {}
config.dbpath = "/path/to/maildir"
config.exclude = function (maildir)
    return not string.match(maildir, ".*Trash.*")
    end
...

2. Hooks:
This is a feature I really miss having switched from sup.
There can be many hooks, a hook that formats search output,
a hook that is called before adding messages to the database which may
be used to add initial tags depending on headers etc.

Why Lua?
========
Lua has many advantages over other scripting languages when it comes to
integration with a C program. It has a very clean and easy C API, the
overhead of running Lua scripts is not noticable among other things.

-- 
Regards,
Ali Polatel
part-000.sig (application/pgp-signature)

Thread: