[PATCH 2/2] test: move all emacs show tests to emacs-show test script
authorJameson Graef Rollins <jrollins@finestructure.net>
Sun, 12 Aug 2012 17:39:28 +0000 (10:39 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:03 +0000 (09:49 -0800)
0a/9b1632d7f330d3196bea5100baa2d79c59b823 [new file with mode: 0644]

diff --git a/0a/9b1632d7f330d3196bea5100baa2d79c59b823 b/0a/9b1632d7f330d3196bea5100baa2d79c59b823
new file mode 100644 (file)
index 0000000..3a66298
--- /dev/null
@@ -0,0 +1,945 @@
+Return-Path: <jrollins@finestructure.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id CDBE5431FC4\r
+       for <notmuch@notmuchmail.org>; Sun, 12 Aug 2012 10:39:50 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id p4gO8qBhQKiv for <notmuch@notmuchmail.org>;\r
+       Sun, 12 Aug 2012 10:39:39 -0700 (PDT)\r
+Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
+       [131.215.239.19])\r
+       by olra.theworths.org (Postfix) with ESMTP id 7A44D431FBD\r
+       for <notmuch@notmuchmail.org>; Sun, 12 Aug 2012 10:39:37 -0700 (PDT)\r
+Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
+       by earth-doxen-postvirus (Postfix) with ESMTP id 42A6766E0011\r
+       for <notmuch@notmuchmail.org>; Sun, 12 Aug 2012 10:39:35 -0700 (PDT)\r
+X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
+Received: from finestructure.net (unknown [76.89.192.57])\r
+       (Authenticated sender: jrollins)\r
+       by earth-doxen-submit (Postfix) with ESMTP id 35A9866E00AD\r
+       for <notmuch@notmuchmail.org>; Sun, 12 Aug 2012 10:39:30 -0700 (PDT)\r
+Received: by finestructure.net (Postfix, from userid 1000)\r
+       id CA276244; Sun, 12 Aug 2012 10:39:28 -0700 (PDT)\r
+From: Jameson Graef Rollins <jrollins@finestructure.net>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: [PATCH 2/2] test: move all emacs show tests to emacs-show test script\r
+Date: Sun, 12 Aug 2012 10:39:28 -0700\r
+Message-Id: <1344793168-23555-2-git-send-email-jrollins@finestructure.net>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <1344793168-23555-1-git-send-email-jrollins@finestructure.net>\r
+References: <87r4rf9q8x.fsf@qmul.ac.uk>\r
+       <1344793168-23555-1-git-send-email-jrollins@finestructure.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 12 Aug 2012 17:39:51 -0000\r
+\r
+No functional change.\r
+\r
+Most notmuch-show mode tests were in the emacs script, while some were\r
+in the emacs-show script.  This moves all the notmuch-show mode tests\r
+to the emacs-show script, to make things a little more consistent.\r
+---\r
+This patch is not necessary, but I think it makes the emacs tests\r
+clearer, by not having tests for show-mode split across multiple test\r
+scripts.\r
+\r
+ test/emacs      |  397 +----------------------------------------------------\r
+ test/emacs-show |  409 +++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+ 2 files changed, 410 insertions(+), 396 deletions(-)\r
+\r
+diff --git a/test/emacs b/test/emacs\r
+index afe35ba..9cb5795 100755\r
+--- a/test/emacs\r
++++ b/test/emacs\r
+@@ -54,49 +54,6 @@ test_emacs '(notmuch-hello)\r
+           (test-output)'\r
+ test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-view-inbox\r
\r
+-test_begin_subtest "Basic notmuch-show view in emacs"\r
+-maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)\r
+-test_emacs "(notmuch-show \"$maildir_storage_thread\")\r
+-          (test-output)"\r
+-test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage\r
+-\r
+-test_begin_subtest "Basic notmuch-show view in emacs default indentation"\r
+-maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)\r
+-test_emacs "(let ((notmuch-show-indent-messages-width 1))\r
+-            (notmuch-show \"$maildir_storage_thread\")\r
+-            (test-output))"\r
+-test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage\r
+-\r
+-test_begin_subtest "Basic notmuch-show view in emacs without indentation"\r
+-maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)\r
+-test_emacs "(let ((notmuch-show-indent-messages-width 0))\r
+-            (notmuch-show \"$maildir_storage_thread\")\r
+-            (test-output))"\r
+-test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage-without-indentation\r
+-\r
+-test_begin_subtest "Basic notmuch-show view in emacs with fourfold indentation"\r
+-maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)\r
+-test_emacs "(let ((notmuch-show-indent-messages-width 4))\r
+-            (notmuch-show \"$maildir_storage_thread\")\r
+-            (test-output))"\r
+-test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage-with-fourfold-indentation\r
+-\r
+-test_begin_subtest "notmuch-show for message with invalid From"\r
+-add_message "[subject]=\"message-with-invalid-from\"" \\r
+-          "[from]=\"\\\"Invalid \\\" From\\\" <test_suite@notmuchmail.org>\""\r
+-thread=$(notmuch search --output=threads subject:message-with-invalid-from)\r
+-test_emacs "(notmuch-show \"$thread\")\r
+-          (test-output)"\r
+-cat <<EOF >EXPECTED\r
+-"Invalid " (2001-01-05) (inbox)\r
+-Subject: message-with-invalid-from\r
+-To: Notmuch Test Suite <test_suite@notmuchmail.org>\r
+-Date: Fri, 05 Jan 2001 15:43:57 +0000\r
+-\r
+-This is just a test message (#1)\r
+-EOF\r
+-test_expect_equal_file OUTPUT EXPECTED\r
+-\r
+ test_begin_subtest "Navigation of notmuch-search to thread view"\r
+ test_emacs '(notmuch-search "tag:inbox")\r
+           (notmuch-test-wait)\r
+@@ -122,18 +79,6 @@ test_emacs "(notmuch-search \"$os_x_darwin_thread\")\r
+ output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)\r
+ test_expect_equal "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"\r
\r
+-test_begin_subtest "Add tag from notmuch-show view"\r
+-test_emacs "(notmuch-show \"$os_x_darwin_thread\")\r
+-          (execute-kbd-macro \"+tag-from-show-view\")"\r
+-output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)\r
+-test_expect_equal "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox tag-from-show-view unread)"\r
+-\r
+-test_begin_subtest "Remove tag from notmuch-show view"\r
+-test_emacs "(notmuch-show \"$os_x_darwin_thread\")\r
+-          (execute-kbd-macro \"-tag-from-show-view\")"\r
+-output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)\r
+-test_expect_equal "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"\r
+-\r
+ test_begin_subtest "Message with .. in Message-Id:"\r
+ add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"'\r
+ test_emacs '(notmuch-search "id:\"123..456@example\"")\r
+@@ -351,248 +296,7 @@ Sender <sender@example.com> writes:\r
+ EOF\r
+ test_expect_equal_file OUTPUT EXPECTED\r
\r
+-test_begin_subtest "Reply within emacs to a multipart/mixed message"\r
+-test_emacs '(let ((message-hidden-headers ''()))\r
+-          (notmuch-show "id:20091118002059.067214ed@hikari")\r
+-              (notmuch-show-reply)\r
+-              (test-output))'\r
+-sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT\r
+-cat <<EOF >EXPECTED\r
+-From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
+-To: Adrian Perez de Castro <aperez@igalia.com>, notmuch@notmuchmail.org\r
+-Subject: Re: [notmuch] Introducing myself\r
+-In-Reply-To: <20091118002059.067214ed@hikari>\r
+-Fcc: ${MAIL_DIR}/sent\r
+-References: <20091118002059.067214ed@hikari>\r
+-User-Agent: Notmuch/XXX Emacs/XXX\r
+---text follows this line--\r
+-Adrian Perez de Castro <aperez@igalia.com> writes:\r
+-\r
+-> Hello to all,\r
+->\r
+-> I have just heard about Not Much today in some random Linux-related news\r
+-> site (LWN?), my name is Adrian Perez and I work as systems administrator\r
+-> (although I can do some code as well :P). I have always thought that the\r
+-> ideas behind Sup were great, but after some time using it, I got tired of\r
+-> the oddities that it has. I also do not like doing things like having to\r
+-> install Ruby just for reading and sorting mails. Some time ago I thought\r
+-> about doing something like Not Much and in fact I played a bit with the\r
+-> Python+Xapian and the Python+Whoosh combinations, because I find relaxing\r
+-> to code things in Python when I am not working and also it is installed\r
+-> by default on most distribution. I got to have some mailboxes indexed and\r
+-> basic searching working a couple of months ago. Lately I have been very\r
+-> busy and had no time for coding, and them... boom! Not Much appears -- and\r
+-> it is almost exactly what I was trying to do, but faster. I have been\r
+-> playing a bit with Not Much today, and I think it has potential.\r
+->\r
+-> Also, I would like to share one idea I had in mind, that you might find\r
+-> interesting: One thing I have found very annoying is having to re-tag my\r
+-> mail when the indexes get b0rked (it happened a couple of times to me while\r
+-> using Sup), so I was planning to mails as read/unread and adding the tags\r
+-> not just to the index, but to the mail text itself, e.g. by adding a\r
+-> "X-Tags" header field or by reusing the "Keywords" one. This way, the index\r
+-> could be totally recreated by re-reading the mail directories, and this\r
+-> would also allow to a tools like OfflineIMAP [1] to get the mails into a\r
+-> local maildir, tagging and indexing the mails with the e-mail reader and\r
+-> then syncing back the messages with the "X-Tags" header to the IMAP server.\r
+-> This would allow to use the mail reader from a different computer and still\r
+-> have everything tagged finely.\r
+->\r
+-> Best regards,\r
+->\r
+->\r
+-> ---\r
+-> [1] http://software.complete.org/software/projects/show/offlineimap\r
+->\r
+-> -- \r
+-> Adrian Perez de Castro <aperez@igalia.com>\r
+-> Igalia - Free Software Engineering\r
+-> _______________________________________________\r
+-> notmuch mailing list\r
+-> notmuch@notmuchmail.org\r
+-> http://notmuchmail.org/mailman/listinfo/notmuch\r
+-EOF\r
+-test_expect_equal_file OUTPUT EXPECTED\r
+-\r
+-test_begin_subtest "Reply within emacs to a multipart/alternative message"\r
+-test_emacs '(let ((message-hidden-headers ''()))\r
+-          (notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")\r
+-              (notmuch-show-reply)\r
+-              (test-output))'\r
+-sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT\r
+-cat <<EOF >EXPECTED\r
+-From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
+-To: Alex Botero-Lowry <alex.boterolowry@gmail.com>, notmuch@notmuchmail.org\r
+-Subject: Re: [notmuch] preliminary FreeBSD support\r
+-In-Reply-To: <cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com>\r
+-Fcc: ${MAIL_DIR}/sent\r
+-References: <cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com>\r
+-User-Agent: Notmuch/XXX Emacs/XXX\r
+---text follows this line--\r
+-Alex Botero-Lowry <alex.boterolowry@gmail.com> writes:\r
+-\r
+-> I saw the announcement this morning, and was very excited, as I had been\r
+-> hoping sup would be turned into a library,\r
+-> since I like the concept more than the UI (I'd rather an emacs interface).\r
+->\r
+-> I did a preliminary compile which worked out fine, but\r
+-> sysconf(_SC_SC_GETPW_R_SIZE_MAX) returns -1 on\r
+-> FreeBSD, so notmuch_config_open segfaulted.\r
+->\r
+-> Attached is a patch that supplies a default buffer size of 64 in cases where\r
+-> -1 is returned.\r
+->\r
+-> http://www.opengroup.org/austin/docs/austin_328.txt - seems to indicate this\r
+-> is acceptable behavior,\r
+-> and http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/07/msg016808.htmlspecifically\r
+-> uses 64 as the\r
+-> buffer size.\r
+-> _______________________________________________\r
+-> notmuch mailing list\r
+-> notmuch@notmuchmail.org\r
+-> http://notmuchmail.org/mailman/listinfo/notmuch\r
+-EOF\r
+-test_expect_equal_file OUTPUT EXPECTED\r
+-\r
+-test_begin_subtest "Reply within emacs to an html-only message"\r
+-add_message '[content-type]="text/html"' \\r
+-          '[body]="Hi,<br />This is an <b>HTML</b> test message.<br /><br />OK?"'\r
+-test_emacs "(let ((message-hidden-headers '()) (mm-text-html-renderer 'html2text))\r
+-          (notmuch-show \"id:${gen_msg_id}\")\r
+-          (notmuch-show-reply)\r
+-          (test-output))"\r
+-sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT\r
+-cat <<EOF >EXPECTED\r
+-From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
+-To: \r
+-Subject: Re: Reply within emacs to an html-only message\r
+-In-Reply-To: <${gen_msg_id}>\r
+-Fcc: ${MAIL_DIR}/sent\r
+-References: <${gen_msg_id}>\r
+-User-Agent: Notmuch/XXX Emacs/XXX\r
+---text follows this line--\r
+-Notmuch Test Suite <test_suite@notmuchmail.org> writes:\r
+-\r
+-> Hi,This is an HTML test message.OK?\r
+-EOF\r
+-test_expect_equal_file OUTPUT EXPECTED\r
+-\r
+-test_begin_subtest "Quote MML tags in reply"\r
+-message_id='test-emacs-mml-quoting@message.id'\r
+-add_message [id]="$message_id" \\r
+-          "[subject]='$test_subtest_name'" \\r
+-          '[body]="<#part disposition=inline>"'\r
+-test_emacs "(let ((message-hidden-headers '()))\r
+-            (notmuch-show \"id:$message_id\")\r
+-            (notmuch-show-reply)\r
+-            (test-output))"\r
+-sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT\r
+-cat <<EOF >EXPECTED\r
+-From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
+-To: \r
+-Subject: Re: Quote MML tags in reply\r
+-In-Reply-To: <test-emacs-mml-quoting@message.id>\r
+-Fcc: ${MAIL_DIR}/sent\r
+-References: <test-emacs-mml-quoting@message.id>\r
+-User-Agent: Notmuch/XXX Emacs/XXX\r
+---text follows this line--\r
+-Notmuch Test Suite <test_suite@notmuchmail.org> writes:\r
+-\r
+-> <#!part disposition=inline>\r
+-EOF\r
+-test_expect_equal_file OUTPUT EXPECTED\r
+-\r
+-test_begin_subtest "Save attachment from within emacs using notmuch-show-save-attachments"\r
+-# save as archive to test that Emacs does not re-compress .gz\r
+-test_emacs '(let ((standard-input "\"attachment1.gz\""))\r
+-            (notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")\r
+-            (notmuch-show-save-attachments))'\r
+-test_expect_equal_file attachment1.gz "$EXPECTED/attachment"\r
+-\r
+-test_begin_subtest "Save attachment from within emacs using notmuch-show-save-part"\r
+-# save as archive to test that Emacs does not re-compress .gz\r
+-test_emacs '(let ((standard-input "\"attachment2.gz\""))\r
+-            (notmuch-show-save-part "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com" 5))'\r
+-test_expect_equal_file attachment2.gz "$EXPECTED/attachment"\r
+-\r
+-test_begin_subtest "View raw message within emacs"\r
+-test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")\r
+-          (notmuch-show-view-raw-message)\r
+-          (test-output)'\r
+-test_expect_equal_file OUTPUT $EXPECTED/raw-message-cf0c4d-52ad0a\r
+-\r
+-test_begin_subtest "Hiding/showing signature in notmuch-show view"\r
+-maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)\r
+-test_emacs "(notmuch-show \"$maildir_storage_thread\")\r
+-          (search-forward \"Click/Enter to show.\")\r
+-          (button-activate (button-at (point)))\r
+-          (search-backward \"Click/Enter to hide.\")\r
+-          (button-activate (button-at (point)))\r
+-          (test-output)"\r
+-test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage\r
+-\r
+-test_begin_subtest "Detection and hiding of top-post quoting of message"\r
+-add_message '[subject]="The problem with top-posting"' \\r
+-          [id]=top-post-target \\r
+-          '[body]="A: Because it messes up the order in which people normally read text.\r
+-Q: Why is top-posting such a bad thing?\r
+-A: Top-posting.\r
+-Q: What is the most annoying thing in e-mail?"'\r
+-add_message '[from]="Top Poster <top@poster.com>"' \\r
+-          [in-reply-to]=top-post-target \\r
+-          [references]=top-post-target \\r
+-          '[subject]="Re: The problem with top-posting"' \\r
+-          '[body]="Thanks for the advice! I will be sure to put it to good use.\r
+-\r
+--Top Poster\r
+-\r
+------ Original Message -----\r
+-From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
+-To: Notmuch Test Suite <test_suite@notmuchmai.org>\r
+-Sent: Fri, 05 Jan 2001 15:43:57 +0000\r
+-Subject: The problem with top-posting\r
+-\r
+-Q: Why is top-posting such a bad thing?\r
+-A: Top-posting.\r
+-Q: What is the most annoying thing in e-mail?"'\r
+-test_emacs "(notmuch-show \"top-posting\")\r
+-          (test-visible-output)"\r
+-echo "Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox)\r
+-Subject: The problem with top-posting\r
+-To: Notmuch Test Suite <test_suite@notmuchmail.org>\r
+-Date: Fri, 05 Jan 2001 15:43:57 +0000\r
+-\r
+-A: Because it messes up the order in which people normally read text.\r
+-Q: Why is top-posting such a bad thing?\r
+-A: Top-posting.\r
+-Q: What is the most annoying thing in e-mail?\r
+-Top Poster <top@poster.com> (2001-01-05) (inbox unread)\r
+-Subject: Re: The problem with top-posting\r
+-To: Notmuch Test Suite <test_suite@notmuchmail.org>\r
+-Date: Fri, 05 Jan 2001 15:43:57 +0000\r
+-\r
+-Thanks for the advice! I will be sure to put it to good use.\r
+-\r
+--Top Poster\r
+-\r
+-[ 9-line hidden original message. Click/Enter to show. ]" > EXPECTED\r
+-test_expect_equal_file OUTPUT EXPECTED\r
+-\r
+-test_begin_subtest "Hiding message in notmuch-show view"\r
+-test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")\r
+-          (notmuch-show-toggle-message)\r
+-          (test-visible-output)'\r
+-test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages\r
+-\r
+-test_begin_subtest "Hiding message with visible citation in notmuch-show view"\r
+-test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")\r
+-          (search-forward "Click/Enter to show.")\r
+-          (button-activate (button-at (point)))\r
+-          (notmuch-show-toggle-message)\r
+-          (test-visible-output)'\r
+-test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages\r
+-\r
+-test_begin_subtest "Stashing in notmuch-show"\r
++test_begin_subtest "Stashing in notmuch-search"\r
+ add_message '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' \\r
+     '[from]="Some One <someone@somewhere.org>"' \\r
+     '[to]="Some One Else <notsomeone@somewhere.org>"' \\r
+@@ -601,44 +305,6 @@ add_message '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' \\r
+     '[id]="bought"' \\r
+     '[body]="Unable to stash body. Where did you get it in the first place?!?"'\r
+ notmuch tag +stashtest id:${gen_msg_id}\r
+-test_emacs '(notmuch-show "id:\"bought\"")\r
+-      (notmuch-show-stash-date)\r
+-      (notmuch-show-stash-from)\r
+-      (notmuch-show-stash-to)\r
+-      (notmuch-show-stash-cc)\r
+-      (notmuch-show-stash-subject)\r
+-      (notmuch-show-stash-message-id)\r
+-      (notmuch-show-stash-message-id-stripped)\r
+-      (notmuch-show-stash-tags)\r
+-      (notmuch-show-stash-filename)\r
+-      (notmuch-show-stash-mlarchive-link "Gmane")\r
+-      (notmuch-show-stash-mlarchive-link "MARC")\r
+-      (notmuch-show-stash-mlarchive-link "Mail Archive, The")\r
+-      (switch-to-buffer\r
+-        (generate-new-buffer "*test-stashing*"))\r
+-      (dotimes (i 12)\r
+-        (yank)\r
+-        (insert "\n")\r
+-        (rotate-yank-pointer 1))\r
+-      (reverse-region (point-min) (point-max))\r
+-          (test-output)'\r
+-cat <<EOF >EXPECTED\r
+-Sat, 01 Jan 2000 12:00:00 +0000\r
+-Some One <someone@somewhere.org>\r
+-Some One Else <notsomeone@somewhere.org>\r
+-Notmuch <notmuch@notmuchmail.org>\r
+-Stash my stashables\r
+-id:"bought"\r
+-bought\r
+-inbox,stashtest\r
+-${gen_msg_filename}\r
+-http://mid.gmane.org/bought\r
+-http://marc.info/?i=bought\r
+-http://mail-archive.com/search?l=mid&q=bought\r
+-EOF\r
+-test_expect_equal_file OUTPUT EXPECTED\r
+-\r
+-test_begin_subtest "Stashing in notmuch-search"\r
+ test_emacs '(notmuch-search "id:\"bought\"")\r
+       (notmuch-test-wait)\r
+       (notmuch-search-stash-thread-id)\r
+@@ -649,67 +315,6 @@ test_emacs '(notmuch-search "id:\"bought\"")\r
+ sed -i -e 's/^thread:.*$/thread:XXX/' OUTPUT\r
+ test_expect_equal "$(cat OUTPUT)" "thread:XXX"\r
\r
+-test_begin_subtest 'notmuch-show-advance-and-archive with invisible signature'\r
+-message1='id:20091118010116.GC25380@dottiness.seas.harvard.edu'\r
+-message2='id:1258491078-29658-1-git-send-email-dottedmag@dottedmag.net'\r
+-test_emacs "(notmuch-search \"$message1 or $message2\")\r
+-          (notmuch-test-wait)\r
+-          (notmuch-search-show-thread)\r
+-          (goto-char (point-max))\r
+-          (redisplay)\r
+-          (notmuch-show-advance-and-archive)\r
+-          (test-output)"\r
+-test_emacs "(notmuch-show \"$message2\")\r
+-          (test-output \"EXPECTED\")"\r
+-test_expect_equal_file OUTPUT EXPECTED\r
+-\r
+-test_begin_subtest "Refresh show buffer"\r
+-test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")\r
+-          (test-visible-output "EXPECTED")\r
+-          (notmuch-show-refresh-view)\r
+-          (test-visible-output)'\r
+-test_expect_equal_file OUTPUT EXPECTED\r
+-\r
+-test_begin_subtest "Refresh modified show buffer"\r
+-test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")\r
+-          (notmuch-show-toggle-message)\r
+-          (notmuch-show-next-message)\r
+-          (notmuch-show-toggle-message)\r
+-          (test-visible-output "EXPECTED")\r
+-          (notmuch-show-refresh-view)\r
+-          (test-visible-output)'\r
+-test_expect_equal_file OUTPUT EXPECTED\r
+-\r
+-test_begin_subtest "Do not call notmuch for non-inlinable application/mpeg parts"\r
+-id='message-with-application/mpeg-attachment@notmuchmail.org'\r
+-emacs_deliver_message \\r
+-    'Message with application/mpeg attachment' \\r
+-    '' \\r
+-    "(message-goto-eoh)\r
+-     (insert \"Message-ID: <$id>\n\")\r
+-     (message-goto-body)\r
+-     (mml-insert-part \"application/mpeg\")\r
+-     (insert \"a fake mp3 file\")"\r
+-notmuch_counter_reset\r
+-test_emacs "(let ((notmuch-command \"$notmuch_counter_command\"))\r
+-            (notmuch-show \"id:$id\"))"\r
+-test_expect_equal $(notmuch_counter_value) 1\r
+-\r
+-test_begin_subtest "Do not call notmuch for non-inlinable audio/mpeg parts"\r
+-id='message-with-audio/mpeg-attachment@notmuchmail.org'\r
+-emacs_deliver_message \\r
+-    'Message with audio/mpeg attachment' \\r
+-    '' \\r
+-    "(message-goto-eoh)\r
+-     (insert \"Message-ID: <$id>\n\")\r
+-     (message-goto-body)\r
+-     (mml-insert-part \"audio/mpeg\")\r
+-     (insert \"a fake mp3 file\")"\r
+-notmuch_counter_reset\r
+-test_emacs "(let ((notmuch-command \"$notmuch_counter_command\"))\r
+-            (notmuch-show \"id:$id\"))"\r
+-test_expect_equal $(notmuch_counter_value) 1\r
+-\r
+ test_begin_subtest "notmuch-hello-mode hook is called"\r
+ counter=$(test_emacs \\r
+     '(let ((notmuch-hello-mode-hook-counter 0))\r
+diff --git a/test/emacs-show b/test/emacs-show\r
+index 695f929..923a808 100755\r
+--- a/test/emacs-show\r
++++ b/test/emacs-show\r
+@@ -3,6 +3,67 @@\r
+ test_description="emacs notmuch-show view"\r
+ . test-lib.sh\r
\r
++EXPECTED=$TEST_DIRECTORY/emacs.expected-output\r
++\r
++add_email_corpus\r
++\r
++test_begin_subtest "Basic notmuch-show view"\r
++maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)\r
++test_emacs "(notmuch-show \"$maildir_storage_thread\")\r
++          (test-output)"\r
++test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage\r
++\r
++test_begin_subtest "Basic notmuch-show view default indentation"\r
++maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)\r
++test_emacs "(let ((notmuch-show-indent-messages-width 1))\r
++            (notmuch-show \"$maildir_storage_thread\")\r
++            (test-output))"\r
++test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage\r
++\r
++test_begin_subtest "Basic notmuch-show view without indentation"\r
++maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)\r
++test_emacs "(let ((notmuch-show-indent-messages-width 0))\r
++            (notmuch-show \"$maildir_storage_thread\")\r
++            (test-output))"\r
++test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage-without-indentation\r
++\r
++test_begin_subtest "Basic notmuch-show view with fourfold indentation"\r
++maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)\r
++test_emacs "(let ((notmuch-show-indent-messages-width 4))\r
++            (notmuch-show \"$maildir_storage_thread\")\r
++            (test-output))"\r
++test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage-with-fourfold-indentation\r
++\r
++test_begin_subtest "Message with invalid From"\r
++add_message "[subject]=\"message-with-invalid-from\"" \\r
++          "[from]=\"\\\"Invalid \\\" From\\\" <test_suite@notmuchmail.org>\""\r
++thread=$(notmuch search --output=threads subject:message-with-invalid-from)\r
++test_emacs "(notmuch-show \"$thread\")\r
++          (test-output)"\r
++cat <<EOF >EXPECTED\r
++"Invalid " (2001-01-05) (inbox)\r
++Subject: message-with-invalid-from\r
++To: Notmuch Test Suite <test_suite@notmuchmail.org>\r
++Date: Fri, 05 Jan 2001 15:43:57 +0000\r
++\r
++This is just a test message (#1)\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++os_x_darwin_thread=$(notmuch search --output=threads id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com)\r
++\r
++test_begin_subtest "Add tag"\r
++test_emacs "(notmuch-show \"$os_x_darwin_thread\")\r
++          (execute-kbd-macro \"+tag-from-show-view\")"\r
++output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)\r
++test_expect_equal "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox tag-from-show-view unread)"\r
++\r
++test_begin_subtest "Remove tag"\r
++test_emacs "(notmuch-show \"$os_x_darwin_thread\")\r
++          (execute-kbd-macro \"-tag-from-show-view\")"\r
++output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)\r
++test_expect_equal "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"\r
++\r
+ test_begin_subtest "Hiding Original Message region at beginning of a message"\r
+ message_id='OriginalMessageHiding.1@notmuchmail.org'\r
+ add_message \\r
+@@ -24,6 +85,172 @@ test_emacs "(notmuch-show \"id:$message_id\")\r
+           (test-visible-output)"\r
+ test_expect_equal_file OUTPUT EXPECTED\r
\r
++test_begin_subtest "Do not call notmuch for non-inlinable application/mpeg parts"\r
++id='message-with-application/mpeg-attachment@notmuchmail.org'\r
++emacs_deliver_message \\r
++    'Message with application/mpeg attachment' \\r
++    '' \\r
++    "(message-goto-eoh)\r
++     (insert \"Message-ID: <$id>\n\")\r
++     (message-goto-body)\r
++     (mml-insert-part \"application/mpeg\")\r
++     (insert \"a fake mp3 file\")"\r
++notmuch_counter_reset\r
++test_emacs "(let ((notmuch-command \"$notmuch_counter_command\"))\r
++            (notmuch-show \"id:$id\"))"\r
++test_expect_equal $(notmuch_counter_value) 1\r
++\r
++test_begin_subtest "Do not call notmuch for non-inlinable audio/mpeg parts"\r
++id='message-with-audio/mpeg-attachment@notmuchmail.org'\r
++emacs_deliver_message \\r
++    'Message with audio/mpeg attachment' \\r
++    '' \\r
++    "(message-goto-eoh)\r
++     (insert \"Message-ID: <$id>\n\")\r
++     (message-goto-body)\r
++     (mml-insert-part \"audio/mpeg\")\r
++     (insert \"a fake mp3 file\")"\r
++notmuch_counter_reset\r
++test_emacs "(let ((notmuch-command \"$notmuch_counter_command\"))\r
++            (notmuch-show \"id:$id\"))"\r
++test_expect_equal $(notmuch_counter_value) 1\r
++\r
++test_begin_subtest "Save attachment using notmuch-show-save-attachments"\r
++# save as archive to test that Emacs does not re-compress .gz\r
++test_emacs '(let ((standard-input "\"attachment1.gz\""))\r
++            (notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")\r
++            (notmuch-show-save-attachments))'\r
++test_expect_equal_file attachment1.gz "$EXPECTED/attachment"\r
++\r
++test_begin_subtest "Save attachment using notmuch-show-save-part"\r
++# save as archive to test that Emacs does not re-compress .gz\r
++test_emacs '(let ((standard-input "\"attachment2.gz\""))\r
++            (notmuch-show-save-part "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com" 5))'\r
++test_expect_equal_file attachment2.gz "$EXPECTED/attachment"\r
++\r
++test_begin_subtest "View raw message"\r
++test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")\r
++          (notmuch-show-view-raw-message)\r
++          (test-output)'\r
++test_expect_equal_file OUTPUT $EXPECTED/raw-message-cf0c4d-52ad0a\r
++\r
++test_begin_subtest "Hide/show signature"\r
++maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)\r
++test_emacs "(notmuch-show \"$maildir_storage_thread\")\r
++          (search-forward \"Click/Enter to show.\")\r
++          (button-activate (button-at (point)))\r
++          (search-backward \"Click/Enter to hide.\")\r
++          (button-activate (button-at (point)))\r
++          (test-output)"\r
++test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage\r
++\r
++test_begin_subtest "Detection and hiding of top-post quoting of message"\r
++add_message '[subject]="The problem with top-posting"' \\r
++          [id]=top-post-target \\r
++          '[body]="A: Because it messes up the order in which people normally read text.\r
++Q: Why is top-posting such a bad thing?\r
++A: Top-posting.\r
++Q: What is the most annoying thing in e-mail?"'\r
++add_message '[from]="Top Poster <top@poster.com>"' \\r
++          [in-reply-to]=top-post-target \\r
++          [references]=top-post-target \\r
++          '[subject]="Re: The problem with top-posting"' \\r
++          '[body]="Thanks for the advice! I will be sure to put it to good use.\r
++\r
++-Top Poster\r
++\r
++----- Original Message -----\r
++From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
++To: Notmuch Test Suite <test_suite@notmuchmai.org>\r
++Sent: Fri, 05 Jan 2001 15:43:57 +0000\r
++Subject: The problem with top-posting\r
++\r
++Q: Why is top-posting such a bad thing?\r
++A: Top-posting.\r
++Q: What is the most annoying thing in e-mail?"'\r
++test_emacs "(notmuch-show \"top-posting\")\r
++          (test-visible-output)"\r
++echo "Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox)\r
++Subject: The problem with top-posting\r
++To: Notmuch Test Suite <test_suite@notmuchmail.org>\r
++Date: Fri, 05 Jan 2001 15:43:57 +0000\r
++\r
++A: Because it messes up the order in which people normally read text.\r
++Q: Why is top-posting such a bad thing?\r
++A: Top-posting.\r
++Q: What is the most annoying thing in e-mail?\r
++Top Poster <top@poster.com> (2001-01-05) (inbox unread)\r
++Subject: Re: The problem with top-posting\r
++To: Notmuch Test Suite <test_suite@notmuchmail.org>\r
++Date: Fri, 05 Jan 2001 15:43:57 +0000\r
++\r
++Thanks for the advice! I will be sure to put it to good use.\r
++\r
++-Top Poster\r
++\r
++[ 9-line hidden original message. Click/Enter to show. ]" > EXPECTED\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++test_begin_subtest "Hiding message"\r
++test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")\r
++          (notmuch-show-toggle-message)\r
++          (test-visible-output)'\r
++test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages\r
++\r
++test_begin_subtest "Hiding message with visible citation"\r
++test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")\r
++          (search-forward "Click/Enter to show.")\r
++          (button-activate (button-at (point)))\r
++          (notmuch-show-toggle-message)\r
++          (test-visible-output)'\r
++test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages\r
++\r
++test_begin_subtest "Stash commands"\r
++add_message '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' \\r
++    '[from]="Some One <someone@somewhere.org>"' \\r
++    '[to]="Some One Else <notsomeone@somewhere.org>"' \\r
++    '[cc]="Notmuch <notmuch@notmuchmail.org>"' \\r
++    '[subject]="Stash my stashables"' \\r
++    '[id]="bought"' \\r
++    '[body]="Unable to stash body. Where did you get it in the first place?!?"'\r
++notmuch tag +stashtest id:${gen_msg_id}\r
++test_emacs '(notmuch-show "id:\"bought\"")\r
++      (notmuch-show-stash-date)\r
++      (notmuch-show-stash-from)\r
++      (notmuch-show-stash-to)\r
++      (notmuch-show-stash-cc)\r
++      (notmuch-show-stash-subject)\r
++      (notmuch-show-stash-message-id)\r
++      (notmuch-show-stash-message-id-stripped)\r
++      (notmuch-show-stash-tags)\r
++      (notmuch-show-stash-filename)\r
++      (notmuch-show-stash-mlarchive-link "Gmane")\r
++      (notmuch-show-stash-mlarchive-link "MARC")\r
++      (notmuch-show-stash-mlarchive-link "Mail Archive, The")\r
++      (switch-to-buffer\r
++        (generate-new-buffer "*test-stashing*"))\r
++      (dotimes (i 12)\r
++        (yank)\r
++        (insert "\n")\r
++        (rotate-yank-pointer 1))\r
++      (reverse-region (point-min) (point-max))\r
++          (test-output)'\r
++cat <<EOF >EXPECTED\r
++Sat, 01 Jan 2000 12:00:00 +0000\r
++Some One <someone@somewhere.org>\r
++Some One Else <notsomeone@somewhere.org>\r
++Notmuch <notmuch@notmuchmail.org>\r
++Stash my stashables\r
++id:"bought"\r
++bought\r
++inbox,stashtest\r
++${gen_msg_filename}\r
++http://mid.gmane.org/bought\r
++http://marc.info/?i=bought\r
++http://mail-archive.com/search?l=mid&q=bought\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
+ test_begin_subtest "Bare subject #1"\r
+ output=$(test_emacs '(notmuch-show-strip-re "Re: subject")')\r
+ test_expect_equal "$output" '"subject"'\r
+@@ -36,6 +263,37 @@ test_begin_subtest "Bare subject #3"\r
+ output=$(test_emacs '(notmuch-show-strip-re "the cure: fix the regexp")')\r
+ test_expect_equal "$output" '"the cure: fix the regexp"'\r
\r
++test_begin_subtest 'notmuch-show-advance-and-archive with invisible signature'\r
++message1='id:20091118010116.GC25380@dottiness.seas.harvard.edu'\r
++message2='id:1258491078-29658-1-git-send-email-dottedmag@dottedmag.net'\r
++test_emacs "(notmuch-search \"$message1 or $message2\")\r
++          (notmuch-test-wait)\r
++          (notmuch-search-show-thread)\r
++          (goto-char (point-max))\r
++          (redisplay)\r
++          (notmuch-show-advance-and-archive)\r
++          (test-output)"\r
++test_emacs "(notmuch-show \"$message2\")\r
++          (test-output \"EXPECTED\")"\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++test_begin_subtest "Refresh show buffer"\r
++test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")\r
++          (test-visible-output "EXPECTED")\r
++          (notmuch-show-refresh-view)\r
++          (test-visible-output)'\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++test_begin_subtest "Refresh modified show buffer"\r
++test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")\r
++          (notmuch-show-toggle-message)\r
++          (notmuch-show-next-message)\r
++          (notmuch-show-toggle-message)\r
++          (test-visible-output "EXPECTED")\r
++          (notmuch-show-refresh-view)\r
++          (test-visible-output)'\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
+ test_begin_subtest "Toggle display multipart/alternative"\r
+ cat <<EOF > ${MAIL_DIR}/embedded_message\r
+ From: Carl Worth <cworth@cworth.org>\r
+@@ -83,4 +341,155 @@ cat <<EOF >EXPECTED.diff\r
+ EOF\r
+ test_expect_equal_file {OUTPUT,EXPECTED}.diff\r
\r
++test_begin_subtest "Reply within emacs to a multipart/mixed message"\r
++test_emacs '(let ((message-hidden-headers ''()))\r
++          (notmuch-show "id:20091118002059.067214ed@hikari")\r
++              (notmuch-show-reply)\r
++              (test-output))'\r
++sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT\r
++cat <<EOF >EXPECTED\r
++From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
++To: Adrian Perez de Castro <aperez@igalia.com>, notmuch@notmuchmail.org\r
++Subject: Re: [notmuch] Introducing myself\r
++In-Reply-To: <20091118002059.067214ed@hikari>\r
++Fcc: ${MAIL_DIR}/sent\r
++References: <20091118002059.067214ed@hikari>\r
++User-Agent: Notmuch/XXX Emacs/XXX\r
++--text follows this line--\r
++Adrian Perez de Castro <aperez@igalia.com> writes:\r
++\r
++> Hello to all,\r
++>\r
++> I have just heard about Not Much today in some random Linux-related news\r
++> site (LWN?), my name is Adrian Perez and I work as systems administrator\r
++> (although I can do some code as well :P). I have always thought that the\r
++> ideas behind Sup were great, but after some time using it, I got tired of\r
++> the oddities that it has. I also do not like doing things like having to\r
++> install Ruby just for reading and sorting mails. Some time ago I thought\r
++> about doing something like Not Much and in fact I played a bit with the\r
++> Python+Xapian and the Python+Whoosh combinations, because I find relaxing\r
++> to code things in Python when I am not working and also it is installed\r
++> by default on most distribution. I got to have some mailboxes indexed and\r
++> basic searching working a couple of months ago. Lately I have been very\r
++> busy and had no time for coding, and them... boom! Not Much appears -- and\r
++> it is almost exactly what I was trying to do, but faster. I have been\r
++> playing a bit with Not Much today, and I think it has potential.\r
++>\r
++> Also, I would like to share one idea I had in mind, that you might find\r
++> interesting: One thing I have found very annoying is having to re-tag my\r
++> mail when the indexes get b0rked (it happened a couple of times to me while\r
++> using Sup), so I was planning to mails as read/unread and adding the tags\r
++> not just to the index, but to the mail text itself, e.g. by adding a\r
++> "X-Tags" header field or by reusing the "Keywords" one. This way, the index\r
++> could be totally recreated by re-reading the mail directories, and this\r
++> would also allow to a tools like OfflineIMAP [1] to get the mails into a\r
++> local maildir, tagging and indexing the mails with the e-mail reader and\r
++> then syncing back the messages with the "X-Tags" header to the IMAP server.\r
++> This would allow to use the mail reader from a different computer and still\r
++> have everything tagged finely.\r
++>\r
++> Best regards,\r
++>\r
++>\r
++> ---\r
++> [1] http://software.complete.org/software/projects/show/offlineimap\r
++>\r
++> -- \r
++> Adrian Perez de Castro <aperez@igalia.com>\r
++> Igalia - Free Software Engineering\r
++> _______________________________________________\r
++> notmuch mailing list\r
++> notmuch@notmuchmail.org\r
++> http://notmuchmail.org/mailman/listinfo/notmuch\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++test_begin_subtest "Reply within emacs to a multipart/alternative message"\r
++test_emacs '(let ((message-hidden-headers ''()))\r
++          (notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")\r
++              (notmuch-show-reply)\r
++              (test-output))'\r
++sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT\r
++cat <<EOF >EXPECTED\r
++From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
++To: Alex Botero-Lowry <alex.boterolowry@gmail.com>, notmuch@notmuchmail.org\r
++Subject: Re: [notmuch] preliminary FreeBSD support\r
++In-Reply-To: <cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com>\r
++Fcc: ${MAIL_DIR}/sent\r
++References: <cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com>\r
++User-Agent: Notmuch/XXX Emacs/XXX\r
++--text follows this line--\r
++Alex Botero-Lowry <alex.boterolowry@gmail.com> writes:\r
++\r
++> I saw the announcement this morning, and was very excited, as I had been\r
++> hoping sup would be turned into a library,\r
++> since I like the concept more than the UI (I'd rather an emacs interface).\r
++>\r
++> I did a preliminary compile which worked out fine, but\r
++> sysconf(_SC_SC_GETPW_R_SIZE_MAX) returns -1 on\r
++> FreeBSD, so notmuch_config_open segfaulted.\r
++>\r
++> Attached is a patch that supplies a default buffer size of 64 in cases where\r
++> -1 is returned.\r
++>\r
++> http://www.opengroup.org/austin/docs/austin_328.txt - seems to indicate this\r
++> is acceptable behavior,\r
++> and http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/07/msg016808.htmlspecifically\r
++> uses 64 as the\r
++> buffer size.\r
++> _______________________________________________\r
++> notmuch mailing list\r
++> notmuch@notmuchmail.org\r
++> http://notmuchmail.org/mailman/listinfo/notmuch\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++test_begin_subtest "Reply within emacs to an html-only message"\r
++add_message '[content-type]="text/html"' \\r
++          '[body]="Hi,<br />This is an <b>HTML</b> test message.<br /><br />OK?"'\r
++test_emacs "(let ((message-hidden-headers '()) (mm-text-html-renderer 'html2text))\r
++          (notmuch-show \"id:${gen_msg_id}\")\r
++          (notmuch-show-reply)\r
++          (test-output))"\r
++sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT\r
++cat <<EOF >EXPECTED\r
++From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
++To: \r
++Subject: Re: Reply within emacs to an html-only message\r
++In-Reply-To: <${gen_msg_id}>\r
++Fcc: ${MAIL_DIR}/sent\r
++References: <${gen_msg_id}>\r
++User-Agent: Notmuch/XXX Emacs/XXX\r
++--text follows this line--\r
++Notmuch Test Suite <test_suite@notmuchmail.org> writes:\r
++\r
++> Hi,This is an HTML test message.OK?\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++test_begin_subtest "Quote MML tags in reply"\r
++message_id='test-emacs-mml-quoting@message.id'\r
++add_message [id]="$message_id" \\r
++          "[subject]='$test_subtest_name'" \\r
++          '[body]="<#part disposition=inline>"'\r
++test_emacs "(let ((message-hidden-headers '()))\r
++            (notmuch-show \"id:$message_id\")\r
++            (notmuch-show-reply)\r
++            (test-output))"\r
++sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT\r
++cat <<EOF >EXPECTED\r
++From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
++To: \r
++Subject: Re: Quote MML tags in reply\r
++In-Reply-To: <test-emacs-mml-quoting@message.id>\r
++Fcc: ${MAIL_DIR}/sent\r
++References: <test-emacs-mml-quoting@message.id>\r
++User-Agent: Notmuch/XXX Emacs/XXX\r
++--text follows this line--\r
++Notmuch Test Suite <test_suite@notmuchmail.org> writes:\r
++\r
++> <#!part disposition=inline>\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
+ test_done\r
+-- \r
+1.7.10.4\r
+\r