--- /dev/null
+Return-Path: <sojkam1@fel.cvut.cz>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 818846DE1579\r
+ for <notmuch@notmuchmail.org>; Mon, 28 Dec 2015 13:17:20 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.364\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.364 tagged_above=-999 required=5 tests=[AWL=1.486,\r
+ RCVD_IN_DNSWL_MED=-2.3, RP_MATCHES_RCVD=-0.55] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id m_YUiT0v6IxX for <notmuch@notmuchmail.org>;\r
+ Mon, 28 Dec 2015 13:17:17 -0800 (PST)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 57FDE6DE111A\r
+ for <notmuch@notmuchmail.org>; Mon, 28 Dec 2015 13:17:17 -0800 (PST)\r
+Received: from localhost (unknown [192.168.200.7])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id 912E419F38E4\r
+ for <notmuch@notmuchmail.org>; Mon, 28 Dec 2015 22:17:15 +0100 (CET)\r
+X-Virus-Scanned: IMAP STYX AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+ by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new, port 10044)\r
+ with ESMTP id fM4AKUgH-kuV for <notmuch@notmuchmail.org>;\r
+ Mon, 28 Dec 2015 22:17:14 +0100 (CET)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id 24C6F19F3893\r
+ for <notmuch@notmuchmail.org>; Mon, 28 Dec 2015 22:17:13 +0100 (CET)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.86)\r
+ (envelope-from <sojkam1@fel.cvut.cz>)\r
+ id 1aDfAF-0003hl-P3; Mon, 28 Dec 2015 22:17:11 +0100\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] test: Unset ALTERNATE_EDITOR before running emacsclient\r
+Date: Mon, 28 Dec 2015 22:16:35 +0100\r
+Message-Id: <1451337395-14196-1-git-send-email-sojkam1@fel.cvut.cz>\r
+X-Mailer: git-send-email 2.6.4\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 28 Dec 2015 21:17:20 -0000\r
+\r
+ALTERNATE_EDITOR causes emacsclient to run an alternate editor if the\r
+emacs server is not ready. This can collide with intended\r
+functionality in test-lib.sh.\r
+\r
+If the ALTERNATE_EDITOR is set but empty, emacsclient runs emacs\r
+daemon and tries to connect to it. When this happens the emacs run by\r
+test-lib.sh fails to start the server and the subsequent attempts to\r
+use the server fail because the daemon started by emacsclient does not\r
+know about notmuch-test-progn. This leads to test suite failure due to\r
+time out on any emacs test.\r
+---\r
+ test/test-lib.sh | 1 +\r
+ 1 file changed, 1 insertion(+)\r
+\r
+diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+index 126911f..0f6a6cf 100644\r
+--- a/test/test-lib.sh\r
++++ b/test/test-lib.sh\r
+@@ -1152,6 +1152,7 @@ test_emacs () {\r
+ rm -f OUTPUT\r
+ touch OUTPUT\r
+ \r
++ unset ALTERNATE_EDITOR\r
+ ${TEST_EMACSCLIENT} --socket-name="$EMACS_SERVER" --eval "(notmuch-test-progn $@)"\r
+ }\r
+ \r
+-- \r
+2.6.4\r
+\r