[PATCH v5 0/3] notmuch-reply: Structured Formatters

Subject: [PATCH v5 0/3] notmuch-reply: Structured Formatters

Date: Fri, 13 Jul 2012 10:11:34 +0200

To: notmuch@notmuchmail.org

Cc:

From: Peter Feigl


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).


Thread: