Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 1F9EC431FD0 for ; Wed, 7 Dec 2011 10:05:31 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled 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 czJWzYbi46AG for ; Wed, 7 Dec 2011 10:05:30 -0800 (PST) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 48FFE431FB6 for ; Wed, 7 Dec 2011 10:05:30 -0800 (PST) Received: by bkat8 with SMTP id t8so738955bka.26 for ; Wed, 07 Dec 2011 10:05:27 -0800 (PST) Received: by 10.180.108.114 with SMTP id hj18mr25951201wib.2.1323281127360; Wed, 07 Dec 2011 10:05:27 -0800 (PST) Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi. [80.220.92.23]) by mx.google.com with ESMTPS id fy13sm4188194wbb.18.2011.12.07.10.05.23 (version=SSLv3 cipher=OTHER); Wed, 07 Dec 2011 10:05:25 -0800 (PST) From: Jani Nikula To: Tom Prince , Jameson Graef Rollins , notmuch@notmuchmail.org Subject: Re: [PATCH v3 0/2] notmuch hooks In-Reply-To: <87borlf4ve.fsf@hermes.hocat.ca> References: <7fbe6befcf31881a9bca672f55b93501249a220c.1322859389.git.jani@nikula.org> <87d3c1rtcq.fsf@servo.finestructure.net> <87borlf4ve.fsf@hermes.hocat.ca> User-Agent: Notmuch/0.10.1+81~gf7f8697 (http://notmuchmail.org) Emacs/23.3.1 (i686-pc-linux-gnu) Date: Wed, 07 Dec 2011 20:05:22 +0200 Message-ID: <87mxb4b6l9.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Wed, 07 Dec 2011 18:05:31 -0000 On Tue, 06 Dec 2011 22:16:37 -0500, Tom Prince wrote: > On Tue, 06 Dec 2011 18:47:01 -0800, Jameson Graef Rollins wrote: > > Also, what if we make it so that the post-new hook script only runs if > > notmuch new processes new messages? All of my post-new functions don't > > need to be run at all if there is no new mail. I think the post-new hook should be run always (provided there have been no errors). I think it might be surprising not to, and some users might use the hook for something other than tagging. > Or would it make sense to pass this information to the hook somehow? It would, but as I wrote in id:"87mxb8kt5r.fsf@nikula.org", I think that should come as another patch afterwards. I know I can't decide yet what should be passed and how. Processed message counts (added, deleted, renamed) could be passed on the command line, but how useful is that really? The same can be easily achieved through initial tagging. Message-ids could not be passed on the command line (there just can be too many of them) so it would require setting up a pipe and feeding them to stdin of the hook. The post-new hook should be run after the database has been closed, but the message-ids are not saved during notmuch new processing. Saving them for later gets complicated for not much extra benefit in addition to creative use of initial tagging, as far as I can see. Plus interrupting the post-new hook with this setup would screw up your processing if it only depended on the message-ids. All in all, I'd postpone all of this until later. BR, Jani.