[PATCH v3 2/5] reply: Add a JSON reply format.
Adam Wolfe Gordon
awg+notmuch at xvx.ca
Sun Feb 5 22:27:14 PST 2012
On Sun, Feb 5, 2012 at 20:44, Austin Clements <amdragon at mit.edu> wrote:
> Sorry for coming late to the party. I really like this idea, but it
> seems like your implementation is duplicating a lot of the work of
> notmuch show. This makes me wonder if it would be better to return
> reply header information in the JSON (which is definitely the way to
> go) but to fetch the part body from the UI via show (and maybe reuse
> some of the show-mode logic, if it makes sense to do so). If this has
> already been discussed, just point me at the thread and I'll catch
> myself up.
Thanks for taking a look. Dmitry noted on IRC that inlining the HTML
in JSON could cause issues with non-UTF8 character sets. Right now I'm
working on essentially what you've suggested - having the CLI produce
only headers, and then using show to get the quotable body.
Something else that was mentioned on IRC is using some of the notmuch
show logic to produce the show JSON format as part of reply. I looked
into this, but it would take some serious refactoring (to make the
show JSON stuff accessible to reply), and since emacs will need to end
up calling show anyway, I'm not sure it's worth it. I do like the idea
of different CLI commands being able to produce standardized formats
through some shared interface, I'm just not sure it's necessary here,
and not sure what the interface should look like.
More information about the notmuch
mailing list