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 4AAF5431FD0 for ; Wed, 18 Jan 2012 12:28:39 -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 KfgHFZBFspG7 for ; Wed, 18 Jan 2012 12:28:38 -0800 (PST) Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU [18.9.25.15]) by olra.theworths.org (Postfix) with ESMTP id 0AD9A431FAF for ; Wed, 18 Jan 2012 12:28:37 -0800 (PST) X-AuditID: 1209190f-b7f8a6d000000914-85-4f172b75da0e Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP id 88.1D.02324.57B271F4; Wed, 18 Jan 2012 15:28:37 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q0IKSbDI030570; Wed, 18 Jan 2012 15:28:37 -0500 Received: from drake.mit.edu (26-4-166.dynamic.csail.mit.edu [18.26.4.166]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0IKSZ9F015673 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Wed, 18 Jan 2012 15:28:36 -0500 (EST) Received: from amthrax by drake.mit.edu with local (Exim 4.77) (envelope-from ) id 1Rnc7Y-0007QC-3o; Wed, 18 Jan 2012 15:28:36 -0500 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH 2/3] show: Use consistent header ordering in the text format Date: Wed, 18 Jan 2012 15:28:26 -0500 Message-Id: <1326918507-28033-3-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1326918507-28033-1-git-send-email-amdragon@mit.edu> References: <1326918507-28033-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBIsWRmVeSWpSXmKPExsUixG6nrluqLe5v8PmAhkVr92cmi6tb+9kt mqY7W+zZ52Vx/eZMZgdWj7Pd7awed09zeeycdZfd49b91+wez1bdYg5gjeKySUnNySxLLdK3 S+DKOHhQtuCKTMXBZYdZGxhPi3cxcnJICJhI3H81mQ3CFpO4cG89kM3FISSwj1Fi08FzzBDO BkaJ/3ePsEM4x5kkDs97D1U2n1Fi4eaJrCD9bAIaEtv2L2cEsUUEpCV23p0NFmcWqJV49fcK 2A5hAR+JuccmgtWwCKhKNE05DFbDK+Ag8XruIhaIOxQkzq0+xw5icwo4Srz5+xWsXgioZu3P vYwTGPkXMDKsYpRNya3SzU3MzClOTdYtTk7My0st0jXRy80s0UtNKd3ECApATkn+HYzfDiod YhTgYFTi4Y0UEfcXYk0sK67MPcQoycGkJMpbpQkU4kvKT6nMSCzOiC8qzUktPsQowcGsJML7 hQ8ox5uSWFmVWpQPk5LmYFES51XTeucnJJCeWJKanZpakFoEk5Xh4FCS4F2jBdQoWJSanlqR lplTgpBm4uAEGc4DNHwJSA1vcUFibnFmOkT+FKOilDjvYZCEAEgiozQPrheWIF4xigO9Isy7 HKSKB5hc4LpfAQ1mAhrs0SQGMrgkESEl1cAoMXneH2m1+o3zFaanTLKWfDfj8LaaxqT+sk3n zb/KeXzhvBjw4/tRK+Z0q7acKUs+LGlVmqIt4K90wUDsU5btvuUPj0bZTrBaoS9ov+Q1A2fJ 9o4l0yv8/JSuZXzWvKwnO236B84PstUP5kR0FlQc3ew03Vi9oqAx/3LsZyaFl4t44gua+I4o sRRnJBpqMRcVJwIAhERr/esCAAA= Cc: dkg@fifthhorseman.net 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: Wed, 18 Jan 2012 20:28:39 -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 d14dac9..ecadfa8 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