unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@MIT.EDU>
To: notmuch@notmuchmail.org
Cc: tomi.ollila@iki.fi
Subject: [PATCH v4 2/3] show: Use consistent header ordering in the text format
Date: Mon, 23 Jan 2012 18:26:22 -0500	[thread overview]
Message-ID: <1327361183-18485-3-git-send-email-amdragon@mit.edu> (raw)
In-Reply-To: <1327361183-18485-1-git-send-email-amdragon@mit.edu>

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
 \fpart{ ID: 2, Content-type: multipart/mixed
 \fpart{ ID: 3, Content-type: message/rfc822
 \fheader{
+Subject: html message
 From: Carl Worth <cworth@cworth.org>
 To: cworth@cworth.org
-Subject: html message
 Date: Fri, 05 Jan 2001 15:42:57 +0000
 \fheader}
 \fbody{
@@ -162,9 +162,9 @@ cat <<EOF >EXPECTED
 \fpart{ ID: 2, Content-type: multipart/mixed
 \fpart{ ID: 3, Content-type: message/rfc822
 \fheader{
+Subject: html message
 From: Carl Worth <cworth@cworth.org>
 To: cworth@cworth.org
-Subject: html message
 Date: Fri, 05 Jan 2001 15:42:57 +0000
 \fheader}
 \fbody{
@@ -200,9 +200,9 @@ cat <<EOF >EXPECTED
 \fpart{ ID: 2, Content-type: multipart/mixed
 \fpart{ ID: 3, Content-type: message/rfc822
 \fheader{
+Subject: html message
 From: Carl Worth <cworth@cworth.org>
 To: cworth@cworth.org
-Subject: html message
 Date: Fri, 05 Jan 2001 15:42:57 +0000
 \fheader}
 \fbody{
@@ -233,9 +233,9 @@ notmuch show --format=text --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OU
 cat <<EOF >EXPECTED
 \fpart{ ID: 3, Content-type: message/rfc822
 \fheader{
+Subject: html message
 From: Carl Worth <cworth@cworth.org>
 To: cworth@cworth.org
-Subject: html message
 Date: Fri, 05 Jan 2001 15:42:57 +0000
 \fheader}
 \fbody{
@@ -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 <<EOF >EXPECTED
+Subject: html message
 From: Carl Worth <cworth@cworth.org>
 To: cworth@cworth.org
-Subject: html message
 Date: Fri, 05 Jan 2001 15:42:57 +0000
 
 <p>This is an embedded message, with a multipart/alternative part.</p>
@@ -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 <<EOF >EXPECTED
+Subject: html message
 From: Carl Worth <cworth@cworth.org>
 To: cworth@cworth.org
-Subject: html message
 Date: Fri, 05 Jan 2001 15:42:57 +0000
 
 <p>This is an embedded message, with a multipart/alternative part.</p>
-- 
1.7.7.3

  parent reply	other threads:[~2012-01-23 23:26 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18 20:28 [PATCH 0/3] Second step of 'show' rewrite Austin Clements
2012-01-18 20:28 ` [PATCH 1/3] mime node: Record depth-first part numbers Austin Clements
2012-01-18 22:25   ` Jani Nikula
2012-01-19  2:12     ` Austin Clements
2012-01-23  1:02       ` Austin Clements
2012-01-18 20:28 ` [PATCH 2/3] show: Use consistent header ordering in the text format Austin Clements
2012-01-20 13:45   ` Tomi Ollila
2012-01-18 20:28 ` [PATCH 3/3] show: Introduce mime_node formatter callback Austin Clements
2012-01-18 22:33   ` Jani Nikula
2012-01-19  2:23     ` Austin Clements
2012-01-18 20:35 ` [PATCH 0/3] Second step of 'show' rewrite Dmitry Kurochkin
2012-01-18 20:45   ` Austin Clements
2012-01-22 22:44 ` Jameson Graef Rollins
2012-01-23  2:31 ` [PATCH v2 " Austin Clements
2012-01-23  2:31   ` [PATCH v2 1/3] mime node: Record depth-first part numbers Austin Clements
2012-01-23 18:07     ` Jani Nikula
2012-01-23 21:36     ` Tomi Ollila
2012-01-23 22:19     ` Dmitry Kurochkin
2012-01-23 23:15       ` Austin Clements
2012-01-23  2:31   ` [PATCH v2 2/3] show: Use consistent header ordering in the text format Austin Clements
2012-01-23  2:31   ` [PATCH v2 3/3] show: Introduce mime_node formatter callback Austin Clements
2012-01-23 21:00     ` Tomi Ollila
2012-01-23 22:37     ` Dmitry Kurochkin
2012-01-23 23:23       ` Austin Clements
2012-01-23 20:28 ` [PATCH v3 0/2] Second step of 'show' rewrite Austin Clements
2012-01-23 20:29   ` [PATCH v3 1/2] mime node: Record depth-first part numbers Austin Clements
2012-01-23 20:29   ` [PATCH v3 2/2] show: Introduce mime_node formatter callback Austin Clements
2012-01-23 23:26 ` [PATCH v4 0/3] Second step of 'show' rewrite Austin Clements
2012-01-23 23:26   ` [PATCH v4 1/3] mime node: Record depth-first part numbers Austin Clements
2012-01-23 23:26   ` Austin Clements [this message]
2012-01-23 23:26   ` [PATCH v4 3/3] show: Introduce mime_node formatter callback Austin Clements
2012-01-23 23:33 ` [PATCH v5 0/2] Second step of 'show' rewrite Austin Clements
2012-01-23 23:33   ` [PATCH v5 1/2] mime node: Record depth-first part numbers Austin Clements
2012-01-23 23:36     ` Dmitry Kurochkin
2012-01-24  8:57     ` Tomi Ollila
2012-01-23 23:33   ` [PATCH v5 2/2] show: Introduce mime_node formatter callback Austin Clements
2012-01-23 23:36     ` Dmitry Kurochkin
2012-01-24  8:58     ` Tomi Ollila
2012-01-24 18:26     ` Jani Nikula
2012-01-25 11:33   ` [PATCH v5 0/2] Second step of 'show' rewrite David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1327361183-18485-3-git-send-email-amdragon@mit.edu \
    --to=amdragon@mit.edu \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).