Re: Applying patches directly from emails?
[notmuch-archives.git] / ce / 0da2071ebb6ae776690b34a6d2d423586a2f89
1 Return-Path: <craven@gmx.net>\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 615A2431FC0\r
6         for <notmuch@notmuchmail.org>; Thu, 19 Jul 2012 23:34:53 -0700 (PDT)\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, RCVD_IN_DNSWL_NONE=-0.0001]\r
13         autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id x0Zwi+6igxGo for <notmuch@notmuchmail.org>;\r
17         Thu, 19 Jul 2012 23:34:51 -0700 (PDT)\r
18 Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22])\r
19         by olra.theworths.org (Postfix) with SMTP id B2EBD431FB6\r
20         for <notmuch@notmuchmail.org>; Thu, 19 Jul 2012 23:34:50 -0700 (PDT)\r
21 Received: (qmail invoked by alias); 20 Jul 2012 06:34:44 -0000\r
22 Received: from gw.arelion.cust.net.lagis.at (EHLO dodekanex.arelion.at)\r
23         [83.164.197.182]\r
24         by mail.gmx.net (mp070) with SMTP; 20 Jul 2012 08:34:44 +0200\r
25 X-Authenticated: #201305\r
26 X-Provags-ID: V01U2FsdGVkX19ltEZ7s0Zl5D69fpoGnawGa8JNoDGxjLUKbKc4Wl\r
27         WcG/Cy+Ar4cJby\r
28 Received: by dodekanex.arelion.at (Postfix, from userid 1000)\r
29         id 949F7301BF7; Fri, 20 Jul 2012 08:36:18 +0200 (CEST)\r
30 From: craven@gmx.net\r
31 To: notmuch@notmuchmail.org\r
32 Subject: notmuch-reply: Structured Formatters\r
33 Date: Fri, 20 Jul 2012 08:36:10 +0200\r
34 Message-Id: <1342766173-1344-1-git-send-email-craven@gmx.net>\r
35 X-Mailer: git-send-email 1.7.11.2\r
36 In-Reply-To: <20120718194819.GP31670@mit.edu>\r
37 References: <20120718194819.GP31670@mit.edu>\r
38 X-Y-GMX-Trusted: 0\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.13\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43         <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Fri, 20 Jul 2012 06:34:55 -0000\r
52 \r
53 Currently there is no easy way to add support for different structured\r
54 formatters (like JSON). For example, adding support for S-Expressions\r
55 would result in code duplication.\r
56 \r
57 This patch series amends the situation by introducing structured\r
58 formatters, which allow different implementations of structures like\r
59 lists, maps, strings and numbers.\r
60 \r
61 The new code in sprinter.h and sprinter-json.c can be used instead of\r
62 the current ad-hoc output in all parts of notmuch, a patch for\r
63 notmuch-search.c is included.\r
64 \r
65 In a later patch, all other parts of notmuch should be adapted to the\r
66 structured formatters, and the creation of formatters should be\r
67 centralised (to make adding new formatters easier).\r
68 \r
69 A "structured" formatter is provided for notmuch-search that prints the\r
70 current text format. This removes almost all the special-casing from\r
71 notmuch-search.c.\r
72 \r
73 Overall diff --stat:\r
74 \r
75  Makefile.local   |   2 +\r
76  notmuch-search.c | 301 +++++++++++++----------------------------------\r
77  sprinter-json.c  | 185 +++++++++++++++++++++++++++++\r
78  sprinter-text.c  | 126 ++++++++++++++++++++\r
79  sprinter.h       |  68 +++++++++++\r
80  test/json        |  34 +++---\r
81  6 files changed, 484 insertions(+), 232 deletions(-)\r
82 \r
83 Changes versus v6 of this patch:\r
84 - is_text_printer is now a field, not a function.\r
85 - minor formatting\r
86 - sprinter_text_search has been renamed to sprinter_text (as it contains\r
87   no search-specific code).\r
88 - string sanitization removed from sprinter_text, the caller should\r
89   sanitize the strings.\r
90 \r