From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 1A101431FBC for ; Fri, 15 Jan 2010 13:09:40 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.437 X-Spam-Level: X-Spam-Status: No, score=-0.437 tagged_above=-999 required=5 tests=[AWL=-0.438, BAYES_50=0.001] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KnJtR571EogJ for ; Fri, 15 Jan 2010 13:09:39 -0800 (PST) Received: from mail-ew0-f220.google.com (mail-ew0-f220.google.com [209.85.219.220]) by olra.theworths.org (Postfix) with ESMTP id D3FF6431FAE for ; Fri, 15 Jan 2010 13:09:38 -0800 (PST) Received: by ewy20 with SMTP id 20so1245392ewy.0 for ; Fri, 15 Jan 2010 13:09:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=N6cR5qPJfpap3vI3uA5x+iCBLowF1UgnlU00Al3Ssqc=; b=U5Zn+FmrNbWDK2IRBNiLaL6ixo6G9WxubtltS4gMFJ/GqZW7V0lT/J0W6HNLGTfrp8 Wugm6INnPGeU6yrYVfIlL9csrxJtB14K9XjmE0r9ROgKSCGrcCe+AVC06aExQqAEzPtd Rij/4oapgkiR9ecaCPopAypYoAHTzKMUoVzCo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=eyWHW9KC4qX8ajjuBhJBLFWOmppqwjP9jKvErL6bemaiQwQe87P1QUvaVSH4iVzQnI xM4Cp+6U0Ec1XY0IM0y7Nl57E+sMR3LHCVM/HlO008AG/fAKWY3phAIvH8SXh9fW044N DBjeWu5X9I/6v6Q+LjDPZbdvewotoJBmtCTp8= Received: by 10.213.1.131 with SMTP id 3mr1829117ebf.34.1263589777895; Fri, 15 Jan 2010 13:09:37 -0800 (PST) Received: from harikalardiyari ([78.179.35.14]) by mx.google.com with ESMTPS id 13sm1793302ewy.1.2010.01.15.13.09.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 15 Jan 2010 13:09:37 -0800 (PST) Sender: Ali Polatel Date: Fri, 15 Jan 2010 23:09:34 +0200 From: Ali Polatel To: Carl Worth Message-ID: <20100115210934.GA12515@harikalardiyari> References: <20100114084713.GA22273@harikalardiyari> <87eilse1hg.fsf@yoom.home.cworth.org> <20100115001600.GD25209@lapse.rw.madduck.net> <87vdf3cd1y.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pWyiEgJYm5f9v55/" Content-Disposition: inline In-Reply-To: <87vdf3cd1y.fsf@yoom.home.cworth.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: martin f krafft , notmuch@notmuchmail.org Subject: Re: Thoughts on notmuch and Lua X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 21:09:40 -0000 --pWyiEgJYm5f9v55/ Content-Type: text/plain; charset=iso-8859-9 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Carl Worth yazm=FD=FE: > On Fri, 15 Jan 2010 13:16:00 +1300, martin f krafft = 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. >=20 > Good point. >=20 > 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". >=20 > And that's what I'm doing already, (with a shell script), to tag > newly-arrived messages. >=20 > The only part that's really missing here is a directory where scripts > could be dropped in and get automatically invoked. >=20 > What do you think, Ali? Would an approach like that satisfy the things > you had in mind for hooks? >=20 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=B9 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. =B9: http://alip.github.com/mpdcron/ > -Carl --=20 Regards, Ali Polatel --pWyiEgJYm5f9v55/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) iEYEABECAAYFAktQ2Y4ACgkQQU4yORhF8iAEsQCgr9S0r0/YLG4AnMh86YawHJE0 VWAAoIHlPvt98h0VSBYG2cQ8xYi3uV4m =npvQ -----END PGP SIGNATURE----- --pWyiEgJYm5f9v55/--