--- /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 9F506429E45\r
+ for <notmuch@notmuchmail.org>; Fri, 5 Jul 2013 11:13:04 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 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
+ 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 EokVyktAayNw for <notmuch@notmuchmail.org>;\r
+ Fri, 5 Jul 2013 11:12:58 -0700 (PDT)\r
+Received: from mail-ea0-f171.google.com (mail-ea0-f171.google.com\r
+ [209.85.215.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 13C09431FC4\r
+ for <notmuch@notmuchmail.org>; Fri, 5 Jul 2013 11:11:53 -0700 (PDT)\r
+Received: by mail-ea0-f171.google.com with SMTP id m14so1644272eaj.30\r
+ for <notmuch@notmuchmail.org>; Fri, 05 Jul 2013 11:11:52 -0700 (PDT)\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:in-reply-to:references;\r
+ bh=Wnc0CMw22ZX1K84TiUD7Qom991BIBFdpC3W6s8EjsJ8=;\r
+ b=adUdcgwj+3Egm7BSOljOjkgHD1oeYvWkR83S7YuS+9FTBvn0LEsuAFsKVsZXnY3f4a\r
+ 0P9Aqb2kRWzt2q7GwhDOVDlyrNt0NrIIdeq/XgoztB7f7XnpdLyzGpvBRpyOLg7CIUXR\r
+ D27v6dC/fLJ6ux6X3WNkwmft0kDzGc5Rd3ZVGOnQv9CyswWIK1CYq2sZ67TVnRpQJIMP\r
+ 5xyBtocUCgRHWWxGoveY6BP+Wy6wqeruKRKdi/YKH9EIv8+s6HWPU6lDZ9d5VdRWclBK\r
+ 8/F3GzSHa8jIhv5yF6itkLDGEQrghn2ywLaCJ5ehmE/VMMRBKA8AM/4eBWnxLCh82phy\r
+ ezHA==\r
+X-Received: by 10.14.115.9 with SMTP id d9mr13274564eeh.87.1373047912940;\r
+ Fri, 05 Jul 2013 11:11:52 -0700 (PDT)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+ by mx.google.com with ESMTPSA id\r
+ ci50sm15891053eeb.12.2013.07.05.11.11.52 for <multiple recipients>\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Fri, 05 Jul 2013 11:11:52 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 11/11] contrib: pick: use close-message-pane for reply etc\r
+Date: Fri, 5 Jul 2013 19:11:18 +0100\r
+Message-Id: <1373047878-20822-12-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1373047878-20822-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1373047878-20822-1-git-send-email-markwalters1009@gmail.com>\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: Fri, 05 Jul 2013 18:13:05 -0000\r
+\r
+We can save some code duplication by using the new close-message-pane\r
+functionality for reply, forward, and new mail.\r
+---\r
+ contrib/notmuch-pick/notmuch-pick.el | 43 +++------------------------------\r
+ 1 files changed, 4 insertions(+), 39 deletions(-)\r
+\r
+diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el\r
+index 15c7e74..9587dda 100644\r
+--- a/contrib/notmuch-pick/notmuch-pick.el\r
++++ b/contrib/notmuch-pick/notmuch-pick.el\r
+@@ -236,6 +236,10 @@ FUNC."\r
+ (define-key map "/" (notmuch-pick-to-message-pane #'notmuch-pick-button-activate))\r
+ \r
+ ;; bindings from show (or elsewhere) but we close the message pane first.\r
++ (define-key map "m" (notmuch-pick-close-message-pane-and #'notmuch-mua-new-mail))\r
++ (define-key map "f" (notmuch-pick-close-message-pane-and #'notmuch-show-forward-message))\r
++ (define-key map "r" (notmuch-pick-close-message-pane-and #'notmuch-show-reply-sender))\r
++ (define-key map "R" (notmuch-pick-close-message-pane-and #'notmuch-show-reply))\r
+ (define-key map "V" (notmuch-pick-close-message-pane-and #'notmuch-show-view-raw-message))\r
+ (define-key map "?" (notmuch-pick-close-message-pane-and #'notmuch-help))\r
+ \r
+@@ -246,10 +250,6 @@ FUNC."\r
+ (define-key map "=" 'notmuch-pick-refresh-view)\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
+- (define-key map "R" 'notmuch-pick-reply)\r
+ (define-key map "n" 'notmuch-pick-next-matching-message)\r
+ (define-key map "p" 'notmuch-pick-prev-matching-message)\r
+ (define-key map "N" 'notmuch-pick-next-message)\r
+@@ -599,41 +599,6 @@ message will be \"unarchived\", i.e. the tag changes in\r
+ target\r
+ (get-buffer buffer-name))))\r
+ \r
+-(defmacro with-current-notmuch-pick-message (&rest body)\r
+- "Evaluate body with current buffer set to the text of current message"\r
+- `(save-excursion\r
+- (let ((id (notmuch-pick-get-message-id)))\r
+- (let ((buf (generate-new-buffer (concat "*notmuch-msg-" id "*"))))\r
+- (with-current-buffer buf\r
+- (call-process notmuch-command nil t nil "show" "--format=raw" id)\r
+- ,@body)\r
+- (kill-buffer buf)))))\r
+-\r
+-(defun notmuch-pick-new-mail (&optional prompt-for-sender)\r
+- "Compose new mail."\r
+- (interactive "P")\r
+- (notmuch-pick-close-message-window)\r
+- (notmuch-mua-new-mail prompt-for-sender ))\r
+-\r
+-(defun notmuch-pick-forward-message (&optional prompt-for-sender)\r
+- "Forward the current message."\r
+- (interactive "P")\r
+- (notmuch-pick-close-message-window)\r
+- (with-current-notmuch-pick-message\r
+- (notmuch-mua-new-forward-message prompt-for-sender)))\r
+-\r
+-(defun notmuch-pick-reply (&optional prompt-for-sender)\r
+- "Reply to the sender and all recipients of the current message."\r
+- (interactive "P")\r
+- (notmuch-pick-close-message-window)\r
+- (notmuch-mua-new-reply (notmuch-pick-get-message-id) prompt-for-sender t))\r
+-\r
+-(defun notmuch-pick-reply-sender (&optional prompt-for-sender)\r
+- "Reply to the sender of the current message."\r
+- (interactive "P")\r
+- (notmuch-pick-close-message-window)\r
+- (notmuch-mua-new-reply (notmuch-pick-get-message-id) prompt-for-sender nil))\r
+-\r
+ (defun notmuch-pick-clean-address (address)\r
+ "Try to clean a single email ADDRESS for display. Return\r
+ AUTHOR_NAME if present, otherwise return AUTHOR_EMAIL. Return\r
+-- \r
+1.7.9.1\r
+\r