From 40294e1cc4e1c69f4800225b6a1861abb134b68c Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Tue, 10 Jul 2012 16:16:14 +0300 Subject: [PATCH] Re: post-new [was: Re: query on a subset of messages ?] --- 80/295e2e868eccad527bc148f7ac063e2aca45a8 | 174 ++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 80/295e2e868eccad527bc148f7ac063e2aca45a8 diff --git a/80/295e2e868eccad527bc148f7ac063e2aca45a8 b/80/295e2e868eccad527bc148f7ac063e2aca45a8 new file mode 100644 index 000000000..7dd95db6b --- /dev/null +++ b/80/295e2e868eccad527bc148f7ac063e2aca45a8 @@ -0,0 +1,174 @@ +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 4B845431E64 + for ; Tue, 10 Jul 2012 06:16:17 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.699 +X-Spam-Level: +X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5 + tests=[HTML_MESSAGE=0.001, 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 tIh7z1tprDqN for ; + Tue, 10 Jul 2012 06:16:16 -0700 (PDT) +Received: from mail-yw0-f53.google.com (mail-yw0-f53.google.com + [209.85.213.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 7DC0A431FBF + for ; Tue, 10 Jul 2012 06:16:16 -0700 (PDT) +Received: by yhp26 with SMTP id 26so15098285yhp.26 + for ; Tue, 10 Jul 2012 06:16:15 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=google.com; s=20120113; + h=mime-version:in-reply-to:references:date:message-id:subject:from:to + :cc:content-type:x-gm-message-state; + bh=rz02vxMTQlPBeSotWL6kCTTF910156shk0nOqAYL58g=; + b=p3nLRxC0BxJNYiIDYURtziYOcBGmO+xHUUr+NRTCW7se1MoCoM6D1yLWT2ZF9BWCrN + YuWtbRjNsLVzjDVByhLX6sQO0bsRLt2rLF5Q+KfJArjXM9Y6KSFCr20et8uSMzKPpKVe + eOyVwqebMZOeWQ3771oMqqfP+4PauhvEMbkJH6nUzK/EEGi8DMd2Ch0eiwMLQd521/rr + +oQVi/S4WhYh6mWTm/xMlxpkGR/a6yd/8JHeglSLKteJjr/Iopdq5IA7oK5XpWrH4i1m + BhuXAyZaWtsKNK0Q9UppuLx8pbmyAdPgrtpZS6Nxr67QF8h2lrrCaNRVYSZRZArie/ke + bDUg== +MIME-Version: 1.0 +Received: by 10.60.18.168 with SMTP id x8mr45588183oed.18.1341926174849; Tue, + 10 Jul 2012 06:16:14 -0700 (PDT) +Received: by 10.76.10.102 with HTTP; Tue, 10 Jul 2012 06:16:14 -0700 (PDT) +Received: by 10.76.10.102 with HTTP; Tue, 10 Jul 2012 06:16:14 -0700 (PDT) +In-Reply-To: <87r4sk3lxu.fsf@cern.ch> +References: <871ukl5oj7.fsf@cern.ch> <87ehol2aku.fsf@servo.finestructure.net> + <87wr2c3mtj.fsf@cern.ch> <87r4sk3lxu.fsf@cern.ch> +Date: Tue, 10 Jul 2012 16:16:14 +0300 +Message-ID: + +Subject: Re: post-new [was: Re: query on a subset of messages ?] +From: Jani Nikula +To: Sebastien Binet +Content-Type: multipart/alternative; boundary=e89a8ff2561af77ab604c479886e +X-Gm-Message-State: + ALoCoQmveIMdWNGn1cNENY0diZE17AkFiD5UL3sr95xvin/4/8ZFfGax/uFAC/toJ3ycEIGUP7Rx +Cc: Notmuch Mail +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: Tue, 10 Jul 2012 13:16:17 -0000 + +--e89a8ff2561af77ab604c479886e +Content-Type: text/plain; charset=UTF-8 + +On Jul 10, 2012 12:59 PM, "Sebastien Binet" wrote: +> +> Jani Nikula writes: +> +> > On Jul 9, 2012 8:12 PM, "Jameson Graef Rollins" < +jrollins@finestructure.net> +> > wrote: +> >> +> >> On Mon, Jul 09 2012, Sebastien Binet wrote: +> >> > hum... is post-new supposed to be run even if there is no new +message ? +> >> +> >> Hi, Sebastian. Yes, I think it runs regardless if there are any new +> >> messages or not. +> > +> > That's correct; only errors in notmuch new cause post-new hook to be +> > skipped. +> +> ok. I thought using the post-new hook would have saved some i/o +> resources over my current setup: +> offlineimap.postsynchook = ~/emacs/notmuch-lib/notmuch-tag.sh +> +> where notmuch-tag.sh is (in pseudo-code): +> ## +> /usr/bin/notmuch new +> +> for tag,query in tag-queries: +> tag_new $tag $query +> +> ## +> +> is there any advantage of using post-new compared to this setup ? + +There's no functional advantage. It does keep your initial tagging script +connected with notmuch new rather than offlinemap, if you ever need to run +notmuch new on its own. + +If your tagging setup is really complicated, you could have some-tag in +new.tags config, and bail out early if notmuch count tag:some-tag outputs 0 +(and obviously notmuch tag -some-tag tag:some-tag later in the script). +Just a thought. + +J. + +> +> -s + +--e89a8ff2561af77ab604c479886e +Content-Type: text/html; charset=UTF-8 +Content-Transfer-Encoding: quoted-printable + +


+On Jul 10, 2012 12:59 PM, "Sebastien Binet" <binet@cern.ch> wrote:
+>
+> Jani Nikula <jani@nikula.org= +> writes:
+>
+> > On Jul 9, 2012 8:12 PM, "Jameson Graef Rollins" <jrollins@finestructure.net&g= +t;
+> > wrote:
+> >>
+> >> On Mon, Jul 09 2012, Sebastien Binet <binet@cern.ch> wrote:
+> >> > hum... is post-new supposed to be run even if there is n= +o new message ?
+> >>
+> >> Hi, Sebastian. =C2=A0Yes, I think it runs regardless if there= + are any new
+> >> messages or not.
+> >
+> > That's correct; only errors in notmuch new cause post-new hoo= +k to be
+> > skipped.
+>
+> ok. I thought using the post-new hook would have saved some i/o
+> resources over my current setup:
+> =C2=A0offlineimap.postsynchook =3D ~/emacs/notmuch-lib/notmuch-tag.sh<= +br> +>
+> where notmuch-tag.sh is (in pseudo-code):
+> ##
+> /usr/bin/notmuch new
+>
+> for tag,query in tag-queries:
+> =C2=A0 tag_new $tag $query
+>
+> ##
+>
+> is there any advantage of using post-new compared to this setup ?

+

There's no functional advantage. It does keep your initial tagging s= +cript connected with notmuch new rather than offlinemap, if you ever need t= +o run notmuch new on its own.

+

If your tagging setup is really complicated, you could have some-tag in = +new.tags config, and bail out early if notmuch count tag:some-tag outputs 0= + (and obviously notmuch tag -some-tag tag:some-tag later in the script). Ju= +st a thought.

+ +

J.

+

>
+> -s
+

+ +--e89a8ff2561af77ab604c479886e-- -- 2.26.2