Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 2C373429E54 for ; Mon, 23 Jan 2012 15:26:42 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled 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 xGKkEST9aSKc for ; Mon, 23 Jan 2012 15:26:41 -0800 (PST) Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU [18.9.25.14]) by olra.theworths.org (Postfix) with ESMTP id 6B2C7429E21 for ; Mon, 23 Jan 2012 15:26:41 -0800 (PST) X-AuditID: 1209190e-b7f7c6d0000008c3-6a-4f1decb0b4fb Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP id 28.0E.02243.0BCED1F4; Mon, 23 Jan 2012 18:26:40 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q0NNQe75027444; Mon, 23 Jan 2012 18:26:40 -0500 Received: from drake.mit.edu (26-4-180.dynamic.csail.mit.edu [18.26.4.180]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0NNQbYM024567 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Mon, 23 Jan 2012 18:26:39 -0500 (EST) Received: from amthrax by drake.mit.edu with local (Exim 4.77) (envelope-from ) id 1RpTHZ-0004qP-1D; Mon, 23 Jan 2012 18:26:37 -0500 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH v4 2/3] show: Use consistent header ordering in the text format Date: Mon, 23 Jan 2012 18:26:22 -0500 Message-Id: <1327361183-18485-3-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1327361183-18485-1-git-send-email-amdragon@mit.edu> References: <1326918507-28033-1-git-send-email-amdragon@mit.edu> <1327361183-18485-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrHIsWRmVeSWpSXmKPExsUixG6norvhjay/wdFmS4urW/vZLZqmO1tc vzmT2eLNynmsDiweO2fdZfc4/HUhi8et+6/ZPZ6tusUcwBLFZZOSmpNZllqkb5fAlTHx3QH2 gisyFXsfbmZrYDwt3sXIySEhYCJxfG87M4QtJnHh3nq2LkYuDiGBfYwST+/NZ4VwNjBKvFz3 kQnCOc4kMffuZyhnPqPE+wdH2UH62QQ0JLbtX84IYosISEvsvDsbqJ2Dg1mgQGLyBWMQU1jA X+L0kQQQk0VAVeL7AQOQYl4BB4nzzRNZIY5QkDi3+hzYQE4BR4k/jR1gcSGBcom2W8dZJjDy L2BkWMUom5JbpZubmJlTnJqsW5ycmJeXWqRrrJebWaKXmlK6iREUbJySfDsYvx5UOsQowMGo xMN7YJqsvxBrYllxZe4hRkkOJiVRXtfXQCG+pPyUyozE4oz4otKc1OJDjBIczEoivGrngHK8 KYmVValF+TApaQ4WJXFeNa13fkIC6YklqdmpqQWpRTBZGQ4OJQleLmBUCQkWpaanVqRl5pQg pJk4OEGG8wANZwCp4S0uSMwtzkyHyJ9iVJQS5z0GcpEASCKjNA+uF5YMXjGKA70izHsJpIoH mEjgul8BDWYCGsyRJwUyuCQRISXVwMiw2n6T5o3eXvk/bDdVnOuiKk1zZ1r0LN92eAKLk0xE 8S32un9zj97i3xr1IXfpmkNnV8zrK7x7bO3iZdPnzZEsCV5rLLTT8tnDQ+FOM35MjGya0Xxj 95KFmy/H/9v7UjR/SqedaFxdke9f6UsC9S8OVk2Kj1zDr2VTcfC54NugV5/sz65cOU1BiaU4 I9FQi7moOBEAd8a2Y+ECAAA= Cc: tomi.ollila@iki.fi 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: Mon, 23 Jan 2012 23:26:42 -0000 Previously, top-level message headers were printed as Subject, From, To, Date, while embedded message headers were printed From, To, Subject, Date. This makes both cases use the former order and updates the tests accordingly. Strangely, the raw format also uses this function, so this also fixes the two raw format tests affected by this change. --- notmuch-show.c | 2 +- test/multipart | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/notmuch-show.c b/notmuch-show.c index 7b40568..682aa71 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -364,6 +364,7 @@ format_headers_message_part_text (GMimeMessage *message) InternetAddressList *recipients; const char *recipients_string; + printf ("Subject: %s\n", g_mime_message_get_subject (message)); printf ("From: %s\n", g_mime_message_get_sender (message)); recipients = g_mime_message_get_recipients (message, GMIME_RECIPIENT_TYPE_TO); recipients_string = internet_address_list_to_string (recipients, 0); @@ -375,7 +376,6 @@ format_headers_message_part_text (GMimeMessage *message) if (recipients_string) printf ("Cc: %s\n", recipients_string); - printf ("Subject: %s\n", g_mime_message_get_subject (message)); printf ("Date: %s\n", g_mime_message_get_date_as_string (message)); } diff --git a/test/multipart b/test/multipart index f83526b..2dd73f5 100755 --- a/test/multipart +++ b/test/multipart @@ -121,9 +121,9 @@ Date: Fri, 05 Jan 2001 15:43:57 +0000 part{ ID: 2, Content-type: multipart/mixed part{ ID: 3, Content-type: message/rfc822 header{ +Subject: html message From: Carl Worth To: cworth@cworth.org -Subject: html message Date: Fri, 05 Jan 2001 15:42:57 +0000 header} body{ @@ -162,9 +162,9 @@ cat <EXPECTED part{ ID: 2, Content-type: multipart/mixed part{ ID: 3, Content-type: message/rfc822 header{ +Subject: html message From: Carl Worth To: cworth@cworth.org -Subject: html message Date: Fri, 05 Jan 2001 15:42:57 +0000 header} body{ @@ -200,9 +200,9 @@ cat <EXPECTED part{ ID: 2, Content-type: multipart/mixed part{ ID: 3, Content-type: message/rfc822 header{ +Subject: html message From: Carl Worth To: cworth@cworth.org -Subject: html message Date: Fri, 05 Jan 2001 15:42:57 +0000 header} body{ @@ -233,9 +233,9 @@ notmuch show --format=text --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OU cat <EXPECTED part{ ID: 3, Content-type: message/rfc822 header{ +Subject: html message From: Carl Worth To: cworth@cworth.org -Subject: html message Date: Fri, 05 Jan 2001 15:42:57 +0000 header} body{ @@ -452,9 +452,9 @@ notmuch show --format=raw --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUT # output should *not* include newline echo >>OUTPUT cat <EXPECTED +Subject: html message From: Carl Worth To: cworth@cworth.org -Subject: html message Date: Fri, 05 Jan 2001 15:42:57 +0000

This is an embedded message, with a multipart/alternative part.

@@ -476,9 +476,9 @@ test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "--format=raw --part=2, multipart/mixed" notmuch show --format=raw --part=2 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT cat <EXPECTED +Subject: html message From: Carl Worth To: cworth@cworth.org -Subject: html message Date: Fri, 05 Jan 2001 15:42:57 +0000

This is an embedded message, with a multipart/alternative part.

-- 1.7.7.3