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 71200431FB6 for ; Wed, 2 Feb 2011 15:46:53 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=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 iM5V7pNrqSy0 for ; Wed, 2 Feb 2011 15:46:53 -0800 (PST) Received: from mail-vw0-f53.google.com (mail-vw0-f53.google.com [209.85.212.53]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id D6E09431FB5 for ; Wed, 2 Feb 2011 15:46:52 -0800 (PST) Received: by vws8 with SMTP id 8so297207vws.26 for ; Wed, 02 Feb 2011 15:46:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=cDXfv2iI/fYiBtoxRgublqS7IzcU9qJTdVJv6lk1EU4=; b=X2mVb8yUOgF9o/177/oMBSroVr4RnUGHKqV1EbS63K1YRMdHEMlNg/f+Ms+HN9F5bS KYKItC2RcbNyj+I62eajwD4GGOKLGeLbTXLlEUvmlTDkSFchYyeAhL0SBxwLKWHBvFn+ Yn0GwMDo3eH3I33SfEU/+8M2crcmfJnb6LJdg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=NmxKGSb+UZKi6V6kVzLdgRPaSex5mT/r4LZJ08dGVL0aPbP/rR+DjofkwjPNB73gT3 Msfr2COJ7WldfI80v+b0rizNalnhQZP7n0Is8WC4A5IvF+tdrs2JoHfE9ttzHJwjNQB6 mKAUObOJPgTR/nPmQ27dPW65dC8LrVHyw7Yq8= Received: by 10.220.200.13 with SMTP id eu13mr2461918vcb.148.1296690408254; Wed, 02 Feb 2011 15:46:48 -0800 (PST) Received: from localhost (user132-198.wireless.utoronto.ca [142.1.132.198]) by mx.google.com with ESMTPS id e18sm126198vbm.15.2011.02.02.15.46.46 (version=SSLv3 cipher=RC4-MD5); Wed, 02 Feb 2011 15:46:47 -0800 (PST) Date: Wed, 2 Feb 2011 18:47:19 -0500 From: Peter John Hartman To: notmuch@notmuchmail.org Subject: [PATCH] Have --format=mbox insert Status: Message-ID: <20110202234719.GA28241@triltoucheee.wireless.utoronto.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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, 02 Feb 2011 23:46:53 -0000 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"); + } + while ((line_len = getline (&line, &line_size, file)) != -1 ) { if (_is_from_line (line)) putchar ('>'); It could, for instance, insert X-Status: AFTD flags, maybe, and it could be a little more sensitive about O. Maybe if tag is "new" it won't put the O there, but I wasn't sure. Anyway, this is chiefly useful for me and others who use the mbox format. 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 Best, Peter -- sic dicit magister P PhD Candidate Collaborative Programme in Ancient and Medieval Philosophy University of Toronto http://individual.utoronto.ca/peterjh