Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 64 / 4a41db1a138106a75431f5ad1bdafc93031a87
1 Return-Path: <amthrax@drake.mit.edu>\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 1F327429E3A\r
6         for <notmuch@notmuchmail.org>; Tue, 14 Feb 2012 09:34:05 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 2ymoLpM+Pn7D for <notmuch@notmuchmail.org>;\r
16         Tue, 14 Feb 2012 09:34:02 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU\r
18         [18.9.25.12])\r
19         by olra.theworths.org (Postfix) with ESMTP id 30712429E30\r
20         for <notmuch@notmuchmail.org>; Tue, 14 Feb 2012 09:33:59 -0800 (PST)\r
21 X-AuditID: 1209190c-b7fad6d000000920-71-4f3a9b06e139\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
23         by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id E8.36.02336.60B9A3F4; Tue, 14 Feb 2012 12:33:58 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q1EHXvBg023237; \r
27         Tue, 14 Feb 2012 12:33:57 -0500\r
28 Received: from drake.mit.edu\r
29         (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
30         [209.6.116.242]) (authenticated bits=0)\r
31         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
32         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q1EHXuph016501\r
33         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
34         Tue, 14 Feb 2012 12:33:57 -0500 (EST)\r
35 Received: from amthrax by drake.mit.edu with local (Exim 4.77)\r
36         (envelope-from <amthrax@drake.mit.edu>)\r
37         id 1RxMGK-00027B-5m; Tue, 14 Feb 2012 12:33:56 -0500\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [PATCH 3/8] show: Use consistent header ordering in the JSON format\r
41 Date: Tue, 14 Feb 2012 12:33:38 -0500\r
42 Message-Id: <1329240823-7856-4-git-send-email-amdragon@mit.edu>\r
43 X-Mailer: git-send-email 1.7.7.3\r
44 In-Reply-To: <1329240823-7856-1-git-send-email-amdragon@mit.edu>\r
45 References: <1329240823-7856-1-git-send-email-amdragon@mit.edu>\r
46 X-Brightmail-Tracker:\r
47  H4sIAAAAAAAAA+NgFjrOIsWRmVeSWpSXmKPExsUixCmqrcs228rf4NRLdYsje2axW1zd2s9u\r
48         cf3mTGYHZo+ds+6yezxbdYvZo+nHYtYA5igum5TUnMyy1CJ9uwSujA+HfAqeaVYsX76ItYHx\r
49         g3IXIyeHhICJxMkLc5ggbDGJC/fWs3UxcnEICexjlJj88AI7hLOBUWLW1dWsEM59Jok7y18z\r
50         QjjzGSW2NV9hA+lnE9CQ2LZ/OSOILSIgLbHz7mxWEJtZIF7iSNt6sLiwgI/Ekocv2EFsFgFV\r
51         iYt988DivAL2EruPXGGHuENB4tzqc2A2p4CDxP59/8HmCAHVXLq7lWUCI/8CRoZVjLIpuVW6\r
52         uYmZOcWpybrFyYl5ealFuoZ6uZkleqkppZsYweElybOD8c1BpUOMAhyMSjy8BhaW/kKsiWXF\r
53         lbmHGCU5mJREeYVnWPkL8SXlp1RmJBZnxBeV5qQWH2KU4GBWEuHdNB0ox5uSWFmVWpQPk5Lm\r
54         YFES51XReucnJJCeWJKanZpakFoEk5Xh4FCS4E2aBdQoWJSanlqRlplTgpBm4uAEGc4DNDwZ\r
55         pIa3uCAxtzgzHSJ/ilFRSpzXAyQhAJLIKM2D64XF/ytGcaBXhHmDQKp4gKkDrvsV0GAmoMHb\r
56         T1uADC5JREhJNTCa8/e/bxcOdH5XxrS0+lH9lL0/Z2TMa9d+bbSuzDT6j+nj3ztE/x4+5H9y\r
57         X3uKwom1JRo7F+iqPVjrPKdZ0XDqh+VPVzPfypM757x1/hrfDf8XLD1YWlfHUH7RM/uZ4eSL\r
58         +meYlxld+Hjt2VEGux7m7FxFB4uX5dwTxF7rOD46yf+SoebiymfWSizFGYmGWsxFxYkA8Jhu\r
59         U9oCAAA=\r
60 X-BeenThere: notmuch@notmuchmail.org\r
61 X-Mailman-Version: 2.1.13\r
62 Precedence: list\r
63 List-Id: "Use and development of the notmuch mail system."\r
64         <notmuch.notmuchmail.org>\r
65 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
66         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
68 List-Post: <mailto:notmuch@notmuchmail.org>\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
70 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
72 X-List-Received-Date: Tue, 14 Feb 2012 17:34:05 -0000\r
73 \r
74 Previously, top-level message headers were printed as Subject, From,\r
75 To, Date, while embedded message headers were printed From, To,\r
76 Subject, Date.  This makes both cases use the former order and updates\r
77 the tests accordingly.\r
78 ---\r
79  notmuch-show.c |    6 +++---\r
80  test/multipart |    8 ++++----\r
81  2 files changed, 7 insertions(+), 7 deletions(-)\r
82 \r
83 diff --git a/notmuch-show.c b/notmuch-show.c\r
84 index 868b2cd..9ca9882 100644\r
85 --- a/notmuch-show.c\r
86 +++ b/notmuch-show.c\r
87 @@ -328,6 +328,9 @@ format_headers_message_part_json (GMimeMessage *message)\r
88      const char *recipients_string;\r
89  \r
90      printf ("%s: %s",\r
91 +           json_quote_str (ctx_quote, "Subject"),\r
92 +           json_quote_str (ctx_quote, g_mime_message_get_subject (message)));\r
93 +    printf (", %s: %s",\r
94             json_quote_str (ctx_quote, "From"),\r
95             json_quote_str (ctx_quote, g_mime_message_get_sender (message)));\r
96      recipients = g_mime_message_get_recipients (message, GMIME_RECIPIENT_TYPE_TO);\r
97 @@ -343,9 +346,6 @@ format_headers_message_part_json (GMimeMessage *message)\r
98                 json_quote_str (ctx_quote, "Cc"),\r
99                 json_quote_str (ctx_quote, recipients_string));\r
100      printf (", %s: %s",\r
101 -           json_quote_str (ctx_quote, "Subject"),\r
102 -           json_quote_str (ctx_quote, g_mime_message_get_subject (message)));\r
103 -    printf (", %s: %s",\r
104             json_quote_str (ctx_quote, "Date"),\r
105             json_quote_str (ctx_quote, g_mime_message_get_date_as_string (message)));\r
106  \r
107 diff --git a/test/multipart b/test/multipart\r
108 index 2dd73f5..4d14804 100755\r
109 --- a/test/multipart\r
110 +++ b/test/multipart\r
111 @@ -325,7 +325,7 @@ cat <<EOF >EXPECTED\r
112  {"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "filename": "${MAIL_DIR}/multipart", "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["attachment","inbox","signed","unread"], "headers": {"Subject": "Multipart message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Cc": "", "Bcc": "", "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [\r
113  {"id": 1, "content-type": "multipart/signed", "content": [\r
114  {"id": 2, "content-type": "multipart/mixed", "content": [\r
115 -{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Subject": "html message", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
116 +{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
117  {"id": 4, "content-type": "multipart/alternative", "content": [\r
118  {"id": 5, "content-type": "text/html"}, \r
119  {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}, \r
120 @@ -342,7 +342,7 @@ cat <<EOF >EXPECTED\r
121  \r
122  {"id": 1, "content-type": "multipart/signed", "content": [\r
123  {"id": 2, "content-type": "multipart/mixed", "content": [\r
124 -{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Subject": "html message", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
125 +{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
126  {"id": 4, "content-type": "multipart/alternative", "content": [\r
127  {"id": 5, "content-type": "text/html"}, \r
128  {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}, \r
129 @@ -358,7 +358,7 @@ echo >>OUTPUT # expect *no* newline at end of output\r
130  cat <<EOF >EXPECTED\r
131  \r
132  {"id": 2, "content-type": "multipart/mixed", "content": [\r
133 -{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Subject": "html message", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
134 +{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
135  {"id": 4, "content-type": "multipart/alternative", "content": [\r
136  {"id": 5, "content-type": "text/html"}, \r
137  {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}, \r
138 @@ -372,7 +372,7 @@ notmuch show --format=json --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' | s\r
139  echo >>OUTPUT # expect *no* newline at end of output\r
140  cat <<EOF >EXPECTED\r
141  \r
142 -{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Subject": "html message", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
143 +{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
144  {"id": 4, "content-type": "multipart/alternative", "content": [\r
145  {"id": 5, "content-type": "text/html"}, \r
146  {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}\r
147 -- \r
148 1.7.7.3\r
149 \r