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 08113431FB6 for ; Sat, 5 Feb 2011 15:08:58 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 uu0D4iE0VwHa for ; Sat, 5 Feb 2011 15:08:57 -0800 (PST) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id 82A08431FB5 for ; Sat, 5 Feb 2011 15:08:57 -0800 (PST) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id D619F3CFEEF; Sun, 6 Feb 2011 00:08:56 +0100 (CET) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id PyABSO63mtqV; Sun, 6 Feb 2011 00:08:55 +0100 (CET) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id AE1643CFEA1; Sun, 6 Feb 2011 00:08:55 +0100 (CET) Received: from wsheee.2x.cz (unknown [213.29.198.144]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id A904315C031; Sun, 6 Feb 2011 00:08:55 +0100 (CET) Received: from wsh by wsheee.2x.cz with local (Exim 4.72) (envelope-from ) id 1PlrFP-0007Zn-2c; Sun, 06 Feb 2011 00:08:55 +0100 From: Michal Sojka To: Peter John Hartman , notmuch@notmuchmail.org Subject: Re: [PATCH] Have --format=mbox insert Status: In-Reply-To: <20110202234719.GA28241@triltoucheee.wireless.utoronto.ca> References: <20110202234719.GA28241@triltoucheee.wireless.utoronto.ca> User-Agent: Notmuch/0.5-103-g1253785 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) Date: Sun, 06 Feb 2011 00:08:54 +0100 Message-ID: <87wrleoz95.fsf@wsheee.2x.cz> 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: Sat, 05 Feb 2011 23:08:58 -0000 On Wed, 02 Feb 2011, Peter John Hartman wrote: > Hi folks, > > This is not a complete patch, but should give you an idea. (It works well > enough for me, but I think it could do more). > > diff --git a/notmuch-show.c b/notmuch-show.c > index ef421ec..dff66de 100644 > --- a/notmuch-show.c > +++ b/notmuch-show.c > @@ -272,6 +272,12 @@ format_message_mbox (const void *ctx, > > printf ("From %s %s", from, date_asctime); > > + if (strstr(_get_tags_as_string(ctx,message),"unread") != NULL) { > + printf ("Status: O\n"); > + } else { > + printf ("Status: RO\n"); > + } > + Hi Peter, would this output be compatible with all mbox consumers or only with those who expect the Status: line? If the latter, we would probably want a command line option to enable this. > For instance, I combine notmuch with mutt as follows: > > notmuch show --format=mbox $(notmuch search thread:xxx | cut -d' ' -f1) > > tmp.mbox && mutt -f tmp.mbox && rm -f tmp.mbox Interesting :) -Michal