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 E8583429E25 for ; Wed, 11 Jan 2012 17:49:45 -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 IzbsmYyJrszL for ; Wed, 11 Jan 2012 17:49:45 -0800 (PST) Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU [18.7.68.37]) by olra.theworths.org (Postfix) with ESMTP id 2EEE9431FB6 for ; Wed, 11 Jan 2012 17:49:45 -0800 (PST) X-AuditID: 12074425-b7f4a6d0000008e0-64-4f0e3c38f52f Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP id 1C.4A.02272.83C3E0F4; Wed, 11 Jan 2012 20:49:44 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q0C1niRS005934; Wed, 11 Jan 2012 20:49:44 -0500 Received: from drake.mit.edu (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com [209.6.116.242]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0C1ng3H001513 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Wed, 11 Jan 2012 20:49:44 -0500 (EST) Received: from amthrax by drake.mit.edu with local (Exim 4.77) (envelope-from ) id 1Rl9nS-000809-EE; Wed, 11 Jan 2012 20:49:42 -0500 From: Austin Clements To: notmuch@notmuchmail.org Subject: [RFC PATCH 3/5] show: Use consistent header ordering in the text format Date: Wed, 11 Jan 2012 20:49:31 -0500 Message-Id: <1326332973-30225-4-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1326332973-30225-1-git-send-email-amdragon@mit.edu> References: <1326332973-30225-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsUixCmqrWthw+dvMP26nsX1mzOZHRg9nq26 xRzAGMVlk5Kak1mWWqRvl8CVMWGnUcEVmYo12w8zNzCeFu9i5OCQEDCROPDMoouRE8gUk7hw bz1bFyMXh5DAPkaJRWeXs0M4Gxgljt1/wgrh3GeS+LHyHBOEM59RYmPHBSaQfjYBDYlt+5cz gtgiAtISO+/OZgVZwSwgIvFuJliJsECAxN+Hh9hBbBYBVYnG66fBynkFHCQOzlvBBnGGgsS5 1efAajgFHCX6jx8DiwsB1bzY+ZR5AiP/AkaGVYyyKblVurmJmTnFqcm6xcmJeXmpRboWermZ JXqpKaWbGEEhw+6iuoNxwiGlQ4wCHIxKPLw79vL6C7EmlhVX5h5ilORgUhLl/W7F5y/El5Sf UpmRWJwRX1Sak1p8iFGCg1lJhNepBqicNyWxsiq1KB8mJc3BoiTOq6n1zk9IID2xJDU7NbUg tQgmK8PBoSTBu94aaKhgUWp6akVaZk4JQpqJgxNkOA/Q8AyQGt7igsTc4sx0iPwpRkUpcV53 kIQASCKjNA+uFxbTrxjFgV4R5l0LUsUDTAdw3a+ABjMBDd6yjgdkcEkiQkqqgTE0etmWbNHP VdsXiS558lSJaTv3ipk89gWOL+9NXr/l03Xh2Umc8lK3j+4qEvokuU9zd82Fy8+W3WdQXjN1 m+PqU6x/GkI9DeN0k61Ef7tGMeVqsiy85WPqxmG/1bdj8VGTTf0pvS2vazlWqUw9+yQu58u9 a/+PPteYs/zqjSOfa7rFj+eeuPtaiaU4I9FQi7moOBEA7Z1S28QCAAA= 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: Thu, 12 Jan 2012 01:49:46 -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 45c3569..ad54d69 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -360,6 +360,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); @@ -371,7 +372,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