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 14E59431FD0 for ; Thu, 14 Jul 2011 15:23:07 -0700 (PDT) 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 epg+TM42Wqp0 for ; Thu, 14 Jul 2011 15:23:05 -0700 (PDT) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id F0ED1431FB6 for ; Thu, 14 Jul 2011 15:23:04 -0700 (PDT) Received: by wwj40 with SMTP id 40so634382wwj.2 for ; Thu, 14 Jul 2011 15:23:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=wT1UWgEjtDbBEcclRPmrMZYgaS4nGGu+z8KL1XAGJPs=; b=cB6km0H9fOAwdcE1UO6Hst+qEP9CvPJzSb//Ue80A8sdf5U1ll1fZDWlH6E+se4pOQ IdmhQoaXXSUVErtG+rTqyghER/a6DEgE6ieopgrpl9l5jSB9oJwiCA0NofaT7IOFG2z4 RflZ0a6Phyr5JR9Xf2s6WUFp9pghKtuPNsIRA= Received: by 10.216.60.74 with SMTP id t52mr2721330wec.30.1310682183641; Thu, 14 Jul 2011 15:23:03 -0700 (PDT) Received: from brick.lan (cpc1-sgyl2-0-0-cust47.sgyl.cable.virginmedia.com [80.192.18.48]) by mx.google.com with ESMTPS id r48sm419597weq.26.2011.07.14.15.23.01 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Jul 2011 15:23:02 -0700 (PDT) Date: Thu, 14 Jul 2011 23:22:58 +0100 From: Patrick Totzke To: notmuch@notmuchmail.org Subject: date_relative in notmuch-search Message-ID: <20110714222258.GA11914@brick.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yrj/dFKFPuw6o+aM" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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: Thu, 14 Jul 2011 22:23:07 -0000 --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, I wodered why "notmuch search --format=3Djson" doesn't provide the "date_re= lative" field for results, as the show command does. I'm not expert on notmuch internals but I got it working like this: diff --git a/notmuch-search.c b/notmuch-search.c index faccaf7..b1adc03 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -176,12 +176,14 @@ format_thread_json (const void *ctx, =20 printf ("\"thread\": %s,\n" "\"timestamp\": %ld,\n" + "\"date_relative\": \"%s\",\n" "\"matched\": %d,\n" "\"total\": %d,\n" "\"authors\": %s,\n" "\"subject\": %s,\n", json_quote_str (ctx_quote, thread_id), date, + notmuch_time_relative_date (ctx, date), I'm unsure it it's better to use json_quote_str here but you tell me :) Best, /p --yrj/dFKFPuw6o+aM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk4fbEIACgkQlDQDZ9fWxap2VACbB9QuKVruDsqETkeutXvmq0E3 bA0AnjwNUE6Pu4qenR3gN7gt+/SODbMJ =tKq5 -----END PGP SIGNATURE----- --yrj/dFKFPuw6o+aM--