Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / d0 / 5fc3b47591e5242da319782d3a28503a10c0c3
1 Return-Path: <nex@nexoid.at>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 98423431FD8\r
6         for <notmuch@notmuchmail.org>; Fri, 30 Nov 2012 00:35:11 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.001\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.001 tagged_above=-999 required=5\r
12         tests=[FREEMAIL_FROM=0.001] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id iU2SmT3k+bbB for <notmuch@notmuchmail.org>;\r
16         Fri, 30 Nov 2012 00:35:11 -0800 (PST)\r
17 Received: from mail.nexoid.at (www.nexoid.at [178.79.130.240])\r
18         (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 02721431FBC\r
21         for <notmuch@notmuchmail.org>; Fri, 30 Nov 2012 00:35:10 -0800 (PST)\r
22 Received: by mail.nexoid.at (Postfix, from userid 1000)\r
23         id DB22C11C0D1; Fri, 30 Nov 2012 09:29:17 +0100 (CET)\r
24 From: Peter Feigl <craven@gmx.net>\r
25 To: notmuch@notmuchmail.org\r
26 Subject: [PATCH 2/3] Use the S-Expression structured printer for notmuch\r
27         search.\r
28 Date: Fri, 30 Nov 2012 09:29:02 +0100\r
29 Message-Id: <1354264143-30173-2-git-send-email-craven@gmx.net>\r
30 X-Mailer: git-send-email 1.8.0\r
31 In-Reply-To: <1354264143-30173-1-git-send-email-craven@gmx.net>\r
32 References: <1354264143-30173-1-git-send-email-craven@gmx.net>\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.13\r
35 Precedence: list\r
36 List-Id: "Use and development of the notmuch mail system."\r
37         <notmuch.notmuchmail.org>\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
39         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
41 List-Post: <mailto:notmuch@notmuchmail.org>\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
45 X-List-Received-Date: Fri, 30 Nov 2012 08:35:11 -0000\r
46 \r
47 This commit adds support for --format=sexp to notmuch search.\r
48 ---\r
49  notmuch-search.c | 6 +++++-\r
50  sprinter.h       | 4 ++++\r
51  2 files changed, 9 insertions(+), 1 deletion(-)\r
52 \r
53 diff --git a/notmuch-search.c b/notmuch-search.c\r
54 index 830c4e4..6218622 100644\r
55 --- a/notmuch-search.c\r
56 +++ b/notmuch-search.c\r
57 @@ -305,7 +305,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[])\r
58      int exclude = EXCLUDE_TRUE;\r
59      unsigned int i;\r
60  \r
61 -    enum { NOTMUCH_FORMAT_JSON, NOTMUCH_FORMAT_TEXT }\r
62 +    enum { NOTMUCH_FORMAT_JSON, NOTMUCH_FORMAT_TEXT, NOTMUCH_FORMAT_SEXP }\r
63         format_sel = NOTMUCH_FORMAT_TEXT;\r
64  \r
65      notmuch_opt_desc_t options[] = {\r
66 @@ -315,6 +315,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[])\r
67                                   { 0, 0 } } },\r
68         { NOTMUCH_OPT_KEYWORD, &format_sel, "format", 'f',\r
69           (notmuch_keyword_t []){ { "json", NOTMUCH_FORMAT_JSON },\r
70 +                                 { "sexp", NOTMUCH_FORMAT_SEXP },\r
71                                   { "text", NOTMUCH_FORMAT_TEXT },\r
72                                   { 0, 0 } } },\r
73         { NOTMUCH_OPT_KEYWORD, &output, "output", 'o',\r
74 @@ -347,6 +348,9 @@ notmuch_search_command (void *ctx, int argc, char *argv[])\r
75      case NOTMUCH_FORMAT_JSON:\r
76         format = sprinter_json_create (ctx, stdout);\r
77         break;\r
78 +    case NOTMUCH_FORMAT_SEXP:\r
79 +       format = sprinter_sexp_create (ctx, stdout);\r
80 +       break;\r
81      default:\r
82         /* this should never happen */\r
83         INTERNAL_ERROR("no output format selected");\r
84 diff --git a/sprinter.h b/sprinter.h\r
85 index 912a526..59776a9 100644\r
86 --- a/sprinter.h\r
87 +++ b/sprinter.h\r
88 @@ -70,4 +70,8 @@ sprinter_text_create (const void *ctx, FILE *stream);\r
89  struct sprinter *\r
90  sprinter_json_create (const void *ctx, FILE *stream);\r
91  \r
92 +/* Create a new structure printer that emits S-Expressions. */\r
93 +struct sprinter *\r
94 +sprinter_sexp_create (const void *ctx, FILE *stream);\r
95 +\r
96  #endif // NOTMUCH_SPRINTER_H\r
97 -- \r
98 1.8.0\r
99 \r