unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Edmondson <dme@dme.org>
To: notmuch@notmuchmail.org
Subject: [PATCH 1/3] notmuch: Add `date_relative' to JSON search output.
Date: Mon, 29 Nov 2010 10:29:57 +0000	[thread overview]
Message-ID: <1291026599-14795-2-git-send-email-dme@dme.org> (raw)
In-Reply-To: <1291026599-14795-1-git-send-email-dme@dme.org>

Provide consumers of the JSON search output with the standard notmuch
relative date for each thread.
---
 notmuch-search.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/notmuch-search.c b/notmuch-search.c
index c628b36..d49556b 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -152,12 +152,14 @@ format_thread_json (const void *ctx,
 
     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,
+	    json_quote_str (ctx_quote, notmuch_time_relative_date (ctx, date)),
 	    matched,
 	    total,
 	    json_quote_str (ctx_quote, authors),
-- 
1.7.2.3

  reply	other threads:[~2010-11-29 10:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-29 10:29 second attempt: JSON based search David Edmondson
2010-11-29 10:29 ` David Edmondson [this message]
2010-11-29 10:29 ` [PATCH 2/3] test: Expect `date_relative' in JSON search output David Edmondson
2010-11-29 10:29 ` [PATCH 3/3] emacs: Use JSON output for search David Edmondson
2010-11-30 11:00   ` [PATCH 1/4] emacs: JSON based search improvements David Edmondson
2010-11-30 11:00   ` [PATCH 2/4] emacs: Use a plists rather than an assoc list in JSON search David Edmondson
2010-11-30 11:00   ` [PATCH 3/4] test: Add tests for JSON parsing of search results David Edmondson
2010-11-30 11:00   ` [PATCH 4/4] emacs: Fix indentation, add comments David Edmondson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1291026599-14795-2-git-send-email-dme@dme.org \
    --to=dme@dme.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).