--- /dev/null
+Return-Path: <bremner@tethera.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 8AAF4431FC0\r
+ for <notmuch@notmuchmail.org>; Tue, 29 Jan 2013 15:26:26 -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 RK882ojw7mzX for <notmuch@notmuchmail.org>;\r
+ Tue, 29 Jan 2013 15:26:23 -0800 (PST)\r
+Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238])\r
+ (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 2431F431FAE\r
+ for <notmuch@notmuchmail.org>; Tue, 29 Jan 2013 15:26:23 -0800 (PST)\r
+Received: from fctnnbsc30w-156034082078.dhcp-dynamic.fibreop.nb.bellaliant.net\r
+ ([156.34.82.78] helo=zancas.localnet)\r
+ by tesseract.cs.unb.ca with esmtpsa\r
+ (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80)\r
+ (envelope-from <bremner@tethera.net>)\r
+ id 1U0KZK-0004lK-4Y; Tue, 29 Jan 2013 19:26:22 -0400\r
+Received: from bremner by zancas.localnet with local (Exim 4.80)\r
+ (envelope-from <bremner@tethera.net>)\r
+ id 1U0KZE-0007G8-JE; Tue, 29 Jan 2013 19:26:16 -0400\r
+From: david@tethera.net\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/2] test: delay watchdog checks in emacs.\r
+Date: Tue, 29 Jan 2013 19:26:12 -0400\r
+Message-Id: <1359501973-27671-2-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <1359501973-27671-1-git-send-email-david@tethera.net>\r
+References: <1359501973-27671-1-git-send-email-david@tethera.net>\r
+X-Spam_bar: -\r
+Cc: David Bremner <bremner@debian.org>\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: Tue, 29 Jan 2013 23:26:26 -0000\r
+\r
+From: David Bremner <bremner@debian.org>\r
+\r
+Instead of checking immediately for the watched process, delay a\r
+minute, or in the case that process-attributes returns nil, for two\r
+minutes. This is intended to cope with the case that\r
+process-attributes is unimplimented, and returns always returns nil.\r
+In this case, the watchdog check is the same as the two minute limit\r
+imposed by timeout.\r
+---\r
+ test/test-lib.el | 13 ++++++++++---\r
+ 1 file changed, 10 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/test/test-lib.el b/test/test-lib.el\r
+index dece811..d26b49f 100644\r
+--- a/test/test-lib.el\r
++++ b/test/test-lib.el\r
+@@ -77,12 +77,19 @@ invisible text."\r
+ (setq start next-pos)))\r
+ str))\r
+ \r
+-(defun orphan-watchdog (pid)\r
++(defun orphan-watchdog-check (pid)\r
+ "Periodically check that the process with id PID is still\r
+ running, quit if it terminated."\r
+ (if (not (process-attributes pid))\r
+- (kill-emacs)\r
+- (run-at-time "1 min" nil 'orphan-watchdog pid)))\r
++ (kill-emacs)))\r
++\r
++(defun orphan-watchdog (pid)\r
++ "Initiate orphan watchdog check."\r
++ ; If process-attributes returns nil right away, that probably means\r
++ ; it is unimplimented. So we delay two minutes before killing emacs.\r
++ (if (process-attributes pid)\r
++ (run-at-time 60 60 'orphan-watchdog-check pid)\r
++ (run-at-time 120 60 'orphan-watchdog-check pid)))\r
+ \r
+ (defun hook-counter (hook)\r
+ "Count how many times a hook is called. Increments\r
+-- \r
+1.7.10.4\r
+\r