unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Ali Polatel <alip@exherbo.org>
To: Carl Worth <cworth@cworth.org>
Cc: martin f krafft <madduck@madduck.net>, notmuch@notmuchmail.org
Subject: Re: Thoughts on notmuch and Lua
Date: Fri, 15 Jan 2010 23:09:34 +0200	[thread overview]
Message-ID: <20100115210934.GA12515@harikalardiyari> (raw)
In-Reply-To: <87vdf3cd1y.fsf@yoom.home.cworth.org>

[-- Attachment #1: Type: text/plain, Size: 2418 bytes --]

Carl Worth yazmış:
> On Fri, 15 Jan 2010 13:16:00 +1300, martin f krafft <madduck@madduck.net> wrote:
> > Lua for hooks has the advantage that the hooks can be executed in
> > the context of manipulateable objects. On the other hand, hooks in
> > the style of run-parts directories are more flexible and accessible,
> > and could always be invoked as filters for the manipulateable data.
> 
> Good point.
> 
> One thing that notmuch has in its favor already is that there's a
> command-line interface that provides all of the interesting
> functionality. So it's already a fairly trivial matter to "hook" things
> like "notmuch new" by writing a script in whatever language you prefer
> to invoke things like "notmuch search" and "notmuch tag".
> 
> And that's what I'm doing already, (with a shell script), to tag
> newly-arrived messages.
> 
> The only part that's really missing here is a directory where scripts
> could be dropped in and get automatically invoked.
> 
> What do you think, Ali? Would an approach like that satisfy the things
> you had in mind for hooks?
> 

It might, here are some thoughts and questions to help you elaborate:

- How will these scripts manipulate data?
  e.g.: A "tagger" script may get the new mail from stdin and print out
  the new tags which notmuch will read and apply to the message.
  A "search-filter" script may get search results from stdin and filter
  them. Just my initial thoughts.

This script approach has both upsides and downsides. I have some
experience about this because I wrote a tool called mpdcron¹ which
executes hooks based on mpd events. First I thought it would be cool to
execute scripts based on events by passing data using environment
variables. However this approach didn't give hooks enough power to save
state information etc. so I decided to add module support through
GModule.

I may be going a bit off topic here but what I'm trying to explain is
scripts may not give power-users enough options and is practically
slower than having Lua, or another scripting language, support. In my
humble opinion the former is just a hack while the latter is the proper
way to do it.

P.S.: As I stated in the beginning you could have elaborated what you
meant by script support and I'm just commenting on what I've understood.

¹: http://alip.github.com/mpdcron/

> -Carl

-- 
Regards,
Ali Polatel

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2010-01-15 21:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-14  8:47 Thoughts on notmuch and Lua Ali Polatel
2010-01-14 23:00 ` Carl Worth
2010-01-15  0:16   ` martin f krafft
2010-01-15 20:45     ` Carl Worth
2010-01-15 21:09       ` Ali Polatel [this message]
2010-01-15 23:15         ` Carl Worth
2010-01-16 19:10           ` Ali Polatel
2010-01-16 20:18           ` inbox/unread tags for new messages [was: Re: Thoughts on notmuch and Lua] Jameson Rollins
2010-01-16 22:22             ` Carl Worth
2010-01-16 23:38               ` Jameson Rollins
2010-01-17  2:05                 ` Ben Gamari
2010-01-17  2:33                 ` Carl Worth
2010-01-17  7:05                   ` Jameson Rollins
  -- strict thread matches above, loose matches on Subject: below --
2010-01-16 10:11 Thoughts on notmuch and Lua Sebastian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100115210934.GA12515@harikalardiyari \
    --to=alip@exherbo.org \
    --cc=cworth@cworth.org \
    --cc=madduck@madduck.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).