About Archive Tags RSS Feed

 

Reflections on Lua-based email clients

2 June 2014 21:50

Until recently I was very happy with my console mail client, Lumail, thinking I'd written it in a flexible manner, with lots of Lua-callable primitives.

Now I'm beginning to suspect that I might have gone down the wrong path at some point.

The user interface, at startup consists of a list of mailboxes. The intention being that you select a mailbox, and open it. That then takes you to a list of messages. (There is a cool and simple to use option to open the union of multiple mailboxes, which is something I use daily.)

Now the list of mailboxes is sorted alphabetically, so the user interface looks something like this:

UI

Now the issue that triggered my rethink:

  • Can it be possible for Lua to sort the maildir list? So I could arbitrarily have the Maildir .people.katy at the top of the list, always?

Sure you think. It's just a list of strings. You could pass an array to a lua on_sort_maildirs function, and then use the returned array/table as teh display order. Simple.

Simple until you realize the user might want to do more than operate solely on the list of strings. Perhaps they wish to put folders with unread messages at the top. At which point you need a "count_unread( maildir )" function. (Which does exist.)

Anyway the realisation I had is that the CMaildir object, on the C++ side, isn't exposed to the Lua-side. So the (useful) member functions which should be exported/visible are not.

Really what I'm trying to say is that I think I've implemented and exported useful Lua primitives, but actually many more parts of the implementation could be usefully exported - but are not, and that comes from the choice I made to expose "things" not "objects". If I'd exposed objects right from the start I'd have been in a better place.

Oh well.

I continued to toy with a basic GUI mail-client last week, but I've pretty much written that off as a useful way to spend my time. For the moment I'll leave email alone, I've done enough and despite niggles what I have is absolutely the best mail client for me.

(It is a shame that Mutt is so heavyweight and hard to deal with, and that notmuch never really took off.)

| 3 comments

 

Comments on this entry

icon foo at 11:06 on 2 June 2014

Take a look at https://github.com/pazz/alot

icon David Edmondson at 13:56 on 2 June 2014
http://dme.org

Steve, as a notmuch user and some-time developer, I'm curious to know more about why you say that it "never really took off"?

icon Steve Kemp at 14:04 on 2 June 2014
http://steve.org.uk/.

I don't mean to slight notmuch, but I've always had the view that there were only two popular console mail clients - "mutt" and "pine".

Other clients seem to be less popular, by significant orders of magnitude. (Which is fine, so long as the users are happy, I understand that people get very very very attached to mail-clients.)

I like the idea of sup/notmuch, but in practice they never worked out for me, and I've heard that from others too.