From: Sebastian Spaeth <Sebastian@SSpaeth.de>
To: notmuch@notmuchmail.org
Subject: [PATCH] notmuch-show: add tags to json output
Date: Mon, 1 Mar 2010 16:39:06 +0100 [thread overview]
Message-ID: <1267457946-30347-1-git-send-email-Sebastian@SSpaeth.de> (raw)
In-Reply-To: <87r5o49kow.fsf@SSpaeth.de>
The previous json patches forgot to add the notmuch tags to the json output. This is inconsistent to the text output so here they are. We just output a 'tags' field that sends a space delimited list of json-encoded notmuch tags.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
---
notmuch-show.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/notmuch-show.c b/notmuch-show.c
index 1a1d601..0f10797 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -138,10 +138,11 @@ format_message_json (const void *ctx, notmuch_message_t *message, unused (int in
{
void *ctx_quote = talloc_new (ctx);
- printf ("\"id\": %s, \"match\": %s, \"filename\": %s",
+ printf ("\"id\": %s, \"match\": %s, \"filename\": %s, \"tags\": %s",
json_quote_str (ctx_quote, notmuch_message_get_message_id (message)),
notmuch_message_get_flag (message, NOTMUCH_MESSAGE_FLAG_MATCH) ? "true" : "false",
- json_quote_str (ctx_quote, notmuch_message_get_filename (message)));
+ json_quote_str (ctx_quote, notmuch_message_get_filename (message)),
+ json_quote_str (ctx_quote, _get_tags_as_string (ctx_quote, message)));
talloc_free (ctx_quote);
}
--
1.6.3.3
next prev parent reply other threads:[~2010-03-01 15:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <id:1262249616-sup-3911@elise>
2009-12-31 15:17 ` [PATCH] Add an "--format=(json|text)" command-line option to both notmuch-search and notmuch-show david
2009-12-31 20:27 ` Scott Robinson
2010-02-10 13:51 ` David Bremner
2010-02-10 17:54 ` Scott Robinson
2010-02-23 20:56 ` Carl Worth
2010-03-01 14:58 ` [Sebastian Spaeth] " Sebastian Spaeth
2010-03-01 15:39 ` Sebastian Spaeth [this message]
2010-03-01 17:26 ` [PATCH] notmuch-show: add tags to json output David Bremner
2010-03-01 17:35 ` Jameson Rollins
2010-03-02 10:52 ` [PATCH 1/2] notmuch-show: Do not output (null) when the message body is empty Sebastian Spaeth
2010-03-02 10:52 ` [PATCH 2/2] notmuch-show: add tags to json output Sebastian Spaeth
2010-03-10 9:41 ` Sebastian Spaeth
2010-03-11 12:11 ` [PATCH] " Sebastian Spaeth
2010-03-11 12:34 ` Carl Worth
2010-03-01 15:59 ` more json woes Sebastian Spaeth
2010-03-01 16:12 ` [PATCH] notmuch-show: Do not output (null) when the message body is empty Sebastian Spaeth
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=1267457946-30347-1-git-send-email-Sebastian@SSpaeth.de \
--to=sebastian@sspaeth.de \
--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).