--- /dev/null
+Return-Path: <tomi.ollila@iki.fi>\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 CDA3C431FAF\r
+ for <notmuch@notmuchmail.org>; Sun, 19 Feb 2012 13:04:40 -0800 (PST)\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 mch18Op+imyJ for <notmuch@notmuchmail.org>;\r
+ Sun, 19 Feb 2012 13:04:40 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66])\r
+ by olra.theworths.org (Postfix) with ESMTP id 0815F431FAE\r
+ for <notmuch@notmuchmail.org>; Sun, 19 Feb 2012 13:04:40 -0800 (PST)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+ id 0D9DB68055; Sun, 19 Feb 2012 23:04:38 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Pieter Praet <pieter@praet.org>, Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH v2 2/4] test: emacs: new test "notmuch-search: replying to\r
+ a thread (sending)"\r
+In-Reply-To: <1329683908-5435-3-git-send-email-pieter@praet.org>\r
+References: <1310313335-4159-1-git-send-email-pieter@praet.org>\r
+ <1329683908-5435-1-git-send-email-pieter@praet.org>\r
+ <1329683908-5435-3-git-send-email-pieter@praet.org>\r
+User-Agent: Notmuch/0.11.1+198~g922c4d2 (http://notmuchmail.org) Emacs/23.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Sun, 19 Feb 2012 23:04:38 +0200\r
+Message-ID: <m239a6wn4p.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\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, 19 Feb 2012 21:04:40 -0000\r
+\r
+On Sun, 19 Feb 2012 21:38:26 +0100, Pieter Praet <pieter@praet.org> wrote:\r
+> As pointed out in the previous commit, the test for replying from\r
+> within Emacs didn't actually submit the reply. This one does.\r
+> ---\r
+> test/emacs | 41 +++++++++++++++++++++++++++++++++++++++++\r
+> 1 files changed, 41 insertions(+), 0 deletions(-)\r
+> \r
+> diff --git a/test/emacs b/test/emacs\r
+> index 308d749..0f4f42b 100755\r
+> --- a/test/emacs\r
+> +++ b/test/emacs\r
+> @@ -273,6 +273,47 @@ On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> w\r
+> EOF\r
+> test_expect_equal_file OUTPUT EXPECTED\r
+> \r
+> +test_begin_subtest "notmuch-search: replying to a thread (sending)"\r
+> +$TEST_DIRECTORY/smtp-dummy sent_message &\r
+> +smtp_dummy_pid=$!\r
+> +test_emacs \\r
+> +'(let ((message-send-mail-function '\''message-smtpmail-send-it)\r
+> + (smtpmail-smtp-server "localhost")\r
+> + (smtpmail-smtp-service "25025"))\r
+> + (notmuch-search "subject:\"testing message sent via SMTP\"")\r
+> + (notmuch-test-wait)\r
+> + (notmuch-search-reply-to-thread)\r
+> + (end-of-buffer)\r
+> + (newline)\r
+> + (insert "Reply to a message via Emacs with fake SMTP")\r
+> + (message-send-and-exit))' >/dev/null 2>&1\r
+> +wait ${smtp_dummy_pid}\r
+> +notmuch new >/dev/null\r
+\r
+The above part smells like CopyPasteProgramming; (old version of) \r
+emacs_deliver_message copied (old as this version is lacking\r
+opportunistic quit). \r
+\r
+Maybe the functionality of emacs_deliver_message needs to be\r
+split into 3 parts: initialization, sending and finalization.\r
+then other uses can use initialization and finalization parts\r
+and provide their own sending part.\r
+\r
+I have work-in-progress code for initialization and finalization\r
+parts of that and I don't want to do the changes in 2 places...\r
+\r
+Tomi\r