From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 5FCF3431FAE for ; Tue, 23 Feb 2010 13:00:09 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.286 X-Spam-Level: X-Spam-Status: No, score=-2.286 tagged_above=-999 required=5 tests=[AWL=-1.176, BAYES_05=-1.11] autolearn=unavailable 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 6H94i8dLdJzR for ; Tue, 23 Feb 2010 13:00:09 -0800 (PST) Received: from tarap.cc.columbia.edu (tarap.cc.columbia.edu [128.59.29.7]) by olra.theworths.org (Postfix) with ESMTP id C727D431FBC for ; Tue, 23 Feb 2010 13:00:08 -0800 (PST) Received: from servo.finestructure.net (cpe-72-227-128-66.nyc.res.rr.com [72.227.128.66]) (user=jgr2110 author=jrollins@finestructure.net mech=PLAIN bits=0) by tarap.cc.columbia.edu (8.14.3/8.14.3) with ESMTP id o1NL05wt022361 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Tue, 23 Feb 2010 16:00:05 -0500 (EST) Received: from jrollins by servo.finestructure.net with local (Exim 4.71) (envelope-from ) id 1Nk1rR-00068N-2F; Tue, 23 Feb 2010 16:00:05 -0500 From: Jameson Rollins To: Carl Worth , david@tethera.net, notmuch@notmuchmail.org In-Reply-To: <878wajwwth.fsf@yoom.home.cworth.org> References: <1261114167-sup-8228@lisa> <1261141195-5469-1-git-send-email-david@tethera.net> <878wajwwth.fsf@yoom.home.cworth.org> Date: Tue, 23 Feb 2010 16:00:01 -0500 Message-ID: <87wry33bxq.fsf@servo.finestructure.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-No-Spam-Score: Local X-Scanned-By: MIMEDefang 2.68 on 128.59.29.7 Subject: JSON output as default [was: Re: [PATCH] Add an "--output=(json|text|)" command-line option...] 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, 23 Feb 2010 21:00:09 -0000 --=-=-= Hey, Carl. I mentioned this is an email a while back (id:87eil4ygar.fsf@servo.finestructure.net), but I want to bring it up again now that you're looking at the JSON output stuff. I would like to make the case for JSON being the one and only output format. Here's the arguments: * JSON is a very well spec'd API * JSON is a *very* well supported standard (it's basically well supported by every language) * the JSONformat is perfectly suited for notmuch's output * emacs has a json.el library, so it would not be hard at all to modify the notmuch.el to parse json output * using only one output format would considerably reduce the code base in notmuch, keeping things simpler and easier to maintain I think these are pretty good reason to just move to JSON as *the* output format. While I'm on this topic, let me rehash another point I made previously: If we move to JSON output, it would be *so* sweet to provide means to filter the output JSON fields. The "--output" flag could be used to pick the desired output fields. For instance, the current "search" output could be something like: search --output=thread_id,date,number,author,subject,tags while the current "show" output could be something like: search --output=message_id,tags,path,header,body,attachments This would all make things *much* easier for clients and wrappers. For instance, here are just a couple of things that would be made much easier for wrapper scripts: * Proper maildir sync ("search --output=message_id,tags,path" ...) * Purging "delete" tagged messages ("search --output=path" tags:delete) * Moving/archiving messages based on search results ("search --output=path" ...) I would personally love to see this. I think it would make notmuch cleaner, simpler, and more powerful all at the same time. Interested in hearing what other's thoughts on this idea are. jamie. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBCAAGBQJLhEHSAAoJEO00zqvie6q8sFAP/jpVK6AOhAle5+4MZQqpn1eG H4Be0N8brsNAeM4o6JvTW7XHdV7O2u/wwGTq2lmoxwF0slcmKjVcWHr7QP7VrvlV P7iXyfb3A94pjaMldzgtKW5OZ3/a/lE3yPYffBaJ4rcuHcSI/mlugVzy7v4UZ8ep T0h2kE9B36014YpZklzWpHu1kfj79y0Y2u8ZDRTYWK9mAInLVTsF8zLIYcrfRrDR wH7WIahtpwye9LeL6oB8Kqi4KfB0MUPvyML80CAu3FiaCd/RA1ij/KUb3JbE2Wf4 D1DAEVnZIxc/WgxGJnoisHM9kSuMAv7pgvxoqlpnxi1cZhL4xGvmlKf7QhgbpyMQ 2JYUvNzRmNndJJGyoMByS2o/KfADkK1ML/TryodYPAI3tkimy+ZL/cN7F1yH1cqp htUNfJfuTlGEFVpAl/8QMvvRUmTRInKe0MFrr3941FrRc33GZ92qUgUB15v3K6NG wMg+8pdUPe9r/mY8PyyjWzrqowwIINmexFzzLhNRSG1MnrPoJzk410L3xmnkDKz9 jaIx1bMrHOOa1QMwfC8oou1xSJjqE1Sld7kygUgbnw9c7pdhh3ZdXfS4BXQmJXNz gXqtHLWBKs7UQ0Ow7zXyqq23+big1QQy1Xe1ViIDBKwTY4momwQ1szu0zeHPE1BL p32Sfd09W/tE4KNnJKe4 =t2XF -----END PGP SIGNATURE----- --=-=-=--