[PATCH 08/11] contrib: pick: close window function

Subject: [PATCH 08/11] contrib: pick: close window function

Date: Fri, 5 Jul 2013 19:11:15 +0100

To: notmuch@notmuchmail.org

Cc:

From: Mark Walters


---
 contrib/notmuch-pick/notmuch-pick.el |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
index 77b257d..4ad6ef6 100644
--- a/contrib/notmuch-pick/notmuch-pick.el
+++ b/contrib/notmuch-pick/notmuch-pick.el
@@ -208,6 +208,18 @@ This function does not give an error if there is no button."
   (let ((button (or button (button-at (point)))))
     (when button (button-activate button))))
 
+(defun notmuch-pick-close-message-pane-and (func)
+  "Close message pane and execute FUNC.
+
+This function returns a function (so can be used as a keybinding)
+which closes the message pane if open and then executes function
+FUNC."
+  `(lambda ()
+      ,(concat "(Close message pane and) " (documentation func t))
+     (interactive)
+     (notmuch-pick-close-message-window)
+     (funcall #',func)))
+
 (defvar notmuch-pick-mode-map
   (let ((map (make-sparse-keymap)))
     (define-key map [mouse-1] 'notmuch-pick-show-message)
-- 
1.7.9.1


Thread: