From 66fe8f762d7cb15868a91a930fd4d007b790a852 Mon Sep 17 00:00:00 2001 From: craven Date: Mon, 16 Jul 2012 10:34:59 +0200 Subject: [PATCH] [PATCH v6 0/3] notmuch-reply: Structured Formatters --- 84/a3e70a20fe7b1cc992bb8f1ea85a6c15812ed7 | 72 +++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 84/a3e70a20fe7b1cc992bb8f1ea85a6c15812ed7 diff --git a/84/a3e70a20fe7b1cc992bb8f1ea85a6c15812ed7 b/84/a3e70a20fe7b1cc992bb8f1ea85a6c15812ed7 new file mode 100644 index 000000000..c72fcb534 --- /dev/null +++ b/84/a3e70a20fe7b1cc992bb8f1ea85a6c15812ed7 @@ -0,0 +1,72 @@ +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 A2067431FBF + for ; Mon, 16 Jul 2012 23:04:34 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.001 +X-Spam-Level: +X-Spam-Status: No, score=0.001 tagged_above=-999 required=5 + tests=[FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001] + 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 OH0cDTJB2L0n for ; + Mon, 16 Jul 2012 23:04:34 -0700 (PDT) +Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.23]) + by olra.theworths.org (Postfix) with SMTP id DE388431FBC + for ; Mon, 16 Jul 2012 23:04:33 -0700 (PDT) +Received: (qmail invoked by alias); 17 Jul 2012 06:04:32 -0000 +Received: from gw.arelion.cust.net.lagis.at (EHLO dodekanex.arelion.at) + [83.164.197.182] + by mail.gmx.net (mp031) with SMTP; 17 Jul 2012 08:04:32 +0200 +X-Authenticated: #201305 +X-Provags-ID: V01U2FsdGVkX1+PMTxuD7ePHfL+12nx6ttMCnC+sQvlSywu8iSV78 + HWKN8R/YkgxO+D +Received: by dodekanex.arelion.at (Postfix, from userid 1000) + id 52A2A30271F; Mon, 16 Jul 2012 10:35:05 +0200 (CEST) +From: +To: notmuch@notmuchmail.org +Subject: [PATCH v6 0/3] notmuch-reply: Structured Formatters +Date: Mon, 16 Jul 2012 10:34:59 +0200 +Message-Id: <1342427702-23316-1-git-send-email-craven@gmx.net> +X-Mailer: git-send-email 1.7.11.1 +In-Reply-To: <20120714020954.GD31670@mit.edu> +References: <20120714020954.GD31670@mit.edu> +X-Y-GMX-Trusted: 0 +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: Tue, 17 Jul 2012 06:04:34 -0000 + +Currently there is no easy way to add support for different structured +formatters (like JSON). For example, adding support for S-Expressions +would result in code duplication. + +This patch series amends the situation by introducing structured +formatters, which allow different implementations of structures like +lists, maps, strings and numbers. + +The new code in sprinter.h and sprinter-json.c can be used instead of +the current ad-hoc output in all parts of notmuch, a patch for +notmuch-search.c is included. + +In a later patch, all other parts of notmuch should be adapted to the +structured formatters, and the creation of formatters should be +centralised (to make adding new formatters easier). + +A "structured" formatter is provided for notmuch-search that prints the +current text format. This removes almost all the special-casing from +notmuch-search.c. + -- 2.26.2