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 9733B431FAE for ; Fri, 13 Jul 2012 01:13:42 -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 z50e54vDTPqu for ; Fri, 13 Jul 2012 01:13:40 -0700 (PDT) Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by olra.theworths.org (Postfix) with SMTP id 3E3A4431FC3 for ; Fri, 13 Jul 2012 01:13:39 -0700 (PDT) Received: (qmail invoked by alias); 13 Jul 2012 08:13:36 -0000 Received: from cm56-137-203.liwest.at (EHLO nexork.localdomain) [86.56.137.203] by mail.gmx.net (mp032) with SMTP; 13 Jul 2012 10:13:36 +0200 X-Authenticated: #201305 X-Provags-ID: V01U2FsdGVkX1/5F15BT5z551ssTzEHrq20STEwd2BcyXuKZgG0aZ lXqfDORnr1Ek2X Received: by nexork.localdomain (Postfix, from userid 1000) id 8AE294527800; Fri, 13 Jul 2012 10:11:42 +0200 (CEST) From: Peter Feigl To: notmuch@notmuchmail.org Subject: [PATCH v5 0/3] notmuch-reply: Structured Formatters Date: Fri, 13 Jul 2012 10:11:34 +0200 Message-Id: <1342167097-25012-1-git-send-email-craven@gmx.net> X-Mailer: git-send-email 1.7.11.1 In-Reply-To: <20120710191331.GE7332@mit.edu> References: <20120710191331.GE7332@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: Fri, 13 Jul 2012 08:13:43 -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 all special-casing from notmuch-search.c, only structured output is used (and the formatter discards unnecessary parts or introduces extra formatting).