--- /dev/null
+Return-Path: <markwalters1009@gmail.com>\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 49C8C431FB6\r
+ for <notmuch@notmuchmail.org>; Sat, 8 Dec 2012 04:44:35 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 2.7\r
+X-Spam-Level: **\r
+X-Spam-Status: No, score=2.7 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+ FREEMAIL_REPLY=2.499, RCVD_IN_DNSWL_LOW=-0.7] 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 PNblZuD5BeQU for <notmuch@notmuchmail.org>;\r
+ Sat, 8 Dec 2012 04:44:34 -0800 (PST)\r
+Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com\r
+ [209.85.212.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id A8EA8431FAE\r
+ for <notmuch@notmuchmail.org>; Sat, 8 Dec 2012 04:44:34 -0800 (PST)\r
+Received: by mail-wi0-f175.google.com with SMTP id hm11so190829wib.2\r
+ for <notmuch@notmuchmail.org>; Sat, 08 Dec 2012 04:44:33 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:cc:subject:date:message-id:x-mailer;\r
+ bh=PzmNXBgBtx+Kl8rgpsIjdngHlrjp9L2M6AUrIHpR2As=;\r
+ b=xOopKgPOI9oL9E6OaUpLfn5tnaz99dN8wKJzFc37+G24BHVeWUDRje07AvGD84fHnW\r
+ phgx/Th+mApqjkKoNGamXLPu8I0CeFlvqw/caUdkgg4YYM6V/74GvrVjbsHMOQhorwAL\r
+ ZviDoGDBT/xrnseT92m0yVnQ531VBpCHypIZzHDHEhRuCG+WNym47B0BFRWPcvA1P0xU\r
+ S/VHji/0A6vaDK4g0CLaJR0obGI/MN+i1GwaQ0tmUhay2d01ARVdxQ/+yoxVgnOhg9qI\r
+ 0StZT96UG8KXfZzE75PTZIAgFYKAhqhHpe4LzaturhfOHchq/49VyIlwJ5M15E4b1jyt\r
+ Y3rw==\r
+Received: by 10.180.87.225 with SMTP id bb1mr2907782wib.20.1354970673405;\r
+ Sat, 08 Dec 2012 04:44:33 -0800 (PST)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+ by mx.google.com with ESMTPS id bd7sm2403136wib.8.2012.12.08.04.44.31\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Sat, 08 Dec 2012 04:44:32 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] contrib: pick: slightly tweak running search and pick from\r
+ pick buffer\r
+Date: Sat, 8 Dec 2012 12:44:34 +0000\r
+Message-Id: <1354970674-18136-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\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: Sat, 08 Dec 2012 12:44:35 -0000\r
+\r
+Previously running search or pick from the pick buffer did not close\r
+the message pane (if open). This meant that then new search ends up in\r
+a very small window. Fix this so that the message pane is\r
+shut. However, make it so that the pane is shut after the search\r
+string is entered in case the user is basing the search on something\r
+in the current message.\r
+---\r
+\r
+This is essentially an independent patch but the context clashes with\r
+id:1354970494-18050-1-git-send-email-markwalters1009@gmail.com so that\r
+should be applied first for testing.\r
+\r
+If there is any problem with the first patch I can trivially rebase\r
+this one.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+ contrib/notmuch-pick/notmuch-pick.el | 23 +++++++++++++++++++++--\r
+ 1 files changed, 21 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el\r
+index 36587a6..b474231 100644\r
+--- a/contrib/notmuch-pick/notmuch-pick.el\r
++++ b/contrib/notmuch-pick/notmuch-pick.el\r
+@@ -175,8 +175,8 @@\r
+ (define-key map "?" 'notmuch-help)\r
+ (define-key map "a" 'notmuch-pick-archive-message-then-next)\r
+ (define-key map "=" 'notmuch-pick-refresh-view)\r
+- (define-key map "s" 'notmuch-search)\r
+- (define-key map "z" 'notmuch-pick)\r
++ (define-key map "s" 'notmuch-pick-to-search)\r
++ (define-key map "z" 'notmuch-pick-to-pick)\r
+ (define-key map "m" 'notmuch-pick-new-mail)\r
+ (define-key map "f" 'notmuch-pick-forward-message)\r
+ (define-key map "r" 'notmuch-pick-reply-sender)\r
+@@ -289,6 +289,25 @@ Does NOT change the database."\r
+ (interactive)\r
+ (notmuch-pick-tag "-"))\r
+ \r
++;; The next two functions close the message window before searching or\r
++;; picking but they do so after the user has entered the query (in\r
++;; case the user was basing the query on something in the message\r
++;; window).\r
++\r
++(defun notmuch-pick-to-search ()\r
++ "Run \"notmuch search\" with the given `query' and display results."\r
++ (interactive)\r
++ (let ((query (notmuch-read-query "Notmuch search: ")))\r
++ (notmuch-pick-close-message-window)\r
++ (notmuch-search query)))\r
++\r
++(defun notmuch-pick-to-pick ()\r
++ "Run a query and display results in experimental notmuch-pick mode"\r
++ (interactive)\r
++ (let ((query (notmuch-read-query "Notmuch pick: ")))\r
++ (notmuch-pick-close-message-window)\r
++ (notmuch-pick query)))\r
++\r
+ ;; This function should be in notmuch-hello.el but we are trying to\r
+ ;; minimise impact on the rest of the codebase.\r
+ (defun notmuch-pick-from-hello (&optional search)\r
+-- \r
+1.7.9.1\r
+\r