Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 7c / 9b9e1d015fb77a02711a4d040331762206e505
1 Return-Path: <cworth@cworth.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 4CC48431FBD;\r
6         Mon, 14 Dec 2009 14:30:47 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id KsfCkrdPmXTO; Mon, 14 Dec 2009 14:30:46 -0800 (PST)\r
11 Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
12         by olra.theworths.org (Postfix) with ESMTP id 58D58431FAE;\r
13         Mon, 14 Dec 2009 14:30:46 -0800 (PST)\r
14 Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
15         id 0D20C254307; Mon, 14 Dec 2009 14:30:46 -0800 (PST)\r
16 From: Carl Worth <cworth@cworth.org>\r
17 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
18 In-Reply-To: <87iqcapijl.fsf@pivot.cs.unb.ca>\r
19 References: <87iqcapijl.fsf@pivot.cs.unb.ca>\r
20 Date: Mon, 14 Dec 2009 14:30:45 -0800\r
21 Message-ID: <87k4wp2noq.fsf@yoom.home.cworth.org>\r
22 MIME-Version: 1.0\r
23 Content-Type: multipart/signed; boundary="=-=-=";\r
24         micalg=pgp-sha1; protocol="application/pgp-signature"\r
25 Subject: Re: [notmuch] RFC: output json from notmuch?\r
26 X-BeenThere: notmuch@notmuchmail.org\r
27 X-Mailman-Version: 2.1.12\r
28 Precedence: list\r
29 List-Id: "Use and development of the notmuch mail system."\r
30         <notmuch.notmuchmail.org>\r
31 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
32         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
33 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
34 List-Post: <mailto:notmuch@notmuchmail.org>\r
35 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
36 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
37         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
38 X-List-Received-Date: Mon, 14 Dec 2009 22:30:47 -0000\r
39 \r
40 --=-=-=\r
41 \r
42 On Sun, 13 Dec 2009 19:21:02 -0400, David Bremner <david@tethera.net> wrote:\r
43 > It would be nice to have more structured output from notmuch-show.  I\r
44 > decided to investigate sexp (i.e. lisp) and json output.\r
45 \r
46 Thanks, David!\r
47 \r
48 > Then I found that json parsing is provided by the library json.el\r
49 > shipped with emacs23, so I decided to play with json a bit.\r
50 \r
51 That sounds very promising. I wasn't aware this existed inside emacs\r
52 already.\r
53 \r
54 > I settled on the jansson library (http://www.digip.org/jansson/)\r
55 > because it seemed to have a sane api and documentation, but there are\r
56 > many choices.  I'll follow up with the actual patch, but the idea is to\r
57 > replace the printfs in show_message with calls to set (key,value) pairs\r
58 > in a json object, and output it at the end.\r
59 \r
60 I'm still not sure of the need to depend on a library just to *generate*\r
61 any particular format. I would expect that job to be so constrained as\r
62 to be almost trivial. I won't necessarily block a patch based on that,\r
63 but I think we should at least look at how easy it would be to just emit\r
64 the syntax manually.\r
65 \r
66 > So, do people think this is a reasonable idea to persue?\r
67 \r
68 I do, yes. The current lack of full quoting is an obnoxious bug.\r
69 \r
70 >     1) it adds a dependency, but not a heavy one. jansson is about 300k\r
71 >     installed on debian/i386\r
72 \r
73 That might be acceptable. And we might rewrite the patch to avoid it as\r
74 well. I'd like to see what that would take.\r
75 \r
76 >     2) It might mean that people using emacs22 might have to score\r
77 >     json.el from somewhere; I'm not sure.\r
78 \r
79 Currently, it sounds like notmuch is entirely unusable from emacs22, so\r
80 I'm really not too concerned about one more thing that requires emacs\r
81 23.\r
82 \r
83 >     3) There is some increase in memory use since the whole thread has\r
84 >     to be built as a json object before being output.\r
85 \r
86 Right. That would be another reason to just stream the output\r
87 manually. The syntax doesn't require things like knowing the size of an\r
88 array before emitting the first element, right?\r
89 \r
90 >     4) Of course jansson is doing it's own reference counting memory\r
91 >     managment, and not using talloc. But we already have glib...\r
92 \r
93 It's not evil to not use talloc. So not an issue there.\r
94 \r
95 -Carl\r
96 \r
97 --=-=-=\r
98 Content-Type: application/pgp-signature\r
99 \r
100 -----BEGIN PGP SIGNATURE-----\r
101 Version: GnuPG v1.4.10 (GNU/Linux)\r
102 \r
103 iD8DBQFLJryV6JDdNq8qSWgRAroZAKCgRw09bP1to8pW9KJTu2DeGYZQVwCgpRVJ\r
104 DkiWuy4m2KTFJg05RutuSls=\r
105 =JyyV\r
106 -----END PGP SIGNATURE-----\r
107 --=-=-=--\r